Author: lmeadors
Date: Tue Aug 29 06:09:09 2006
New Revision: 438066
URL: http://svn.apache.org/viewvc?rev=438066&view=rev
Log:
Fixing a toString issue
Added:
ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/engine/cache/CacheKeyTest.java
Modified:
ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/cache/CacheKey.java
Modified:
ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/cache/CacheKey.java
URL:
http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/cache/CacheKey.java?rev=438066&r1=438065&r2=438066&view=diff
==============================================================================
---
ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/cache/CacheKey.java
(original)
+++
ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/cache/CacheKey.java
Tue Aug 29 06:09:09 2006
@@ -42,7 +42,7 @@
}
/**
- * Costructor that supplies an initial hashcode
+ * Constructor that supplies an initial hashcode
*
* @param initialNonZeroOddNumber - the hashcode to use
*/
@@ -123,7 +123,12 @@
}
public String toString() {
- return new
StringBuffer().append(hashcode).append('|').append(checksum).toString();
+ StringBuffer returnValue = new
StringBuffer().append(hashcode).append('|').append(checksum);
+ for (int i=0; i < paramList.size(); i++) {
+ returnValue.append('|').append(paramList.get(i));
+ }
+
+ return returnValue.toString();
}
}
Added:
ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/engine/cache/CacheKeyTest.java
URL:
http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/engine/cache/CacheKeyTest.java?rev=438066&view=auto
==============================================================================
---
ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/engine/cache/CacheKeyTest.java
(added)
+++
ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/engine/cache/CacheKeyTest.java
Tue Aug 29 06:09:09 2006
@@ -0,0 +1,44 @@
+package com.ibatis.sqlmap.engine.cache;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.framework.TestCase;
+
+/**
+ * CacheKey Tester.
+ *
+ * @author <Authors name>
+ * @version 1.0
+ * @since <pre>08/29/2006</pre>
+ */
+public class CacheKeyTest extends TestCase {
+ public CacheKeyTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ 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()));
+
+ }
+
+ public static Test suite() {
+ return new TestSuite(CacheKeyTest.class);
+ }
+}