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

Manik Surtani msurtani at jboss.com
Thu Jul 20 06:32:19 EDT 2006


  User: msurtani
  Date: 06/07/20 06:32:19

  Modified:    tests/perf/org/jboss/cache/aop   LocalPerfAopTest.java
                        ReplicatedSyncMapPerfAopTest.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.3       +6 -7      JBossCache/tests/perf/org/jboss/cache/aop/LocalPerfAopTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LocalPerfAopTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/perf/org/jboss/cache/aop/LocalPerfAopTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- LocalPerfAopTest.java	9 Apr 2006 12:33:50 -0000	1.2
  +++ LocalPerfAopTest.java	20 Jul 2006 10:32:18 -0000	1.3
  @@ -12,8 +12,7 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.jboss.cache.PropertyConfigurator;
  -import org.jboss.cache.TreeCache;
  -import org.jboss.cache.aop.PojoCache;
  +import org.jboss.cache.config.Configuration;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.LockStrategyFactory;
   import org.jboss.cache.transaction.DummyTransactionManager;
  @@ -29,13 +28,13 @@
   /**
    * Local mode performance test for PojoCache.
    *
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    * @author<a href="mailto:bwang at jboss.org">Ben Wang</a> May 20 2003
    */
   public class LocalPerfAopTest extends TestCase
   {
      PojoCache cache_;
  -   int cachingMode_ = TreeCache.LOCAL;
  +   Configuration.CacheMode cachingMode_ = Configuration.CacheMode.LOCAL;
      final static Properties p_;
   //   final static Log log_=LogFactory.getLog(LocalPerfAopTest.class);
      String oldFactory_ = null;
  @@ -64,7 +63,7 @@
         System.setProperty(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
   
         DummyTransactionManager.getInstance();
  -      initCaches(TreeCache.LOCAL);
  +      initCaches(Configuration.CacheMode.LOCAL);
         nodeList_ = nodeGen(depth_, children_);
         tm_ = new DummyTransactionManager();
   
  @@ -85,13 +84,13 @@
   
      }
   
  -   void initCaches(int caching_mode) throws Exception
  +   void initCaches(Configuration.CacheMode caching_mode) throws Exception
      {
         cachingMode_ = caching_mode;
         cache_ = new PojoCache();
         PropertyConfigurator config = new PropertyConfigurator();
         config.configure(cache_, "META-INF/local-service.xml"); // read in generic local xml
  -      cache_.setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup");
  +      cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup");
         cache_.startService();
      }
   
  
  
  
  1.3       +331 -334  JBossCache/tests/perf/org/jboss/cache/aop/ReplicatedSyncMapPerfAopTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ReplicatedSyncMapPerfAopTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/perf/org/jboss/cache/aop/ReplicatedSyncMapPerfAopTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ReplicatedSyncMapPerfAopTest.java	9 Apr 2006 12:33:50 -0000	1.2
  +++ ReplicatedSyncMapPerfAopTest.java	20 Jul 2006 10:32:18 -0000	1.3
  @@ -13,8 +13,7 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.jboss.cache.PropertyConfigurator;
  -import org.jboss.cache.TreeCache;
  -import org.jboss.cache.aop.PojoCache;
  +import org.jboss.cache.config.Configuration;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.LockStrategyFactory;
   import org.jboss.cache.transaction.DummyTransactionManager;
  @@ -32,13 +31,13 @@
   /**
    * Local mode performance test for TreeCache.
    *
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    * @author<a href="mailto:bwang at jboss.org">Ben Wang</a> May 20 2003
    */
   public class ReplicatedSyncMapPerfAopTest extends TestCase
   {
      PojoCache cache_;
  -   int cachingMode_ = TreeCache.LOCAL;
  +   Configuration.CacheMode cachingMode_ = Configuration.CacheMode.LOCAL;
      final static Properties p_;
   //   final static Log log_=LogFactory.getLog(LocalPerfAopTest.class);
      String oldFactory_ = null;
  @@ -73,7 +72,7 @@
         System.setProperty(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
   
         DummyTransactionManager.getInstance();
  -      initCaches(TreeCache.LOCAL);
  +      initCaches(Configuration.CacheMode.LOCAL);
         tm_ = new DummyTransactionManager();
   
         originalStrBuf_ = new StringBuffer();
  @@ -86,8 +85,6 @@
   
      private void generateString()
      {
  -      int length = seed1_.length();
  -      boolean isTrue = false;
         while (originalStrBuf_.length() < mapValueSize_) {
            originalStrBuf_.append(seed1_);
            newStrBuf_.append(seed2_);
  @@ -146,13 +143,13 @@
         proxyMaps_ = null;
      }
   
  -   void initCaches(int caching_mode) throws Exception
  +   void initCaches(Configuration.CacheMode caching_mode) throws Exception
      {
         cachingMode_ = caching_mode;
         cache_ = new PojoCache();
         PropertyConfigurator config = new PropertyConfigurator();
         config.configure(cache_, "META-INF/replSync-service.xml"); // read in generic replSync xml
  -      cache_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         cache_.startService();
   //        org.jgroups.log.Trace.init();
      }
  
  
  



More information about the jboss-cvs-commits mailing list