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

Manik Surtani msurtani at jboss.com
Thu Jul 20 05:03:53 EDT 2006


  User: msurtani
  Date: 06/07/20 05:03:53

  Modified:    tests/functional/org/jboss/cache/loader          
                        AsyncFileCacheLoaderTest.java BdbjeTest.java
                        CacheLoaderWithReplicationTest.java
                        ChainingCacheLoaderFullTest.java
                        DataSourceIntegrationTest.java
                        FileExtendedCacheLoaderTest.java
                        JDBCExtendedCacheLoaderTestCase.java
                        LocalDelegatingCacheLoaderTest.java
                        TcpCacheLoaderTest.java TxCacheLoaderTest.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.12      +4 -2      JBossCache/tests/functional/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AsyncFileCacheLoaderTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- AsyncFileCacheLoaderTest.java	4 Apr 2006 19:21:35 -0000	1.11
  +++ AsyncFileCacheLoaderTest.java	20 Jul 2006 09:03:53 -0000	1.12
  @@ -7,6 +7,8 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
   import org.jboss.cache.Modification;
  +import org.jboss.cache.config.Configuration;
  +
   import java.util.Map;
   import java.util.HashMap;
   import java.util.Collections;
  @@ -24,9 +26,9 @@
      protected void configureCache(String props) throws Exception
      {
          cache = new TreeCache();
  -       cache.setCacheMode(TreeCache.LOCAL);
  +       cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
          // cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.jdbm.JdbmCacheLoader", 
  -       cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", 
  +       cache.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader",
                   props, true, false, true));
          cache.create();
          cache.start();
  
  
  
  1.5       +3 -3      JBossCache/tests/functional/org/jboss/cache/loader/BdbjeTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BdbjeTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/BdbjeTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- BdbjeTest.java	19 Jul 2006 08:29:19 -0000	1.4
  +++ BdbjeTest.java	20 Jul 2006 09:03:53 -0000	1.5
  @@ -20,7 +20,7 @@
    * directory.  Any scratch directory will do, but beware that all files in
    * the directory will be deleted by setUp().</p>
    *
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class BdbjeTest extends TestCase {
   
  @@ -101,9 +101,9 @@
          * the TreeCache object is not used otherwise during testing.
          */
         treeCache = new TreeCache();
  -      treeCache.setClusterName("myCluster");
  +      treeCache.getConfiguration().setClusterName("myCluster");
         if (transactional) {
  -         treeCache.setTransactionManagerLookupClass(
  +         treeCache.getConfiguration().setTransactionManagerLookupClass(
               "org.jboss.cache.DummyTransactionManagerLookup");
         }
         treeCache.startService();
  
  
  
  1.21      +17 -16    JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderWithReplicationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoaderWithReplicationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderWithReplicationTest.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- CacheLoaderWithReplicationTest.java	8 May 2006 19:43:41 -0000	1.20
  +++ CacheLoaderWithReplicationTest.java	20 Jul 2006 09:03:53 -0000	1.21
  @@ -11,6 +11,7 @@
   import junit.framework.TestSuite;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.Configuration;
   import org.jboss.cache.misc.TestingUtil;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -49,12 +50,12 @@
       public void setUp() throws Exception
       {
           cache1 = new TreeCache();
  -        cache1.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.bdbje.BdbjeCacheLoader", "location=" + tmpLocation1, false, true, false));
  -        cache1.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +        cache1.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.bdbje.BdbjeCacheLoader", "location=" + tmpLocation1, false, true, false));
  +        cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
   
           cache2 = new TreeCache();
  -        cache2.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.bdbje.BdbjeCacheLoader", "location=" + tmpLocation2, false, true, false));
  -        cache2.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +        cache2.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.bdbje.BdbjeCacheLoader", "location=" + tmpLocation2, false, true, false));
  +        cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
       }
   
       public void tearDown() throws Exception
  @@ -91,8 +92,8 @@
   
       public void testPessSyncRepl() throws Exception
       {
  -        cache1.setCacheMode(TreeCache.REPL_SYNC);
  -        cache2.setCacheMode(TreeCache.REPL_SYNC);
  +        cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
  +        cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
   
           cache1.startService();
           cache2.startService();
  @@ -140,8 +141,8 @@
   
       public void testPessAsyncRepl() throws Exception
       {
  -        cache1.setCacheMode(TreeCache.REPL_ASYNC);
  -        cache2.setCacheMode(TreeCache.REPL_ASYNC);
  +        cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
  +        cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
   
           cache1.startService();
           cache2.startService();
  @@ -197,11 +198,11 @@
       {
           try
           {
  -        cache1.setCacheMode(TreeCache.REPL_SYNC);
  -        cache2.setCacheMode(TreeCache.REPL_SYNC);
  +        cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
  +        cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
   
  -        cache1.setNodeLockingScheme("OPTIMISTIC");
  -        cache2.setNodeLockingScheme("OPTIMISTIC");
  +        cache1.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
  +        cache2.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
   
           cache1.startService();
           cache2.startService();
  @@ -251,11 +252,11 @@
   
       public void testOptAsyncRepl() throws Exception
       {
  -        cache1.setCacheMode(TreeCache.REPL_ASYNC);
  -        cache2.setCacheMode(TreeCache.REPL_ASYNC);
  +        cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
  +        cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
   
  -        cache1.setNodeLockingScheme("OPTIMISTIC");
  -        cache2.setNodeLockingScheme("OPTIMISTIC");
  +        cache1.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
  +        cache2.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
   
           cache1.startService();
           cache2.startService();
  
  
  
  1.6       +3 -3      JBossCache/tests/functional/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ChainingCacheLoaderFullTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ChainingCacheLoaderFullTest.java	10 Jan 2006 23:41:18 -0000	1.5
  +++ ChainingCacheLoaderFullTest.java	20 Jul 2006 09:03:53 -0000	1.6
  @@ -48,9 +48,9 @@
       protected void startCache(boolean ignoreMods1, boolean ignoreMods2) throws Exception
       {
           cache = new TreeCache();
  -        cache.setCacheLoaderConfiguration(getCacheLoaderConfig(loc1, loc2, ignoreMods1, ignoreMods2));
  -        cache.setCacheMode("local");
  -        cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +        cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(loc1, loc2, ignoreMods1, ignoreMods2));
  +        cache.getConfiguration().setCacheMode("local");
  +        cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
           cache.startService();
   
           chainingCacheLoader = (ChainingCacheLoader) cache.getCacheLoader();
  
  
  
  1.7       +4 -5      JBossCache/tests/functional/org/jboss/cache/loader/DataSourceIntegrationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DataSourceIntegrationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/DataSourceIntegrationTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- DataSourceIntegrationTest.java	16 Feb 2006 10:59:34 -0000	1.6
  +++ DataSourceIntegrationTest.java	20 Jul 2006 09:03:53 -0000	1.7
  @@ -7,7 +7,6 @@
   package org.jboss.cache.loader;
   
   import org.jboss.cache.TreeCache;
  -import org.jboss.cache.TreeCacheMBean;
   import org.jboss.cache.transaction.DummyTransactionManager;
   import org.w3c.dom.Element;
   
  @@ -24,7 +23,7 @@
      private String old_factory = null;
      private final String FACTORY = "org.jboss.cache.transaction.DummyContextFactory";
      private final String JNDI_NAME = "java:/MockDS";
  -   private TreeCacheMBean cache;
  +   private TreeCache cache;
   
      protected void setUp() throws Exception {
         super.setUp();
  @@ -59,9 +58,9 @@
            // expected
         }
         cache=new TreeCache();
  -      cache.setCacheMode("local");
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -       cache.setCacheLoaderConfiguration(getCacheLoaderConfig(JNDI_NAME));
  +      cache.getConfiguration().setCacheMode("local");
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +       cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(JNDI_NAME));
         cache.createService();
   
   
  
  
  
  1.13      +1 -1      JBossCache/tests/functional/org/jboss/cache/loader/FileExtendedCacheLoaderTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FileExtendedCacheLoaderTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/FileExtendedCacheLoaderTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- FileExtendedCacheLoaderTest.java	24 Jan 2006 17:27:25 -0000	1.12
  +++ FileExtendedCacheLoaderTest.java	20 Jul 2006 09:03:53 -0000	1.13
  @@ -22,7 +22,7 @@
       }
   
       protected void configureCache() throws Exception {
  -      cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileExtendedCacheLoader", "location=" + tmp_location, false, true, false));
  +      cache.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileExtendedCacheLoader", "location=" + tmp_location, false, true, false));
      }
   
      public static Test suite() {
  
  
  
  1.7       +3 -3      JBossCache/tests/functional/org/jboss/cache/loader/JDBCExtendedCacheLoaderTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JDBCExtendedCacheLoaderTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/JDBCExtendedCacheLoaderTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- JDBCExtendedCacheLoaderTestCase.java	24 May 2006 05:47:43 -0000	1.6
  +++ JDBCExtendedCacheLoaderTestCase.java	20 Jul 2006 09:03:53 -0000	1.7
  @@ -6,11 +6,11 @@
    */
   package org.jboss.cache.loader;
   
  -import java.util.Properties;
  -
   import junit.framework.Test;
   import junit.framework.TestSuite;
   
  +import java.util.Properties;
  +
   /**
    * This test has MySQL hard-coded. To run it, run MySQL first: mysqld -u=root
    * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
  @@ -35,7 +35,7 @@
                         "cache.jdbc.user=" + prop.getProperty("cache.jdbc.user") + "\n" +
                         "cache.jdbc.password=" + prop.getProperty("cache.jdbc.password") + "\n" +
                         "cache.jdbc.node.type=" + prop.getProperty("cache.jdbc.node.type");
  -       cache.setCacheLoaderConfiguration( getSingleCacheLoaderConfig("", "org.jboss.cache.loader.JDBCCacheLoader", props, false, true, false) );
  +       cache.getConfiguration().setCacheLoaderConfiguration( getSingleCacheLoaderConfig("", "org.jboss.cache.loader.JDBCCacheLoader", props, false, true, false) );
       }
   
      public static Test suite()
  
  
  
  1.10      +4 -3      JBossCache/tests/functional/org/jboss/cache/loader/LocalDelegatingCacheLoaderTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LocalDelegatingCacheLoaderTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/LocalDelegatingCacheLoaderTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- LocalDelegatingCacheLoaderTest.java	24 Jan 2006 17:27:25 -0000	1.9
  +++ LocalDelegatingCacheLoaderTest.java	20 Jul 2006 09:03:53 -0000	1.10
  @@ -3,6 +3,7 @@
   import junit.framework.Test;
   import junit.framework.TestSuite;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.Configuration;
   
   /**
    * Created by IntelliJ IDEA.
  @@ -15,12 +16,12 @@
   
       protected void configureCache() throws Exception {
         delegating_cache=new TreeCache();
  -      delegating_cache.setCacheMode(TreeCache.LOCAL);
  +      delegating_cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         delegating_cache.createService();
         delegating_cache.startService();
           
         // configure first ...
  -      cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.LocalDelegatingCacheLoader", "", false, false, false));
  +      cache.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.LocalDelegatingCacheLoader", "", false, false, false));
   
         // force our own cache loader instance
         LocalDelegatingCacheLoader cacheLoader = new LocalDelegatingCacheLoader( delegating_cache );
  
  
  
  1.6       +2 -2      JBossCache/tests/functional/org/jboss/cache/loader/TcpCacheLoaderTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TcpCacheLoaderTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/TcpCacheLoaderTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- TcpCacheLoaderTest.java	19 Jul 2006 08:29:19 -0000	1.5
  +++ TcpCacheLoaderTest.java	20 Jul 2006 09:03:53 -0000	1.6
  @@ -7,7 +7,7 @@
   /**
    * Tests the TcpDelegatingCacheLoader
    * @author Bela Ban
  - * @version $Id: TcpCacheLoaderTest.java,v 1.5 2006/07/19 08:29:19 msurtani Exp $
  + * @version $Id: TcpCacheLoaderTest.java,v 1.6 2006/07/20 09:03:53 msurtani Exp $
    */
   public class TcpCacheLoaderTest extends CacheLoaderTestsBase {
      static TcpCacheServer cache_server=null;
  @@ -45,7 +45,7 @@
   
   
      protected void configureCache() throws Exception {
  -      cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("",
  +      cache.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("",
                                                                      "org.jboss.cache.loader.TcpDelegatingCacheLoader",
                                                                      "host=127.0.0.1\nport=12121", false, true, false));
      }
  
  
  
  1.5       +10 -10    JBossCache/tests/functional/org/jboss/cache/loader/TxCacheLoaderTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TxCacheLoaderTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/TxCacheLoaderTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- TxCacheLoaderTest.java	5 May 2006 12:06:58 -0000	1.4
  +++ TxCacheLoaderTest.java	20 Jul 2006 09:03:53 -0000	1.5
  @@ -16,7 +16,7 @@
   
   /**
    * @author Bela Ban
  - * @version $Id: TxCacheLoaderTest.java,v 1.4 2006/05/05 12:06:58 msurtani Exp $
  + * @version $Id: TxCacheLoaderTest.java,v 1.5 2006/07/20 09:03:53 msurtani Exp $
    */
   public class TxCacheLoaderTest extends AbstractCacheLoaderTestBase {
      TreeCache cache1, cache2;
  @@ -29,10 +29,10 @@
          String location = tmpLoc + File.separator + "TxCacheLoaderTest1";
   
          cache1=new TreeCache();
  -       cache1.setCacheMode("repl_sync");
  -       cache1.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +       cache1.getConfiguration().setCacheMode("repl_sync");
  +       cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
   
  -       cache1.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + location, false, false, false));
  +       cache1.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + location, false, false, false));
          // cache1.setReplQueueInterval(3000);
          cache1.createService();
          cache1.startService();
  @@ -40,10 +40,10 @@
          location = tmpLoc + File.separator + "TxCacheLoaderTest2";
   
          cache2=new TreeCache();
  -       cache2.setCacheMode("repl_sync");
  -       cache2.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -       cache2.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + location, false, false, false));
  -       cache2.setLockAcquisitionTimeout(2000);
  +       cache2.getConfiguration().setCacheMode("repl_sync");
  +       cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +       cache2.getConfiguration().setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + location, false, false, false));
  +       cache2.getConfiguration().setLockAcquisitionTimeout(2000);
          // cache2.setReplQueueInterval(3000);
          cache2.createService();
          cache2.startService();
  @@ -91,8 +91,8 @@
         mgr.begin();
         Transaction tx1=mgr.getTransaction();
   
  -      cache1.setLockAcquisitionTimeout(1500);
  -      cache2.setLockAcquisitionTimeout(1500);
  +      cache1.getConfiguration().setLockAcquisitionTimeout(1500);
  +      cache2.getConfiguration().setLockAcquisitionTimeout(1500);
   
   
         Thread locker=new Thread() {
  
  
  



More information about the jboss-cvs-commits mailing list