[jboss-cvs] JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation ...
Ben Wang
bwang at jboss.com
Tue Sep 5 02:32:12 EDT 2006
User: bwang
Date: 06/09/05 02:32:12
Modified: tests-50/functional/org/jboss/cache/pojo/passivation
LocalTest.java ReplicatedTest.java
Log:
Updated api
Revision Changes Path
1.3 +20 -10 JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation/LocalTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation/LocalTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- LocalTest.java 20 Jul 2006 18:43:13 -0000 1.2
+++ LocalTest.java 5 Sep 2006 06:32:12 -0000 1.3
@@ -17,6 +17,7 @@
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Link;
import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.Fqn;
import org.jboss.util.id.UID;
import java.util.ArrayList;
@@ -94,8 +95,10 @@
cache_.attach(id, joe);
Thread.sleep(11000); // default is 3 seconds so joe should have been passivated.
+// assertFalse("Node should be evicted ",
+// cache_.getCache().exists(id));
assertFalse("Node should be evicted ",
- cache_.getCache().exists(id));
+ cache_.getCache().hasChild(new Fqn(id)));
assertEquals("age ", 20, joe.getAge());
joe.setAge(30);
@@ -110,11 +113,15 @@
cache_.attach(id, joe);
Thread.sleep(11000); // default is 3 seconds so joe should have been passivated.
+// assertFalse("Node should be evicted ",
+// cache_.getCache().exists(id));
assertFalse("Node should be evicted ",
- cache_.getCache().exists(id));
+ cache_.getCache().hasChild(new Fqn(id)));
+// assertFalse("Node should be evicted ",
+// cache_.getCache().exists(id));
assertFalse("Node should be evicted ",
- cache_.getCache().exists(id));
+ cache_.getCache().hasChild(new Fqn(id)));
Person p = (Person)cache_.find(id);
@@ -130,10 +137,11 @@
public void testMultipleReference() throws Exception
{
log.info("testMultipleReference() ...");
- cache_.attach("/person/joe", createPerson("Joe Black", 31));
- Person joe = (Person) cache_.find("/person/joe");
- cache_.attach("/person/ben", createPerson("Ben Hogan", 51));
- Person ben = (Person) cache_.find("/person/ben");
+ String id = "/person/joe";
+ cache_.attach(id, createPerson("Joe Black", 31));
+ Person joe = (Person) cache_.find(id);
+ cache_.attach(id, createPerson("Ben Hogan", 51));
+ Person ben = (Person) cache_.find(id);
Address addr = new Address();
addr.setStreet("123 Albert Ave.");
@@ -147,15 +155,17 @@
ben.setAddress(addr);
log.info("testMultipleReference(): verify");
- Address add1 = (Address) ((Person) cache_.find("/person/joe")).getAddress();
- Address add2 = (Address) ((Person) cache_.find("/person/ben")).getAddress();
+ Address add1 = (Address) ((Person) cache_.find(id)).getAddress();
+ Address add2 = (Address) ((Person) cache_.find(id)).getAddress();
assertEquals(add1.getCity(), add2.getCity());
addr.setCity("Santa Clara");
assertEquals(add1.getCity(), add2.getCity());
Thread.sleep(11000); // default is 3 seconds so joe should have been passivated.
+// assertFalse("Node should be evicted ",
+// cache_.getCache().exists("/person/joe"));
assertFalse("Node should be evicted ",
- cache_.getCache().exists("/person/joe"));
+ cache_.getCache().hasChild(new Fqn(id)));
assertEquals("City is ", "Santa Clara", add2.getCity());
1.2 +3 -2 JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation/ReplicatedTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ReplicatedTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation/ReplicatedTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ReplicatedTest.java 20 Jul 2006 02:44:20 -0000 1.1
+++ ReplicatedTest.java 5 Sep 2006 06:32:12 -0000 1.2
@@ -15,6 +15,7 @@
import org.jboss.cache.pojo.*;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.pojo.test.Student;
+import org.jboss.cache.Fqn;
import java.util.List;
@@ -71,9 +72,9 @@
Thread.sleep(11000);
assertFalse("Node should be evicted ",
- cache.getCache().exists(id));
+ cache.getCache().hasChild(new Fqn(id)));
assertFalse("Node should be evicted ",
- cache1.getCache().exists(id));
+ cache1.getCache().hasChild(new Fqn(id)));
assertEquals("Ben Wang", ben.getName());
More information about the jboss-cvs-commits
mailing list