[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...
Manik Surtani
manik at jboss.org
Fri Jul 20 10:47:01 EDT 2007
User: msurtani
Date: 07/07/20 10:47:01
Modified: tests/functional/org/jboss/cache/buddyreplication
BuddyReplicationTestsBase.java
BuddyGroupAssignmentTest.java
Log:
Ignore cache status check for BR group org methods
Revision Changes Path
1.53 +9 -8 JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BuddyReplicationTestsBase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- BuddyReplicationTestsBase.java 20 Jun 2007 12:14:12 -0000 1.52
+++ BuddyReplicationTestsBase.java 20 Jul 2007 14:47:01 -0000 1.53
@@ -9,6 +9,7 @@
import junit.framework.TestCase;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.BuddyReplicationConfig;
@@ -44,12 +45,12 @@
{
// an optimisation to aid the progress of unit tests, especially in the case of TCP connections. Note that this
// is NOT necessary in live systems since each cache would typically be in a separate JVM.
- for (CacheImpl c : caches)
+ for (CacheSPI c : caches)
{
if (c != null && c.getBuddyManager() != null) c.getBuddyManager().stop();
}
- for (CacheImpl c : caches)
+ for (CacheSPI c : caches)
{
if (c != null)
{
@@ -82,7 +83,6 @@
}
}
- c.killChannel();
c.stop();
c = null;
}
@@ -269,7 +269,7 @@
return caches;
}
- protected void printBuddyGroup(CacheImpl cache)
+ protected void printBuddyGroup(CacheSPI cache)
{
BuddyGroup bg = cache.getBuddyManager().buddyGroup;
System.out.println("*** " + bg);
@@ -284,7 +284,7 @@
return 1000;
}
- protected void assertIsBuddy(CacheImpl dataOwner, CacheImpl buddy, boolean onlyBuddy)
+ protected void assertIsBuddy(CacheSPI dataOwner, CacheSPI buddy, boolean onlyBuddy)
{
Address dataOwnerLocalAddress = dataOwner.getLocalAddress();
Address buddyLocalAddress = buddy.getLocalAddress();
@@ -302,6 +302,7 @@
// and now on the buddy end
BuddyGroup group = buddyBuddyManager.buddyGroupsIParticipateIn.get(BuddyManager.getGroupNameFromAddress(dataOwnerLocalAddress));
+ System.out.println("*** Groups I participate in: " + buddyBuddyManager.buddyGroupsIParticipateIn);
System.out.println("*** Buddy's version of dataOwner's group " + group);
assertTrue("buddy's list of groups it participates in should contain data owner's group name", buddyBuddyManager.buddyGroupsIParticipateIn.containsKey(BuddyManager.getGroupNameFromAddress(dataOwnerLocalAddress)));
@@ -327,11 +328,11 @@
System.out.println("**** END: Cache Contents ****");
}
- protected void assertNoLocks(CacheImpl[] caches)
+ protected void assertNoLocks(Cache... caches)
{
- for (CacheImpl cache : caches)
+ for (Cache cache : caches)
{
- if (cache != null) assertEquals(0, cache.getNumberOfLocksHeld());
+ if (cache != null) assertEquals(0, ((CacheImpl) cache).getNumberOfLocksHeld());
}
}
1.16 +3 -2 JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyGroupAssignmentTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BuddyGroupAssignmentTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyGroupAssignmentTest.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- BuddyGroupAssignmentTest.java 2 Mar 2007 12:07:44 -0000 1.15
+++ BuddyGroupAssignmentTest.java 20 Jul 2007 14:47:01 -0000 1.16
@@ -8,7 +8,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.misc.TestingUtil;
/**
@@ -32,7 +32,7 @@
log.debug("Running testSingleBuddy");
caches = createCaches(3, false);
- for (CacheImpl cache : caches)
+ for (CacheSPI cache : caches)
{
printBuddyGroup(cache);
}
@@ -50,6 +50,7 @@
log.debug("Running test2Buddies");
caches = createCaches(2, 3, false);
+ TestingUtil.blockUntilViewsReceived(5000, caches);
TestingUtil.sleepThread(2000);
System.out.println("*** Testing cache 0");
More information about the jboss-cvs-commits
mailing list