Example usage for org.apache.ibatis.cache CacheKey equals

List of usage examples for org.apache.ibatis.cache CacheKey equals

Introduction

In this page you can find the example usage for org.apache.ibatis.cache CacheKey equals.

Prototype

@Override
    public boolean equals(Object object) 

Source Link

Usage

From source file:com.ibatis.sqlmap.CacheStatementTest.java

License:Apache License

public void testCacheKeyWithSameHashcode() {
    CacheKey key1 = new CacheKey();
    CacheKey key2 = new CacheKey();

    key1.update("HS1CS001");
    key2.update("HS1D4001");

    assertEquals("Expect same hashcode.", key1.hashCode(), key2.hashCode());
    assertFalse("Expect not equal", key1.equals(key2));
}

From source file:com.ibatis.sqlmap.CacheStatementTest.java

License:Apache License

public void testCacheKeyWithTwoParamsSameHashcode() {
    CacheKey key1 = new CacheKey();
    CacheKey key2 = new CacheKey();

    key1.update("HS1CS001");
    key1.update("HS1D4001");

    key2.update("HS1D4001");
    key2.update("HS1CS001");

    assertEquals("Expect same hashcode.", key1.hashCode(), key2.hashCode());
    assertFalse("Expect not equal", key1.equals(key2));
}

From source file:com.ibatis.sqlmap.engine.cache.CacheKeyTest.java

License:Apache License

public void testUpdate() {
    CacheKey key3 = new CacheKey();

    CacheKey key4 = new CacheKey();

    key3.update("AV");

    key4.update("B7");

    assertTrue(!key3.equals(key4));
    assertTrue(!key3.toString().equals(key4.toString()));

}