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

Vladmir Blagojevic vladimir.blagojevic at jboss.com
Wed Jan 3 22:36:42 EST 2007


  User: vblagojevic
  Date: 07/01/03 22:36:42

  Modified:    tests/functional/org/jboss/cache/statetransfer  
                        VersionedTestBase.java StateTransferTestBase.java
  Log:
  state transfer tests use UnitTestCacheFactory
  
  Revision  Changes    Path
  1.25      +16 -19    JBossCache/tests/functional/org/jboss/cache/statetransfer/VersionedTestBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: VersionedTestBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/VersionedTestBase.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -b -r1.24 -r1.25
  --- VersionedTestBase.java	3 Jan 2007 03:56:51 -0000	1.24
  +++ VersionedTestBase.java	4 Jan 2007 03:36:42 -0000	1.25
  @@ -14,7 +14,9 @@
   import org.jboss.cache.Node;
   import org.jboss.cache.Region;
   import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.config.Configuration.CacheMode;
   import org.jboss.cache.factories.DefaultCacheFactory;
  +import org.jboss.cache.factories.UnitTestCacheFactory;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.marshall.InactiveRegionException;
  @@ -340,8 +342,6 @@
       */
      public void testConcurrentActivationSync() throws Exception
      {
  -      // TODO: Needs revisiting after concurrent FLUSH is supported
  -      //http://jira.jboss.com/jira/browse/JGRP-332
         concurrentActivationTest(true);
      }
   
  @@ -354,8 +354,6 @@
       */
      public void testConcurrentActivationAsync() throws Exception
      {
  -      // TODO: Needs revisiting after concurrent FLUSH is supported
  -      //http://jira.jboss.com/jira/browse/JGRP-332
         concurrentActivationTest(false);
      }
   
  @@ -600,8 +598,6 @@
       */
      public void testConcurrentUseSync() throws Exception
      {
  -      // TODO: Needs revisiting after concurrent FLUSH is supported
  -      //http://jira.jboss.com/jira/browse/JGRP-332
         concurrentUseTest(true);
      }
   
  @@ -613,8 +609,6 @@
       */
      public void testConcurrentUseAsync() throws Exception
      {
  -      // TODO: Needs revisiting after concurrent FLUSH is supported
  -      //http://jira.jboss.com/jira/browse/JGRP-332
         concurrentUseTest(false);
      }
   
  @@ -753,16 +747,18 @@
       */
      public void testEvictionSeesStateTransfer() throws Exception
      {
  -      XmlConfigurationParser parser = new XmlConfigurationParser();
  -      Configuration c = parser.parseFile("META-INF/replSync-eviction-service.xml");
  +      
  +      Configuration c = UnitTestCacheFactory.createConfiguration(CacheMode.REPL_SYNC,true);
         Cache cache1 = DefaultCacheFactory.getInstance().createCache(c, false);  
         cache1.start();
  +      caches.put("evict1", cache1);
         
         cache1.put(Fqn.fromString("/a/b/c"), "key", "value");
         
  -      c = parser.parseFile("META-INF/replSync-eviction-service.xml");
  +      c = UnitTestCacheFactory.createConfiguration(CacheMode.REPL_SYNC,true);
         Cache cache2 = DefaultCacheFactory.getInstance().createCache(c, false);
         cache2.start();
  +      caches.put("evict2", cache2);
         
         Region region = cache2.getRegion(Fqn.ROOT, false);
         // We expect events for /a, /a/b and /a/b/c
  @@ -776,10 +772,10 @@
       */
      public void testEvictionAfterStateTransfer() throws Exception
      {
  -      XmlConfigurationParser parser = new XmlConfigurationParser();
  -      Configuration c = parser.parseFile("META-INF/replSync-eviction-service.xml");
  +      Configuration c = UnitTestCacheFactory.createConfiguration(CacheMode.REPL_SYNC,true);
         Cache cache1 = DefaultCacheFactory.getInstance().createCache(c, false);  
         cache1.start();
  +      caches.put("evict1", cache1);
         
         for (int i = 0; i < 25000; i++)
         {
  @@ -788,9 +784,10 @@
                cache1.put(Fqn.fromString("/org/jboss/test/data/" + i), "key", "data" + i);
         }
         
  -      c = parser.parseFile("META-INF/replSync-eviction-service.xml");
  +      c = UnitTestCacheFactory.createConfiguration(CacheMode.REPL_SYNC,true);
         final Cache cache2 = DefaultCacheFactory.getInstance().createCache(c, false);
         cache2.start();
  +      caches.put("evict2", cache2);
         
         Node parent = cache2.getRoot().getChild(Fqn.fromString("/org/jboss/test/data"));
         Set children = parent.getChildren();
  
  
  
  1.32      +4 -7      JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransferTestBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: StateTransferTestBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransferTestBase.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -b -r1.31 -r1.32
  --- StateTransferTestBase.java	3 Jan 2007 04:03:48 -0000	1.31
  +++ StateTransferTestBase.java	4 Jan 2007 03:36:42 -0000	1.32
  @@ -26,7 +26,9 @@
   import org.jboss.cache.CacheSPI;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.config.Configuration.CacheMode;
   import org.jboss.cache.factories.DefaultCacheFactory;
  +import org.jboss.cache.factories.UnitTestCacheFactory;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.loader.AbstractCacheLoaderTestBase;
   import org.jboss.cache.loader.CacheLoader;
  @@ -97,13 +99,8 @@
         if (caches.get(cacheID) != null)
            throw new IllegalStateException(cacheID + " already created");
   
  -//      CacheImpl tree=new CacheImpl();
  -      //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
  -      XmlConfigurationParser parser = new XmlConfigurationParser();
  -      Configuration c = parser.parseFile(configFile);
  +      CacheMode mode = sync ? CacheMode.REPL_SYNC:CacheMode.REPL_ASYNC;
  +      Configuration c = UnitTestCacheFactory.createConfiguration(mode);
         c.setClusterName("VersionedTestBase");
         c.setReplVersionString(getReplicationVersion());
         // Use a long timeout to facilitate setting debugger breakpoints
  
  
  



More information about the jboss-cvs-commits mailing list