[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/pojo ...
Jason Thomas Greene
jgreene at jboss.com
Thu Jun 21 13:43:58 EDT 2007
User: jgreene
Date: 07/06/21 13:43:58
Modified: tests/functional/org/jboss/cache/pojo
NewReplicatedTest.java ReplicatedTest.java
Log:
Fix JBCACHE-1110
Intial patch from vincent.marquez at gmail.com
Revision Changes Path
1.6 +2 -2 JBossCache/tests/functional/org/jboss/cache/pojo/NewReplicatedTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NewReplicatedTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/NewReplicatedTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- NewReplicatedTest.java 23 May 2007 10:28:49 -0000 1.5
+++ NewReplicatedTest.java 21 Jun 2007 17:43:58 -0000 1.6
@@ -129,8 +129,8 @@
assertNull("Object should be null ", cache_.find("/a"));
assertNull("Object should be null ", cache1_.find("/a"));
- // It is 0 since it will be un-initialized.
- assertEquals("Age should be ", 0, remote.getAge());
+ // It should still be 10
+ assertEquals("Age should be ", 10, remote.getAge());
}
public void testRemoteRemove2() throws Exception
1.4 +14 -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.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ReplicatedTest.java 21 Jun 2007 01:33:03 -0000 1.3
+++ ReplicatedTest.java 21 Jun 2007 17:43:58 -0000 1.4
@@ -156,6 +156,20 @@
assertTrue("Expected PojoCacheAlreadyDetachedException!", passSet);
}
+ public void testStaleFieldDetach() throws Exception
+ {
+ Person ben = createPerson("/person/test2", "Ben Wang", 40);
+ ben = (Person) cache1.find("/person/test2");
+
+ // Update on remote node
+ ben.setAge(99);
+
+ // Detach before a field read on local node
+ ben = (Person) cache.detach("/person/test2");
+
+ assertEquals("Detach did not refresh field", 99, ben.getAge());
+ }
+
public void testInheritance() throws Exception
{
Student joe = createStudent("/person/joe", "Joe", 32, "Senior");
More information about the jboss-cvs-commits
mailing list