[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...
Brian Stansberry
brian.stansberry at jboss.com
Thu Jun 7 11:41:35 EDT 2007
User: bstansberry
Date: 07/06/07 11:41:34
Modified: tests/functional/org/jboss/cache/buddyreplication
BuddyReplicationWithCacheLoaderTest.java
Log:
Add tests with autoGravitation disabled. Make the tree structure deeper too.
Revision Changes Path
1.10 +29 -3 JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BuddyReplicationWithCacheLoaderTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- BuddyReplicationWithCacheLoaderTest.java 24 May 2007 18:13:59 -0000 1.9
+++ BuddyReplicationWithCacheLoaderTest.java 7 Jun 2007 15:41:34 -0000 1.10
@@ -21,7 +21,7 @@
public class BuddyReplicationWithCacheLoaderTest extends BuddyReplicationTestsBase
{
- protected Fqn fqn = Fqn.fromString("/test");
+ protected Fqn fqn = Fqn.fromString("/test/br/four/level");
protected String key = "key";
protected String value = "value";
protected boolean passivation = false;
@@ -41,9 +41,20 @@
public void testWithDataGravitationDefault() throws Exception
{
+ dataGravitationDefaultTest(true);
+ }
+
+ public void testWithDataGravitationDefaultNoAuto() throws Exception
+ {
+ dataGravitationDefaultTest(false);
+ }
+
+ private void dataGravitationDefaultTest(boolean autoGravitate)
+ throws Exception
+ {
// create 3 caches
- caches = createCachesWithCacheLoader(3, true, true, passivation);
+ caches = createCachesWithCacheLoader(3, autoGravitate, true, passivation);
TestingUtil.sleepThread(1000);
@@ -64,6 +75,8 @@
dumpCacheContents(caches);
// request data from cache2
+ if (!autoGravitate)
+ caches[2].getInvocationContext().getOptionOverrides().setForceDataGravitation(true);
assertEquals(value, caches[2].get(fqn, key));
assertNoLocks(caches);
@@ -119,8 +132,19 @@
public void testWithDataGravitationEviction() throws Exception
{
+ dataGravitationEvictionTest(true);
+ }
+
+ public void testWithDataGravitationEvictionNoAuto() throws Exception
+ {
+ dataGravitationEvictionTest(false);
+ }
+
+ private void dataGravitationEvictionTest(boolean autoGravitate)
+ throws Exception
+ {
// create 3 caches
- caches = createCachesWithCacheLoader(3, true, false, passivation);
+ caches = createCachesWithCacheLoader(3, autoGravitate, false, passivation);
CacheLoader[] loaders = getLoaders(caches);
Fqn b1 = BuddyManager.getBackupFqn(caches[0].getLocalAddress(), fqn);
Fqn b2 = BuddyManager.getBackupFqn(caches[2].getLocalAddress(), fqn);
@@ -132,6 +156,8 @@
System.out.println("*** About do cause a gravitation event ... ");
// request data from cache2
+ if (!autoGravitate)
+ caches[2].getInvocationContext().getOptionOverrides().setForceDataGravitation(true);
assertEquals(value, caches[2].get(fqn, key));
// test that data does not exist in cache0
More information about the jboss-cvs-commits
mailing list