[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/pojo ...
Jason Thomas Greene
jgreene at jboss.com
Wed Jun 20 21:33:03 EDT 2007
User: jgreene
Date: 07/06/20 21:33:03
Modified: tests/functional/org/jboss/cache/pojo
RecursiveRefTest.java ReplicatedTest.java
Log:
Fix JBCACHE-1057
Revision Changes Path
1.3 +10 -19 JBossCache/tests/functional/org/jboss/cache/pojo/RecursiveRefTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RecursiveRefTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/RecursiveRefTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- RecursiveRefTest.java 23 May 2007 10:28:49 -0000 1.2
+++ RecursiveRefTest.java 21 Jun 2007 01:33:03 -0000 1.3
@@ -44,25 +44,16 @@
{
}
-
- /**
- * This test feature is not currently supported now since we can't support key is non-primitive object
- * that overrides the hashCode().
- */
- public void testRecuriveMapKey()
- {
- try
- {
- IdObject id = new IdObject("1");
- ValueObject value = new ValueObject(id, 3.0f);
- cachedMap.put(id, value);
- } // try
- catch (Exception x)
- {
- x.printStackTrace();
- fail("testFailed");
- } // catch
- } // initCache
+//
+// This is a bogus test. A key must be serializable since it part of an FQN.
+// Also it shouldn't be mutable.
+//
+// public void testRecuriveMapKey()
+// {
+// IdObject id = new IdObject("1");
+// ValueObject value = new ValueObject(id, 3.0f);
+// cachedMap.put(id, value);
+// }
public void testRecursiveList() throws Exception
{
1.3 +33 -0 JBossCache/tests/functional/org/jboss/cache/pojo/ReplicatedTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ReplicatedTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/ReplicatedTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- ReplicatedTest.java 16 Apr 2007 17:37:10 -0000 1.2
+++ ReplicatedTest.java 21 Jun 2007 01:33:03 -0000 1.3
@@ -123,6 +123,39 @@
cache.detach("/person/test2");
}
+ public void testPostDetachModification() throws Exception
+ {
+ Person ben = createPerson("/person/test2", "Ben Wang", 40);
+ ben = (Person) cache1.find("/person/test2");
+
+ // Detach on remote node
+ cache.detach("/person/test2");
+
+ boolean passGet = false;
+ try
+ {
+ ben.getAge();
+ }
+ catch (PojoCacheAlreadyDetachedException e)
+ {
+ passGet = true;
+ }
+
+ assertTrue("Expected PojoCacheAlreadyDetachedException!", passGet);
+
+ boolean passSet = false;
+ try
+ {
+ ben.setAge(10);
+ }
+ catch (PojoCacheAlreadyDetachedException e)
+ {
+ passSet = true;
+ }
+
+ assertTrue("Expected PojoCacheAlreadyDetachedException!", passSet);
+ }
+
public void testInheritance() throws Exception
{
Student joe = createStudent("/person/joe", "Joe", 32, "Senior");
More information about the jboss-cvs-commits
mailing list