[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...

Manik Surtani msurtani at jboss.com
Sat Dec 30 12:50:00 EST 2006


  User: msurtani
  Date: 06/12/30 12:50:00

  Modified:    tests/functional/org/jboss/cache/buddyreplication          
                        BuddyReplicationFailoverTest.java
                        BuddyBackupActivationInactivationTest.java
                        BuddyReplicationContentTest.java
                        BuddyAssignmentStateTransferTest.java
                        BuddyGroupAssignmentTest.java
                        BuddyReplicationConfigTest.java
                        BuddyReplicationWithTransactionsTest.java
                        BuddyReplicationTestsBase.java
                        BuddyPoolBroadcastTest.java
                        BuddyReplicationWithCacheLoaderTest.java
  Log:
  Major changes to restructure cache and node object model
  
  Revision  Changes    Path
  1.19      +2 -2      JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationFailoverTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyReplicationFailoverTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationFailoverTest.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -b -r1.18 -r1.19
  --- BuddyReplicationFailoverTest.java	10 Nov 2006 20:32:52 -0000	1.18
  +++ BuddyReplicationFailoverTest.java	30 Dec 2006 17:50:00 -0000	1.19
  @@ -6,8 +6,8 @@
    */
   package org.jboss.cache.buddyreplication;
   
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.misc.TestingUtil;
   
   /**
  @@ -20,7 +20,7 @@
      protected boolean optimisticLocks = false;
      private String key = "key";
      private String value = "value";
  -   private TreeCache[] caches;
  +   private CacheImpl[] caches;
   
      protected void tearDown() throws Exception
      {
  
  
  
  1.13      +30 -31    JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyBackupActivationInactivationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyBackupActivationInactivationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyBackupActivationInactivationTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- BuddyBackupActivationInactivationTest.java	25 Oct 2006 04:50:21 -0000	1.12
  +++ BuddyBackupActivationInactivationTest.java	30 Dec 2006 17:50:00 -0000	1.13
  @@ -6,11 +6,10 @@
    */
   package org.jboss.cache.buddyreplication;
   
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.BuddyReplicationConfig;
   import org.jboss.cache.factories.XmlConfigurationParser;
  -import org.jboss.cache.misc.TestingUtil;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   
  @@ -40,7 +39,7 @@
         /** TODO: Uncomment once we have FLUSH in place
          *
   
  -      TreeCache[] caches = new TreeCache[2];
  +       CacheImpl[] caches = new CacheImpl[2];
         caches[0] = createCache("cache1", true, true, true);
         caches[1] = createCache("cache2", true, true, true);
   
  @@ -70,7 +69,7 @@
         // was removed, presuming FLUSH will fix this.  Need to test with FLUSH.
         // - Manik Surtani (16 Oct 2006)
         /*
  -      TreeCache[] caches = new TreeCache[2];
  +      CacheImpl[] caches = new CacheImpl[2];
         caches[0] = createCache("cache1", true, true, true);
         caches[1] = createCache("cache2", true, true, true);
   
  @@ -104,7 +103,7 @@
         // was removed, presuming FLUSH will fix this.  Need to test with FLUSH.
         // - Manik Surtani (16 Oct 2006)
   /*
  -      TreeCache cache1 = createCache("cache1", true, true, true);
  +      CacheImpl cache1 = createCache("cache1", true, true, true);
   
         cache1.activateRegion("/a");
   
  @@ -122,7 +121,7 @@
   
      }
   
  -   protected TreeCache createCache(String cacheID,
  +   protected CacheImpl createCache(String cacheID,
                                      boolean sync,
                                      boolean useMarshalling,
                                      boolean startCache)
  @@ -131,29 +130,29 @@
         if (caches.get(cacheID) != null)
            throw new IllegalStateException(cacheID + " already created");
   
  -      TreeCache tree = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
   
         String configFile = sync ? "META-INF/replSync-service.xml"
                 : "META-INF/replAsync-service.xml";
  -      tree.setConfiguration(new XmlConfigurationParser().parseFile(configFile));
  -      tree.getConfiguration().setClusterName("Test");
  +      cache.setConfiguration(new XmlConfigurationParser().parseFile(configFile));
  +      cache.getConfiguration().setClusterName("Test");
         if (useMarshalling)
         {
  -         tree.getConfiguration().setUseRegionBasedMarshalling(true);
  -         tree.getConfiguration().setInactiveOnStartup(true);
  +         cache.getConfiguration().setUseRegionBasedMarshalling(true);
  +         cache.getConfiguration().setInactiveOnStartup(true);
         }
  -      tree.getConfiguration().setBuddyReplicationConfig(getBuddyConfig());
  +      cache.getConfiguration().setBuddyReplicationConfig(getBuddyConfig());
         // Put the cache in the map before starting, so if it fails in
         // start it can still be destroyed later
  -      caches.put(cacheID, tree);
  +      caches.put(cacheID, cache);
   
         if (startCache)
         {
  -         tree.create();
  -         tree.start();
  +         cache.create();
  +         cache.start();
         }
   
  -      return tree;
  +      return cache;
      }
   
      protected void setUp() throws Exception
  @@ -178,11 +177,11 @@
         cacheIDs = (String[]) keys.toArray(cacheIDs);
         for (int i = 0; i < cacheIDs.length; i++)
         {
  -         stopCache((TreeCache) caches.get(cacheIDs[i]));
  +         stopCache((CacheImpl) caches.get(cacheIDs[i]));
         }
      }
   
  -   protected void stopCache(TreeCache cache)
  +   protected void stopCache(CacheImpl cache)
      {
         if (cache != null)
         {
  
  
  
  1.14      +7 -7      JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationContentTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyReplicationContentTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationContentTest.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -b -r1.13 -r1.14
  --- BuddyReplicationContentTest.java	20 Nov 2006 03:53:56 -0000	1.13
  +++ BuddyReplicationContentTest.java	30 Dec 2006 17:50:00 -0000	1.14
  @@ -8,7 +8,7 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.misc.TestingUtil;
   
   /**
  @@ -20,16 +20,16 @@
   {
      private String key = "key";
      private String value = "value";
  -   private TreeCache[] caches;
  +   private CacheImpl[] caches;
      private Log log = LogFactory.getLog(BuddyGroupAssignmentTest.class);
   
   
  -   private void assertNoStaleLocks(TreeCache[] caches)
  +   private void assertNoStaleLocks(CacheImpl[] caches)
      {
  -      for (TreeCache cache : caches) assertNoStaleLocks(cache);
  +      for (CacheImpl cache : caches) assertNoStaleLocks(cache);
      }
   
  -   private void assertNoStaleLocks(TreeCache cache)
  +   private void assertNoStaleLocks(CacheImpl cache)
      {
         assertEquals("Number of locks in cache instance " + cache.toString(true) + " should be 0", 0, cache.getNumberOfLocksHeld());
      }
  @@ -171,7 +171,7 @@
      {
         log.debug("Running testBuddyJoin");
         caches = createCaches(2, false);
  -      TreeCache cache2 = null;
  +      CacheImpl cache2 = null;
   
         try
         {
  
  
  
  1.10      +6 -6      JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyAssignmentStateTransferTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyAssignmentStateTransferTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyAssignmentStateTransferTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- BuddyAssignmentStateTransferTest.java	18 Oct 2006 11:07:54 -0000	1.9
  +++ BuddyAssignmentStateTransferTest.java	30 Dec 2006 17:50:00 -0000	1.10
  @@ -6,8 +6,8 @@
    */
   package org.jboss.cache.buddyreplication;
   
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.misc.TestingUtil;
   
   import java.io.File;
  @@ -29,7 +29,7 @@
   
      public void testNonRegionBasedStateTransfer() throws Exception
      {
  -      TreeCache[] caches = new TreeCache[2];
  +      CacheImpl[] caches = new CacheImpl[2];
         try
         {
            caches[0] = createCache(1, "TEST", false, true);
  @@ -48,8 +48,8 @@
   
            assertEquals("State transferred", "Joe", caches[1].get(test, "name"));
   
  -         TreeCache[] old = caches;
  -         caches = new TreeCache[3];
  +         CacheImpl[] old = caches;
  +         caches = new CacheImpl[3];
            System.arraycopy(old, 0, caches, 0, old.length);
            caches[2] = createCache(1, "TEST", false, true);
   
  @@ -81,7 +81,7 @@
         // was removed, presuming FLUSH will fix this.  Need to test with FLUSH.
         // - Manik Surtani (16 Oct 2006)
         /*
  -      TreeCache[] caches = new TreeCache[3];
  +      CacheImpl[] caches = new CacheImpl[3];
   
         try
         {
  @@ -146,7 +146,7 @@
         tmpLoc += File.separator + "BuddyReplicationTestsBase-";
         String tmpLoc0 = tmpLoc + 0;
         String tmpLoc1 = tmpLoc + 1;
  -      TreeCache[] caches = new TreeCache[2];
  +      CacheImpl[] caches = new CacheImpl[2];
   
         try
         {
  
  
  
  1.14      +3 -3      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.13
  retrieving revision 1.14
  diff -u -b -r1.13 -r1.14
  --- BuddyGroupAssignmentTest.java	21 Dec 2006 16:19:33 -0000	1.13
  +++ BuddyGroupAssignmentTest.java	30 Dec 2006 17:50:00 -0000	1.14
  @@ -8,7 +8,7 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.misc.TestingUtil;
   
   /**
  @@ -18,7 +18,7 @@
    */
   public class BuddyGroupAssignmentTest extends BuddyReplicationTestsBase
   {
  -   private TreeCache[] caches;
  +   private CacheImpl[] caches;
      private Log log = LogFactory.getLog(BuddyGroupAssignmentTest.class);
   
      protected void setUp() throws Exception
  @@ -42,7 +42,7 @@
         log.debug("Running testSingleBuddy");
         caches = createCaches(3, false);
   
  -      for (TreeCache cache : caches)
  +      for (CacheImpl cache : caches)
         {
            printBuddyGroup(cache);
         }
  
  
  
  1.12      +6 -6      JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyReplicationConfigTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- BuddyReplicationConfigTest.java	4 Nov 2006 22:03:24 -0000	1.11
  +++ BuddyReplicationConfigTest.java	30 Dec 2006 17:50:00 -0000	1.12
  @@ -7,7 +7,7 @@
   package org.jboss.cache.buddyreplication;
   
   import junit.framework.TestCase;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.config.BuddyReplicationConfig;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.factories.XmlConfigurationParser;
  @@ -17,7 +17,7 @@
   import org.w3c.dom.Element;
   
   /**
  - * Tests basic configuration options by passing stuff into the TreeCache.
  + * Tests basic configuration options by passing stuff into the CacheImpl.
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
  @@ -25,7 +25,7 @@
   {
      public void testNullConfig() throws Exception
      {
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         cache.getConfiguration().setBuddyReplicationConfig(null);
         assertNull(cache.getBuddyManager());
      }
  @@ -35,7 +35,7 @@
         String xmlConfig = "<config><buddyReplicationEnabled>false</buddyReplicationEnabled></config>";
         Element element = XmlHelper.stringToElement(xmlConfig);
         BuddyReplicationConfig config = XmlConfigurationParser.parseBuddyReplicationConfig(element);
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         cache.getConfiguration().setBuddyReplicationConfig(config);
         assertNull(cache.getBuddyManager());
      }
  @@ -45,7 +45,7 @@
         String xmlConfig = "<config><buddyReplicationEnabled>true</buddyReplicationEnabled></config>";
         Element element = XmlHelper.stringToElement(xmlConfig);
         BuddyReplicationConfig config = XmlConfigurationParser.parseBuddyReplicationConfig(element);
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
         cache.getConfiguration().setBuddyReplicationConfig(config);
         cache.create();
  @@ -61,7 +61,7 @@
   
      public void testXmlConfig() throws Exception
      {
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/buddyreplication-service.xml"));
         cache.create();
         BuddyManager bm = cache.getBuddyManager();
  
  
  
  1.5       +2 -2      JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationWithTransactionsTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyReplicationWithTransactionsTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationWithTransactionsTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- BuddyReplicationWithTransactionsTest.java	10 Nov 2006 20:32:52 -0000	1.4
  +++ BuddyReplicationWithTransactionsTest.java	30 Dec 2006 17:50:00 -0000	1.5
  @@ -6,8 +6,8 @@
    */
   package org.jboss.cache.buddyreplication;
   
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   
   import javax.transaction.TransactionManager;
   
  @@ -20,7 +20,7 @@
      private Fqn fqn = Fqn.fromString("test");
      private String key = "key";
      private String value = "value";
  -   private TreeCache[] caches;
  +   private CacheImpl[] caches;
   
      protected void tearDown() throws Exception
      {
  
  
  
  1.34      +26 -26    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.33
  retrieving revision 1.34
  diff -u -b -r1.33 -r1.34
  --- BuddyReplicationTestsBase.java	21 Dec 2006 16:19:33 -0000	1.33
  +++ BuddyReplicationTestsBase.java	30 Dec 2006 17:50:00 -0000	1.34
  @@ -7,8 +7,8 @@
   package org.jboss.cache.buddyreplication;
   
   import junit.framework.TestCase;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.BuddyReplicationConfig;
   import org.jboss.cache.config.CacheLoaderConfig;
   import org.jboss.cache.config.Configuration;
  @@ -31,34 +31,34 @@
   {
      protected static int VIEW_BLOCK_TIMEOUT = 5000;
   
  -   protected TreeCache createCache(int numBuddies, String buddyPoolName) throws Exception
  +   protected CacheImpl createCache(int numBuddies, String buddyPoolName) throws Exception
      {
         return createCache(numBuddies, buddyPoolName, false, true);
      }
   
  -   protected TreeCache createCache(int numBuddies, String buddyPoolName, boolean useDataGravitation) throws Exception
  +   protected CacheImpl createCache(int numBuddies, String buddyPoolName, boolean useDataGravitation) throws Exception
      {
         return createCache(numBuddies, buddyPoolName, useDataGravitation, true);
      }
   
  -   protected TreeCache createCache(int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean start) throws Exception
  +   protected CacheImpl createCache(int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean start) throws Exception
      {
         return createCache(false, numBuddies, buddyPoolName, useDataGravitation, true, start);
      }
   
  -   protected TreeCache createCache(boolean optimisticLocks, int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean start) throws Exception
  +   protected CacheImpl createCache(boolean optimisticLocks, int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean start) throws Exception
      {
         return createCache(optimisticLocks, numBuddies, buddyPoolName, useDataGravitation, true, start);
      }
   
  -   protected TreeCache createCache(int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean removeOnFind, boolean start) throws Exception
  +   protected CacheImpl createCache(int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean removeOnFind, boolean start) throws Exception
      {
         return createCache(false, numBuddies, buddyPoolName, useDataGravitation, removeOnFind, start);
      }
   
  -   protected TreeCache createCache(boolean optimisticLocks, int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean removeOnFind, boolean start) throws Exception
  +   protected CacheImpl createCache(boolean optimisticLocks, int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean removeOnFind, boolean start) throws Exception
      {
  -      TreeCache c = new TreeCache();
  +      CacheImpl c = new CacheImpl();
         c.getConfiguration().setCacheMode("REPL_SYNC");
         c.getConfiguration().setClusterName("BuddyReplicationTest");
         // basic config
  @@ -88,32 +88,32 @@
         return c;
      }
   
  -   protected TreeCache[] createCaches(int numCaches, boolean useBuddyPool) throws Exception
  +   protected CacheImpl[] createCaches(int numCaches, boolean useBuddyPool) throws Exception
      {
         return createCaches(1, numCaches, useBuddyPool, false);
      }
   
  -   protected TreeCache[] createCaches(int numCaches, boolean useBuddyPool, boolean useDataGravitation, boolean optimisticLocks) throws Exception
  +   protected CacheImpl[] createCaches(int numCaches, boolean useBuddyPool, boolean useDataGravitation, boolean optimisticLocks) throws Exception
      {
         return createCaches(1, numCaches, useBuddyPool, useDataGravitation, optimisticLocks);
      }
   
  -   protected TreeCache[] createCaches(int numCaches, boolean useBuddyPool, boolean useDataGravitation) throws Exception
  +   protected CacheImpl[] createCaches(int numCaches, boolean useBuddyPool, boolean useDataGravitation) throws Exception
      {
         return createCaches(1, numCaches, useBuddyPool, useDataGravitation);
      }
   
  -   protected TreeCache[] createCachesWithCacheLoader(int numCaches, boolean useDataGravitation, boolean removeOnFind, boolean passivation) throws Exception
  +   protected CacheImpl[] createCachesWithCacheLoader(int numCaches, boolean useDataGravitation, boolean removeOnFind, boolean passivation) throws Exception
      {
         return this.createCachesWithCacheLoader(numCaches, useDataGravitation, removeOnFind, passivation, false);
      }
   
  -   protected TreeCache[] createCachesWithCacheLoader(int numCaches, boolean useDataGravitation, boolean removeOnFind, boolean passivation, boolean fetchPersistent) throws Exception
  +   protected CacheImpl[] createCachesWithCacheLoader(int numCaches, boolean useDataGravitation, boolean removeOnFind, boolean passivation, boolean fetchPersistent) throws Exception
      {
         String tmpLoc = System.getProperty("java.io.tmpdir", "/tmp");
         tmpLoc += File.separator + "BuddyReplicationTestsBase-";
   
  -      TreeCache[] caches = new TreeCache[numCaches];
  +      CacheImpl[] caches = new CacheImpl[numCaches];
         for (int i = 0; i < numCaches; i++)
         {
            caches[i] = createCacheWithCacheLoader((tmpLoc + i), useDataGravitation, removeOnFind, passivation, fetchPersistent, true);
  @@ -125,9 +125,9 @@
         return caches;
      }
   
  -   protected TreeCache createCacheWithCacheLoader(String location, boolean useDataGravitation, boolean removeOnFind, boolean passivation, boolean fetchPersistent, boolean start) throws Exception
  +   protected CacheImpl createCacheWithCacheLoader(String location, boolean useDataGravitation, boolean removeOnFind, boolean passivation, boolean fetchPersistent, boolean start) throws Exception
      {
  -      TreeCache cache = createCache(1, null, useDataGravitation, removeOnFind, false);
  +      CacheImpl cache = createCache(1, null, useDataGravitation, removeOnFind, false);
   
         String cloader = "<config>\n" +
                 "<passivation>" + passivation + "</passivation>\n" +
  @@ -151,19 +151,19 @@
         return cache;
      }
   
  -   protected TreeCache[] createCaches(int numBuddies, int numCaches, boolean useBuddyPool) throws Exception
  +   protected CacheImpl[] createCaches(int numBuddies, int numCaches, boolean useBuddyPool) throws Exception
      {
         return createCaches(numBuddies, numCaches, useBuddyPool, false);
      }
   
  -   protected TreeCache[] createCaches(int numBuddies, int numCaches, boolean useBuddyPool, boolean useDataGravitation) throws Exception
  +   protected CacheImpl[] createCaches(int numBuddies, int numCaches, boolean useBuddyPool, boolean useDataGravitation) throws Exception
      {
         return createCaches(numBuddies, numCaches, useBuddyPool, useDataGravitation, false);
      }
   
  -   protected TreeCache[] createCaches(int numBuddies, int numCaches, boolean useBuddyPool, boolean useDataGravitation, boolean optimisticLocks) throws Exception
  +   protected CacheImpl[] createCaches(int numBuddies, int numCaches, boolean useBuddyPool, boolean useDataGravitation, boolean optimisticLocks) throws Exception
      {
  -      TreeCache[] caches = new TreeCache[numCaches];
  +      CacheImpl[] caches = new CacheImpl[numCaches];
         for (int i = 0; i < numCaches; i++)
         {
            caches[i] = createCache(optimisticLocks, numBuddies, useBuddyPool ? Character.toString((char) ('A' + i)) : null, useDataGravitation, true);
  @@ -175,7 +175,7 @@
         return caches;
      }
   
  -   protected void cleanup(TreeCache[] caches) throws Exception
  +   protected void cleanup(CacheImpl[] caches) throws Exception
      {
         System.out.println("*** cleaning up");
   
  @@ -192,7 +192,7 @@
         }
      }
   
  -   private void destroyCache(TreeCache c) throws Exception
  +   private void destroyCache(CacheImpl c) throws Exception
      {
         TransactionManager tm = c.getTransactionManager();
         if (tm != null && tm.getTransaction() != null)
  @@ -210,7 +210,7 @@
         c.stop();
      }
   
  -   protected void printBuddyGroup(TreeCache cache)
  +   protected void printBuddyGroup(CacheImpl cache)
      {
         BuddyGroup bg = cache.getBuddyManager().buddyGroup;
         System.out.println("*** " + bg);
  @@ -225,7 +225,7 @@
         return 1000;
      }
   
  -   protected void assertIsBuddy(TreeCache dataOwner, TreeCache buddy, boolean onlyBuddy)
  +   protected void assertIsBuddy(CacheImpl dataOwner, CacheImpl buddy, boolean onlyBuddy)
      {
         Address dataOwnerLocalAddress = (Address) dataOwner.getLocalAddress();
         Address buddyLocalAddress = (Address) buddy.getLocalAddress();
  @@ -250,7 +250,7 @@
         assertTrue(buddyLocalAddress + " should be a buddy to " + group.getGroupName(), group.getBuddies().contains(buddyLocalAddress));
      }
   
  -   protected void dumpCacheContents(TreeCache[] caches)
  +   protected void dumpCacheContents(CacheImpl[] caches)
      {
         System.out.println("**** START: Cache Contents ****");
         for (int i = 0; i < caches.length; i++)
  @@ -266,7 +266,7 @@
         System.out.println("**** END: Cache Contents ****");
      }
   
  -   protected void assertNoLocks(TreeCache[] caches)
  +   protected void assertNoLocks(CacheImpl[] caches)
      {
         for (int i = 0; i < caches.length; i++)
         {
  
  
  
  1.17      +7 -7      JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyPoolBroadcastTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyPoolBroadcastTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyPoolBroadcastTest.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- BuddyPoolBroadcastTest.java	21 Dec 2006 17:59:01 -0000	1.16
  +++ BuddyPoolBroadcastTest.java	30 Dec 2006 17:50:00 -0000	1.17
  @@ -9,7 +9,7 @@
   import EDU.oswego.cs.dl.util.concurrent.Latch;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.misc.TestingUtil;
   
   import java.util.Map;
  @@ -22,10 +22,10 @@
   public class BuddyPoolBroadcastTest extends BuddyReplicationTestsBase
   {
   
  -   private TreeCache[] caches;
  +   private CacheImpl[] caches;
      private Log log = LogFactory.getLog(BuddyPoolBroadcastTest.class);
   
  -   private void checkConsistentPoolState(TreeCache[] caches)
  +   private void checkConsistentPoolState(CacheImpl[] caches)
      {
         for (int i = 0; i < caches.length; i++)
         {
  @@ -35,7 +35,7 @@
               if (i != j)
               {
                  Map groupMap2 = caches[j].getBuddyManager().buddyPool;
  -               for (TreeCache cache : caches)
  +               for (CacheImpl cache : caches)
                  {
                     assertEquals("Comparing contents of cache " + (i + 1) + " pool map with cache " + (j + 1), groupMap.get(cache), groupMap2.get(cache));
                  }
  @@ -136,7 +136,7 @@
      {
         log.debug("Running testConcurrency");
         int numCaches = 15;
  -      caches = new TreeCache[numCaches];
  +      caches = new CacheImpl[numCaches];
         Latch latch = new Latch();
         CacheStarter[] starters = new CacheStarter[numCaches];
   
  @@ -169,9 +169,9 @@
      public class CacheStarter extends Thread
      {
         private Latch latch;
  -      private TreeCache cache;
  +      private CacheImpl cache;
   
  -      public CacheStarter(Latch latch, TreeCache cache)
  +      public CacheStarter(Latch latch, CacheImpl cache)
         {
            this.latch = latch;
            this.cache = cache;
  
  
  
  1.6       +4 -4      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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- BuddyReplicationWithCacheLoaderTest.java	10 Nov 2006 20:32:52 -0000	1.5
  +++ BuddyReplicationWithCacheLoaderTest.java	30 Dec 2006 17:50:00 -0000	1.6
  @@ -6,8 +6,8 @@
    */
   package org.jboss.cache.buddyreplication;
   
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.misc.TestingUtil;
   
  @@ -24,7 +24,7 @@
      protected String value = "value";
      protected boolean passivation = false;
   
  -   private CacheLoader[] getLoaders(TreeCache[] caches)
  +   private CacheLoader[] getLoaders(CacheImpl[] caches)
      {
         CacheLoader[] retVal = new CacheLoader[caches.length];
   
  @@ -39,7 +39,7 @@
      public void testWithDataGravitationDefault() throws Exception
      {
   
  -      TreeCache[] caches = null;
  +      CacheImpl[] caches = null;
         try
         {
            // create 3 caches
  @@ -127,7 +127,7 @@
   
      public void testWithDataGravitationEviction() throws Exception
      {
  -      TreeCache[] caches = null;
  +      CacheImpl[] caches = null;
         try
         {
            // create 3 caches
  
  
  



More information about the jboss-cvs-commits mailing list