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

Brian Stansberry brian.stansberry at jboss.com
Wed Oct 25 00:50:20 EDT 2006


  User: bstansberry
  Date: 06/10/25 00:50:20

  Modified:    tests/functional/org/jboss/cache/optimistic  
                        AbstractOptimisticTestCase.java
                        OptimisticWithPassivationTest.java
  Log:
  Handle parsing of config XML in XmlConfigurationParser 
  
  Revision  Changes    Path
  1.41      +7 -4      JBossCache/tests/functional/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbstractOptimisticTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -b -r1.40 -r1.41
  --- AbstractOptimisticTestCase.java	7 Sep 2006 16:59:05 -0000	1.40
  +++ AbstractOptimisticTestCase.java	25 Oct 2006 04:50:20 -0000	1.41
  @@ -8,7 +8,9 @@
   import org.jboss.cache.CacheSPI;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.CacheLoaderConfig;
   import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.interceptors.Interceptor;
   import org.jboss.cache.interceptors.InvocationContextInterceptor;
   import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
  @@ -103,7 +105,7 @@
         return createCacheWithLoader(false);
      }
   
  -   protected Element getCacheLoaderConfig(boolean shared, String filename, boolean passivation) throws Exception
  +   protected CacheLoaderConfig getCacheLoaderConfig(boolean shared, String filename, boolean passivation) throws Exception
      {
         String xml = "            <config>\n" +
                 "                <passivation>" + passivation + "</passivation>\n" +
  @@ -118,7 +120,8 @@
                 "                    <ignoreModifications>false</ignoreModifications>\n" +
                 "                </cacheloader>\n" +
                 "            </config>";
  -      return XmlHelper.stringToElement(xml);
  +      Element element = XmlHelper.stringToElement(xml);
  +      return XmlConfigurationParser.parseCacheLoaderConfig(element);
      }
   
      protected TreeCache createCacheWithLoader(boolean passivationEnabled) throws Exception
  @@ -126,7 +129,7 @@
         TreeCache cache = createCacheUnstarted();
         Configuration c = cache.getConfiguration();
         cache.setConfiguration(c);
  -      c.setCacheLoaderConfiguration(getCacheLoaderConfig(true, getTempDir(), passivationEnabled));
  +      c.setCacheLoaderConfig(getCacheLoaderConfig(true, getTempDir(), passivationEnabled));
         cache.create();
         cache.start();
         return cache;
  @@ -261,7 +264,7 @@
         c.setSyncRollbackPhase(true);
         c.setNodeLockingScheme("OPTIMISTIC");
         c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -      c.setCacheLoaderConfiguration(getCacheLoaderConfig(shared, shared ? getTempDir(name + "-shared") : getTempDir(name + instanceNumber++), false));
  +      c.setCacheLoaderConfig(getCacheLoaderConfig(shared, shared ? getTempDir(name + "-shared") : getTempDir(name + instanceNumber++), false));
   
         cache.create();
         cache.start();
  
  
  
  1.13      +6 -3      JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticWithPassivationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: OptimisticWithPassivationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/OptimisticWithPassivationTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- OptimisticWithPassivationTest.java	6 Sep 2006 15:30:58 -0000	1.12
  +++ OptimisticWithPassivationTest.java	25 Oct 2006 04:50:20 -0000	1.13
  @@ -8,6 +8,8 @@
   
   import junit.framework.Assert;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.CacheLoaderConfig;
  +import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.transaction.DummyTransactionManager;
   import org.jboss.cache.xml.XmlHelper;
  @@ -26,7 +28,7 @@
         super(s);
      }
   
  -   protected Element getCacheLoaderConfig(String loc) throws Exception
  +   protected CacheLoaderConfig getCacheLoaderConfig(String loc) throws Exception
      {
         String xml = "            <config>\n" +
                 "                \n" +
  @@ -43,13 +45,14 @@
                 "                </cacheloader>\n" +
                 "                \n" +
                 "            </config>";
  -      return XmlHelper.stringToElement(xml);
  +      Element element = XmlHelper.stringToElement(xml);
  +      return XmlConfigurationParser.parseCacheLoaderConfig(element);
      }
   
      private TreeCache createLocalCache() throws Exception
      {
         TreeCache cache = createCacheUnstarted(false);
  -      cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(getTempDir()));
  +      cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(getTempDir()));
   
         cache.create();
         cache.start();
  
  
  



More information about the jboss-cvs-commits mailing list