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

Manik Surtani msurtani at jboss.com
Thu Jul 20 02:04:56 EDT 2006


  User: msurtani
  Date: 06/07/20 02:04:56

  Modified:    tests/functional/org/jboss/cache/aop/statetransfer 
                        StateTransferAopTestBase.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.16      +163 -163  JBossCache/tests/functional/org/jboss/cache/aop/statetransfer/StateTransferAopTestBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: StateTransferAopTestBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/aop/statetransfer/StateTransferAopTestBase.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- StateTransferAopTestBase.java	5 May 2006 12:06:57 -0000	1.15
  +++ StateTransferAopTestBase.java	20 Jul 2006 06:04:56 -0000	1.16
  @@ -13,11 +13,12 @@
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.CacheException;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.PropertyConfigurator;
   import org.jboss.cache.TreeCache;
   import org.jboss.cache.aop.PojoCache;
   import org.jboss.cache.aop.test.Address;
   import org.jboss.cache.aop.test.Person;
  +import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.misc.TestingUtil;
   import org.jboss.cache.xml.XmlHelper;
  @@ -606,24 +607,23 @@
            throw new IllegalStateException(cacheID + " already created");
   
         PojoCache tree = new PojoCache();
  -      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.setDeadlockDetection(sync);
  -      tree.setClusterName("StateTransferTestBase");
  -      tree.setReplicationVersion(getReplicationVersion());
  +
  +      XmlConfigurationParser parser = new XmlConfigurationParser();
  +      Configuration c = parser.parseFile( sync ? "META-INF/replSync-service.xml" : "META-INF/replAsync-service.xml");
  +      c.setClusterName("StateTransferTestBase");
  +      c.setReplVersionString(getReplicationVersion());
         // Use a long timeout to facilitate setting debugger breakpoints
  -      tree.setInitialStateRetrievalTimeout(60000);
  +      c.setInitialStateRetrievalTimeout(60000);
         if (useMarshalling)
         {
  -         tree.setUseMarshalling(true);
  -         tree.setInactiveOnStartup(inactiveOnStartup);
  +         c.setUseRegionBasedMarshalling(true);
  +         c.setInactiveOnStartup(inactiveOnStartup);
         }
         if (useCacheLoader)
         {
  -         configureCacheLoader(tree, cacheID, useMarshalling);
  +         configureCacheLoader(c, cacheID, useMarshalling);
         }
  -      
  +      tree.setConfiguration(c);
         // Put the cache in the map before starting, so if it fails in
         // start it can still be destroyed later
         caches.put(cacheID, tree);
  @@ -634,7 +634,7 @@
         return tree;
      }
   
  -   protected void configureCacheLoader(PojoCache cache, String cacheID, boolean useExtended) throws Exception
  +   protected void configureCacheLoader(Configuration c, String cacheID, boolean useExtended) throws Exception
      {
         String tmp_location = getTempLocation(cacheID);
   
  @@ -647,9 +647,9 @@
         tmp_location = escapeWindowsPath(tmp_location);
         
         if (useExtended)
  -          cache.setCacheLoaderConfiguration(getCacheLoaderConfig("org.jboss.cache.loader.FileExtendedCacheLoader", tmp_location));
  +          c.setCacheLoaderConfiguration(getCacheLoaderConfig("org.jboss.cache.loader.FileExtendedCacheLoader", tmp_location));
         else
  -          cache.setCacheLoaderConfiguration(getCacheLoaderConfig("org.jboss.cache.loader.FileCacheLoader", tmp_location));
  +          c.setCacheLoaderConfiguration(getCacheLoaderConfig("org.jboss.cache.loader.FileCacheLoader", tmp_location));
      }
   
   
  
  
  



More information about the jboss-cvs-commits mailing list