Author: manik.surtani(a)jboss.com
Date: 2007-10-23 13:47:12 -0400 (Tue, 23 Oct 2007)
New Revision: 4677
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
Log:
modified helper methods
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java 2007-10-23
17:31:08 UTC (rev 4676)
+++
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java 2007-10-23
17:47:12 UTC (rev 4677)
@@ -6,16 +6,6 @@
*/
package org.jboss.cache.buddyreplication;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.transaction.TransactionManager;
-
import org.jboss.cache.Cache;
import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
@@ -33,10 +23,15 @@
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.xml.XmlHelper;
import org.jgroups.Address;
+import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
import org.w3c.dom.Element;
+import javax.transaction.TransactionManager;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Base class for BR tests
*
@@ -275,11 +270,12 @@
return caches;
}
- protected void printBuddyGroup(CacheSPI cache)
+ protected void printBuddyGroup(Cache cache)
{
- BuddyGroup bg = cache.getBuddyManager().buddyGroup;
+ BuddyManager bm = ((CacheSPI) cache).getBuddyManager();
+ BuddyGroup bg = bm.buddyGroup;
System.out.println("*** " + bg);
- System.out.println(" Groups I participate in: " +
cache.getBuddyManager().buddyGroupsIParticipateIn.keySet());
+ System.out.println(" Groups I participate in: " +
bm.buddyGroupsIParticipateIn.keySet());
}
/**
@@ -290,7 +286,7 @@
return 1000;
}
- protected void assertIsBuddy(CacheSPI dataOwner, CacheSPI buddy, boolean onlyBuddy)
+ protected void assertIsBuddy(Cache dataOwner, Cache buddy, boolean onlyBuddy)
{
Address dataOwnerLocalAddress = dataOwner.getLocalAddress();
Address buddyLocalAddress = buddy.getLocalAddress();
@@ -298,8 +294,8 @@
System.out.println("*** assert with groups. Testing that " +
buddyLocalAddress + " is a buddy for owner " + dataOwnerLocalAddress + "
only buddy? " + onlyBuddy);
printBuddyGroup(dataOwner);
- BuddyManager dataOwnerBuddyManager = dataOwner.getBuddyManager();
- BuddyManager buddyBuddyManager = buddy.getBuddyManager();
+ BuddyManager dataOwnerBuddyManager = ((CacheSPI) dataOwner).getBuddyManager();
+ BuddyManager buddyBuddyManager = ((CacheSPI) buddy).getBuddyManager();
// lets test things on the data owner's side of things
if (onlyBuddy) assertEquals("Should only have one buddy", 1,
dataOwnerBuddyManager.getBuddyAddresses().size());
Show replies by date