[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/statetransfer ...
Ben Wang
bwang at jboss.com
Mon Oct 9 04:14:05 EDT 2006
User: bwang
Date: 06/10/09 04:14:05
Modified: tests/functional/org/jboss/cache/statetransfer
VersionedTestBase.java ForcedStateTransferTest.java
Log:
Updated with new getRegion api
Revision Changes Path
1.16 +25 -25 JBossCache/tests/functional/org/jboss/cache/statetransfer/VersionedTestBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: VersionedTestBase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/VersionedTestBase.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- VersionedTestBase.java 13 Sep 2006 15:56:47 -0000 1.15
+++ VersionedTestBase.java 9 Oct 2006 08:14:05 -0000 1.16
@@ -201,7 +201,7 @@
{
CacheSPI cache1 = createCache("cache1", false, true, false);
- cache1.getRegion(A).activate();
+ cache1.getRegion(A, true).activate();
cache1.put(A_B, "name", JOE);
cache1.put(A_B, "age", TWENTY);
@@ -218,7 +218,7 @@
assertNull("/a/c name transferred against policy", cache2.get(A_C, "name"));
assertNull("/a/c age transferred against policy", cache2.get(A_C, "age"));
- cache2.getRegion(A_B).activate();
+ cache2.getRegion(A_B, true).activate();
assertEquals("Incorrect name for /a/b", JOE, cache2.get(A_B, "name"));
assertEquals("Incorrect age for /a/b", TWENTY, cache2.get(A_B, "age"));
@@ -229,7 +229,7 @@
assertNull("/a/d name transferred against policy", cache2.get(A_D, "name"));
- cache2.getRegion(A_C).activate();
+ cache2.getRegion(A_C, true).activate();
assertEquals("Incorrect name for /a/b", JOE, cache2.get(A_B, "name"));
assertEquals("Incorrect age for /a/b", TWENTY, cache2.get(A_B, "age"));
@@ -237,7 +237,7 @@
assertEquals("Incorrect age for /a/c", FORTY, cache2.get(A_C, "age"));
assertNull("/a/d name transferred against policy", cache2.get(A_D, "name"));
- cache2.getRegion(A_D).activate();
+ cache2.getRegion(A_D, true).activate();
assertEquals("Incorrect name for /a/b", JOE, cache2.get(A_B, "name"));
assertEquals("Incorrect age for /a/b", TWENTY, cache2.get(A_B, "age"));
@@ -245,11 +245,11 @@
assertEquals("Incorrect age for /a/c", FORTY, cache2.get(A_C, "age"));
assertEquals("Incorrect name for /a/d", JANE, cache2.get(A_D, "name"));
- cache1.getRegion(A).deactivate();
+ cache1.getRegion(A, true).deactivate();
- cache1.getRegion(A_B).activate();
- cache1.getRegion(A_C).activate();
- cache1.getRegion(A_D).activate();
+ cache1.getRegion(A_B, true).activate();
+ cache1.getRegion(A_C, true).activate();
+ cache1.getRegion(A_D, true).activate();
assertEquals("Incorrect name for /a/b", JOE, cache1.get(A_B, "name"));
assertEquals("Incorrect age for /a/b", TWENTY, cache1.get(A_B, "age"));
@@ -262,7 +262,7 @@
{
CacheSPI cache1 = createCache("cache1", false, true, true);
- cache1.getRegion(A).activate();
+ cache1.getRegion(A, true).activate();
cache1.put(A_B, "name", JOE);
cache1.put(A_B, "age", TWENTY);
@@ -283,7 +283,7 @@
assertNull("/a/c name transferred against policy", cache2.get(A_C, "name"));
assertNull("/a/c age transferred against policy", cache2.get(A_C, "age"));
- cache2.getRegion(A_B).activate();
+ cache2.getRegion(A_B, true).activate();
assertEquals("Incorrect name from loader for /a/b", JOE, loader.get(A_B).get("name"));
assertEquals("Incorrect age from loader for /a/b", TWENTY, loader.get(A_B).get("age"));
@@ -298,7 +298,7 @@
assertNull("/a/d name transferred against policy", cache2.get(A_D, "name"));
- cache2.getRegion(A_C).activate();
+ cache2.getRegion(A_C, true).activate();
assertEquals("Incorrect name from loader for /a/b", JOE, loader.get(A_B).get("name"));
assertEquals("Incorrect age from loader for /a/b", TWENTY, loader.get(A_B).get("age"));
@@ -311,7 +311,7 @@
assertEquals("Incorrect age for /a/c", FORTY, cache2.get(A_C, "age"));
assertNull("/a/d name transferred against policy", cache2.get(A_D, "name"));
- cache2.getRegion(A_D).activate();
+ cache2.getRegion(A_D, true).activate();
assertEquals("Incorrect name from loader for /a/b", JOE, loader.get(A_B).get("name"));
assertEquals("Incorrect age from loader for /a/b", TWENTY, loader.get(A_B).get("age"));
@@ -325,11 +325,11 @@
assertEquals("Incorrect age for /a/c", FORTY, cache2.get(A_C, "age"));
assertEquals("Incorrect name for /a/d", JANE, cache2.get(A_D, "name"));
- cache1.getRegion(A).deactivate();
+ cache1.getRegion(A, true).deactivate();
- cache1.getRegion(A_B).activate();
- cache1.getRegion(A_C).activate();
- cache1.getRegion(A_D).activate();
+ cache1.getRegion(A_B, true).activate();
+ cache1.getRegion(A_C, true).activate();
+ cache1.getRegion(A_D, true).activate();
loader = cache1.getCacheLoader();
@@ -363,10 +363,10 @@
true, // use cacheloader
false, false); // don't start
ClassLoader cl1 = getClassLoader();
- cache1.getRegion(A).registerContextClassLoader(cl1);
+ cache1.getRegion(A, true).registerContextClassLoader(cl1);
startCache(cache1);
- cache1.getRegion(A).activate();
+ cache1.getRegion(A, true).activate();
Object ben = createBen(cl1);
@@ -391,7 +391,7 @@
ClassLoader cl2 = getClassLoader();
// cache2.registerClassLoader(A, cl2);
- Region r = cache2.getRegion(A);
+ Region r = cache2.getRegion(A, true);
r.registerContextClassLoader(cl2);
r.activate();
@@ -405,7 +405,7 @@
{
CacheSPI cache1 = createCache("cache1", false, true, true);
- cache1.getRegion(Fqn.ROOT).activate();
+ cache1.getRegion(Fqn.ROOT, true).activate();
cache1.put(A_B, "name", JOE);
cache1.put(A_B, "age", TWENTY);
@@ -426,7 +426,7 @@
assertNull("/a/c name transferred against policy", cache2.get(A_C, "name"));
assertNull("/a/c age transferred against policy", cache2.get(A_C, "age"));
- cache2.getRegion(Fqn.ROOT).activate();
+ cache2.getRegion(Fqn.ROOT, true).activate();
assertEquals("Incorrect name from loader for /a/b", JOE, loader.get(A_B).get("name"));
assertEquals("Incorrect age from loader for /a/b", TWENTY, loader.get(A_B).get("age"));
@@ -628,7 +628,7 @@
// and enabling the stressors
for (int i = 0; i < count; i++)
{
- cacheA.getRegion(Fqn.fromString("/" + names[i])).deactivate();
+ cacheA.getRegion(Fqn.fromString("/" + names[i]), true).deactivate();
System.out.println("Run " + x + "-- /" + names[i] + " deactivated on A");
stressors[i].startPuts();
}
@@ -645,7 +645,7 @@
for (int i = 0; i < count; i++)
{
// System.out.println("Activating /" + names[i] + " on A");
- cacheA.getRegion(Fqn.fromString("/" + names[i])).activate();
+ cacheA.getRegion(Fqn.fromString("/" + names[i]), true).activate();
// Stop the stressor so we don't pollute cacheA's state
// with too many messages sent after activation -- we want
// to compare transferred state with the sender
@@ -733,7 +733,7 @@
void useCache() throws Exception
{
- cache.getRegion(A_B).activate();
+ cache.getRegion(A_B, true).activate();
// System.out.println(name + " activated region" + " " + System.currentTimeMillis());
Fqn childFqn = Fqn.fromString("/a/b/" + name);
@@ -843,7 +843,7 @@
this.name = name;
if (activateRoot)
- cache.getRegion(Fqn.ROOT).activate();
+ cache.getRegion(Fqn.ROOT, true).activate();
}
public void run()
1.11 +51 -51 JBossCache/tests/functional/org/jboss/cache/statetransfer/ForcedStateTransferTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ForcedStateTransferTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/ForcedStateTransferTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- ForcedStateTransferTest.java 20 Jul 2006 21:58:21 -0000 1.10
+++ ForcedStateTransferTest.java 9 Oct 2006 08:14:05 -0000 1.11
@@ -74,7 +74,7 @@
// no guarantee of start() blocking until the view is received
// so we need to do it ourself
TestingUtil.blockUntilViewReceived(cache, 2, 60000);
- cache.getRegion(Fqn.ROOT).activate();
+ cache.getRegion(Fqn.ROOT, true).activate();
}
}
catch (Exception e)
@@ -397,7 +397,7 @@
CacheSPI sender = createCache("sender", isolationLevel, replSync, useMarshalling, true);
if (useMarshalling)
- sender.getRegion(Fqn.ROOT).activate();
+ sender.getRegion(Fqn.ROOT, true).activate();
sender.put(Fqn.fromString("/OK"), "KEY", "X");
More information about the jboss-cvs-commits
mailing list