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

Manik Surtani msurtani at jboss.com
Thu Jul 20 05:03:53 EDT 2006


  User: msurtani
  Date: 06/07/20 05:03:53

  Modified:    tests/functional/org/jboss/cache/buddyreplication   
                        BuddyBackupActivationInactivationTest.java
                        BuddyReplicationConfigTest.java
                        BuddyReplicationTestsBase.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.6       +9 -10     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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- BuddyBackupActivationInactivationTest.java	1 Jun 2006 19:06:36 -0000	1.5
  +++ BuddyBackupActivationInactivationTest.java	20 Jul 2006 09:03:53 -0000	1.6
  @@ -9,7 +9,6 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.PropertyConfigurator;
   import org.jboss.cache.TreeCache;
  -import org.jboss.cache.TreeCacheMBean;
   import org.jboss.cache.config.Option;
   import org.jboss.cache.misc.TestingUtil;
   import org.w3c.dom.Document;
  @@ -38,7 +37,7 @@
      
      public void testBuddyBackupActivation() throws Exception
      {
  -      TreeCacheMBean[] caches = new TreeCacheMBean[2];
  +      TreeCache[] caches = new TreeCache[2];
         caches[0] = createCache("cache1", true, true, true);
         caches[1] = createCache("cache2", true, true, true);
         
  @@ -61,7 +60,7 @@
      
      public void testReplToInactiveRegion() throws Exception
      {
  -      TreeCacheMBean[] caches = new TreeCacheMBean[2];
  +      TreeCache[] caches = new TreeCache[2];
         caches[0] = createCache("cache1", true, true, true);
         caches[1] = createCache("cache2", true, true, true);
         
  @@ -88,7 +87,7 @@
      
      public void testBuddyBackupInactivation() throws Exception
      {
  -      TreeCacheMBean cache1 = createCache("cache1", true, true, true);
  +      TreeCache cache1 = createCache("cache1", true, true, true);
         
         cache1.activateRegion("/a");
         
  @@ -107,7 +106,7 @@
         
      }
   
  -   protected TreeCacheMBean createCache(String cacheID, 
  +   protected TreeCache createCache(String cacheID,
                                           boolean sync, 
                                           boolean useMarshalling, 
                                           boolean startCache) 
  @@ -116,17 +115,17 @@
         if (caches.get(cacheID) != null)
            throw new IllegalStateException(cacheID + " already created");
         
  -      TreeCacheMBean tree=new TreeCache();
  +      TreeCache tree=new TreeCache();
         PropertyConfigurator config=new PropertyConfigurator();
         String configFile = sync ? "META-INF/replSync-service.xml"
                                  : "META-INF/replAsync-service.xml";
         config.configure(tree, configFile); // read in generic replAsync xml
  -      tree.setClusterName("Test");
  +      tree.getConfiguration().setClusterName("Test");
         if (useMarshalling) {
  -         tree.setUseRegionBasedMarshalling(true);
  -         tree.setInactiveOnStartup(true);
  +         tree.getConfiguration().setUseRegionBasedMarshalling(true);
  +         tree.getConfiguration().setInactiveOnStartup(true);
         }
  -      tree.setBuddyReplicationConfig(getBuddyConfig());
  +      tree.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);
  
  
  
  1.5       +3 -3      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.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- BuddyReplicationConfigTest.java	22 May 2006 17:31:23 -0000	1.4
  +++ BuddyReplicationConfigTest.java	20 Jul 2006 09:03:53 -0000	1.5
  @@ -25,7 +25,7 @@
       public void testNullConfig() throws Exception
       {
           TreeCache cache = new TreeCache();
  -        cache.setBuddyReplicationConfig(null);
  +        cache.getConfiguration().setBuddyReplicationConfig(null);
           assertNull(cache.getBuddyManager());
       }
   
  @@ -34,7 +34,7 @@
           String xmlConfig = "<config><buddyReplicationEnabled>false</buddyReplicationEnabled></config>";
           Element config = XmlHelper.stringToElement(xmlConfig);
           TreeCache cache = new TreeCache();
  -        cache.setBuddyReplicationConfig(config);
  +        cache.getConfiguration().setBuddyReplicationConfig(config);
           assertNull(cache.getBuddyManager());
       }
   
  @@ -43,7 +43,7 @@
           String xmlConfig = "<config><buddyReplicationEnabled>true</buddyReplicationEnabled></config>";
           Element config = XmlHelper.stringToElement(xmlConfig);
           TreeCache cache = new TreeCache();
  -        cache.setBuddyReplicationConfig(config);
  +        cache.getConfiguration().setBuddyReplicationConfig(config);
           assertNotNull(cache.getBuddyManager());
           BuddyManager mgr = cache.getBuddyManager();
           assertTrue(mgr.isEnabled());
  
  
  
  1.27      +8 -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.26
  retrieving revision 1.27
  diff -u -b -r1.26 -r1.27
  --- BuddyReplicationTestsBase.java	1 Jun 2006 19:06:36 -0000	1.26
  +++ BuddyReplicationTestsBase.java	20 Jul 2006 09:03:53 -0000	1.27
  @@ -53,8 +53,8 @@
       protected TreeCache createCache(boolean optimisticLocks, int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean removeOnFind, boolean start) throws Exception
       {
           TreeCache c = new TreeCache();
  -        c.setCacheMode(TreeCache.REPL_SYNC);
  -        c.setClusterName("BuddyReplicationTest");
  +        c.getConfiguration().setCacheMode("REPL_SYNC");
  +        c.getConfiguration().setClusterName("BuddyReplicationTest");
           // basic config
           String xmlString = "<config><buddyReplicationEnabled>true</buddyReplicationEnabled>\n" +
                   "<buddyCommunicationTimeout>600000</buddyCommunicationTimeout>\n" +
  @@ -65,15 +65,15 @@
   
           if (buddyPoolName != null) xmlString += "<buddyPoolName>"+buddyPoolName+"</buddyPoolName>";
           xmlString += "</config>";
  -        c.setBuddyReplicationConfig( XmlHelper.stringToElement(xmlString) );
  +        c.getConfiguration().setBuddyReplicationConfig( XmlHelper.stringToElement(xmlString) );
   
  -        c.setFetchInMemoryState(true);
  +        c.getConfiguration().setFetchInMemoryState(true);
           if (optimisticLocks)
           {
  -            c.setNodeLockingScheme("OPTIMISTIC");
  +            c.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
           }
  -        c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -        c.setSyncCommitPhase(true); // helps track down breakages
  +        c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +        c.getConfiguration().setSyncCommitPhase(true); // helps track down breakages
   
           if (start)
              c.startService();
  @@ -134,7 +134,7 @@
              "</cacheloader>\n" +
              "</config>";
   
  -       cache.setCacheLoaderConfiguration(XmlHelper.stringToElement(cloader));
  +       cache.getConfiguration().setCacheLoaderConfiguration(XmlHelper.stringToElement(cloader));
          if (start)
             cache.startService();
   
  
  
  



More information about the jboss-cvs-commits mailing list