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

Manik Surtani msurtani at jboss.com
Thu Jul 20 04:05:17 EDT 2006


  User: msurtani
  Date: 06/07/20 04:05:17

  Modified:    tests/functional/org/jboss/cache/aop  
                        CacheLoaderTestsBase.java TreeCacheAopTester.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.5       +5 -7      JBossCache/tests/functional/org/jboss/cache/aop/CacheLoaderTestsBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoaderTestsBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/aop/CacheLoaderTestsBase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- CacheLoaderTestsBase.java	9 Apr 2006 12:33:49 -0000	1.4
  +++ CacheLoaderTestsBase.java	20 Jul 2006 08:05:17 -0000	1.5
  @@ -1,21 +1,19 @@
   package org.jboss.cache.aop;
   
  -import javax.transaction.Transaction;
  -
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.aop.PojoCache;
   import org.jboss.cache.aop.test.Person;
   import org.jboss.cache.loader.CacheLoader;
   
  +import javax.transaction.Transaction;
  +
   /**
    * Commons tests for all CacheLoaders. Aop version.
    *
    * @author bwang
  - * @version $Id: CacheLoaderTestsBase.java,v 1.4 2006/04/09 12:33:49 bwang Exp $
  + * @version $Id: CacheLoaderTestsBase.java,v 1.5 2006/07/20 08:05:17 msurtani Exp $
    */
   abstract public class CacheLoaderTestsBase extends TestCase {
      PojoCache cache;
  @@ -26,9 +24,9 @@
      protected void setUp() throws Exception {
         super.setUp();
         cache = new PojoCache();
  -      cache.setCacheMode("local");
  +      cache.getConfiguration().setCacheMode("local");
         configureCache();
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         cache.createService();
         cache.startService();
         loader = cache.getCacheLoader();
  
  
  
  1.5       +14 -8     JBossCache/tests/functional/org/jboss/cache/aop/TreeCacheAopTester.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCacheAopTester.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/aop/TreeCacheAopTester.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- TreeCacheAopTester.java	9 Apr 2006 12:33:49 -0000	1.4
  +++ TreeCacheAopTester.java	20 Jul 2006 08:05:17 -0000	1.5
  @@ -5,14 +5,19 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.aop.Advised;
  -import org.jboss.cache.PropertyConfigurator;
  -import org.jboss.cache.aop.PojoCache;
   import org.jboss.cache.aop.test.Address;
   import org.jboss.cache.aop.test.Person;
   import org.jboss.cache.aop.test.Student;
  +import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.factories.XmlConfigurationParser;
   
   import java.lang.reflect.Field;
  -import java.util.*;
  +import java.util.ArrayList;
  +import java.util.HashMap;
  +import java.util.HashSet;
  +import java.util.List;
  +import java.util.Map;
  +import java.util.Set;
   
   /**
    * Proxy to the PojoCache.
  @@ -36,8 +41,9 @@
                cache2.startService();
                */
            cache = new PojoCache();
  -         PropertyConfigurator config = new PropertyConfigurator();
  -         config.configure(cache, configFile); // read in generic replSync xml
  +          XmlConfigurationParser parser = new XmlConfigurationParser();
  +          Configuration c = parser.parseFile(configFile);
  +          cache.setConfiguration(c);
            cache.startService();
         } catch (Exception e) {
            e.printStackTrace();
  @@ -64,7 +70,7 @@
      }
      
      public void setSyncCommitPhase(boolean bool) {
  -      cache.setSyncCommitPhase(true);
  +      cache.getConfiguration().setSyncCommitPhase(bool);
      }
   
      public void createPerson(String key, String name, int age)
  
  
  



More information about the jboss-cvs-commits mailing list