[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...
Manik Surtani
msurtani at jboss.com
Thu Dec 21 11:19:33 EST 2006
User: msurtani
Date: 06/12/21 11:19:33
Modified: tests/functional/org/jboss/cache/buddyreplication
BuddyReplicationTestsBase.java
BuddyGroupAssignmentTest.java
Log:
refactored
Revision Changes Path
1.33 +6 -4 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.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- BuddyReplicationTestsBase.java 10 Nov 2006 20:32:52 -0000 1.32
+++ BuddyReplicationTestsBase.java 21 Dec 2006 16:19:33 -0000 1.33
@@ -16,6 +16,7 @@
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.xml.XmlHelper;
+import org.jgroups.Address;
import org.w3c.dom.Element;
import javax.transaction.TransactionManager;
@@ -226,7 +227,10 @@
protected void assertIsBuddy(TreeCache dataOwner, TreeCache buddy, boolean onlyBuddy)
{
- System.out.println("*** assert with groups");
+ Address dataOwnerLocalAddress = (Address) dataOwner.getLocalAddress();
+ Address buddyLocalAddress = (Address) buddy.getLocalAddress();
+
+ System.out.println("*** assert with groups. Testing that " + buddyLocalAddress + " is a buddy for owner " + dataOwnerLocalAddress + " only buddy? " + onlyBuddy);
printBuddyGroup(dataOwner);
BuddyManager dataOwnerBuddyManager = dataOwner.getBuddyManager();
@@ -234,13 +238,11 @@
// lets test things on the data owner's side of things
if (onlyBuddy) assertEquals("Should only have one buddy", 1, dataOwnerBuddyManager.getBuddyAddresses().size());
- Object dataOwnerLocalAddress = dataOwner.getLocalAddress();
- Object buddyLocalAddress = buddy.getLocalAddress();
assertTrue(buddyLocalAddress + " should be a buddy to " + dataOwnerLocalAddress, dataOwnerBuddyManager.getBuddyAddresses().contains(buddyLocalAddress));
// and now on the buddy end
- BuddyGroup group = (BuddyGroup) buddyBuddyManager.buddyGroupsIParticipateIn.get(BuddyManager.getGroupNameFromAddress(dataOwnerLocalAddress));
+ BuddyGroup group = buddyBuddyManager.buddyGroupsIParticipateIn.get(BuddyManager.getGroupNameFromAddress(dataOwnerLocalAddress));
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)));
1.13 +2 -0 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.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- BuddyGroupAssignmentTest.java 20 Sep 2006 14:45:32 -0000 1.12
+++ BuddyGroupAssignmentTest.java 21 Dec 2006 16:19:33 -0000 1.13
@@ -60,6 +60,8 @@
log.debug("Running test2Buddies");
caches = createCaches(2, 3, false);
+ TestingUtil.sleepThread(2000);
+
System.out.println("*** Testing cache 0");
assertIsBuddy(caches[0], caches[1], false);
assertIsBuddy(caches[0], caches[2], false);
More information about the jboss-cvs-commits
mailing list