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

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


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

  Modified:    tests/functional/org/jboss/cache      CallbackTest.java
                        FqnTest.java InterceptorConfigurationTest.java
                        LifeCycleTest.java TreeCacheFunctionalTest.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.10      +2 -2      JBossCache/tests/functional/org/jboss/cache/CallbackTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CallbackTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/CallbackTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- CallbackTest.java	20 Jul 2006 08:05:18 -0000	1.9
  +++ CallbackTest.java	20 Jul 2006 09:03:55 -0000	1.10
  @@ -13,7 +13,7 @@
   /**
    * Tests whether modifications within callbacks (TreeCacheListener) are handled correctly
    * @author Bela Ban
  - * @version $Id: CallbackTest.java,v 1.9 2006/07/20 08:05:18 msurtani Exp $
  + * @version $Id: CallbackTest.java,v 1.10 2006/07/20 09:03:55 msurtani Exp $
    */
   public class CallbackTest extends TestCase {
      TreeCache cache=null, cache2;
  @@ -165,7 +165,7 @@
   
      TreeCache createCache(Configuration.CacheMode mode, IsolationLevel level) throws Exception {
         TreeCache c=new TreeCache();
  -      c.getConfiguration().setCacheModeInt(mode);
  +      c.getConfiguration().setCacheMode(mode);
         c.getConfiguration().setIsolationLevel(level);
         c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         c.createService();
  
  
  
  1.11      +2 -2      JBossCache/tests/functional/org/jboss/cache/FqnTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FqnTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/FqnTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- FqnTest.java	18 Jul 2006 16:32:48 -0000	1.10
  +++ FqnTest.java	20 Jul 2006 09:03:55 -0000	1.11
  @@ -17,7 +17,7 @@
   /**
    * Tests {@link Fqn}.
    * @author <a href="mailto:bela at jboss.org">Bela Ban</a> May 9, 2003
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   public class FqnTest extends TestCase {
   
  @@ -276,7 +276,7 @@
      {
          Fqn f = new Fqn(new Object[] {"test", new Integer(1)});
          TreeCache tc = new TreeCache();
  -       tc.setCacheMode("LOCAL");
  +       tc.getConfiguration().setCacheMode("LOCAL");
          tc.startService();
   
          tc.put(f, "key",  "value");
  
  
  
  1.15      +38 -38    JBossCache/tests/functional/org/jboss/cache/InterceptorConfigurationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InterceptorConfigurationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/InterceptorConfigurationTest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- InterceptorConfigurationTest.java	22 May 2006 16:21:58 -0000	1.14
  +++ InterceptorConfigurationTest.java	20 Jul 2006 09:03:55 -0000	1.15
  @@ -25,7 +25,7 @@
      {
         super.setUp();
         cache = new TreeCache();
  -      cache.setCacheMode(TreeCache.LOCAL);
  +      cache.getConfiguration().setCacheMode("LOCAL");
      }
   
      protected void tearDown() throws Exception
  @@ -41,7 +41,7 @@
   
      public void testBareConfig() throws Exception
      {
  -      cache.setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
         Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
         List list = InterceptorChainFactory.asList(chain);
         System.out.println("testBareConfig interceptors are:\n" + list);
  @@ -56,8 +56,8 @@
   
      public void testTxConfig() throws Exception
      {
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
   
         Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
         List list = InterceptorChainFactory.asList(chain);
  @@ -93,11 +93,11 @@
   
      public void testSharedCacheLoaderConfig() throws Exception
      {
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
  -      cache.setCacheMode(TreeCache.REPL_ASYNC);
  -      cache.setFetchInMemoryState(false);
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
  +      cache.getConfiguration().setCacheMode("REPL_ASYNC");
  +      cache.getConfiguration().setFetchInMemoryState(false);
         cache.createService();
         Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
         List list = InterceptorChainFactory.asList(chain);
  @@ -118,11 +118,11 @@
   
      public void testUnsharedCacheLoaderConfig() throws Exception
      {
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(false, true));
  -      cache.setCacheMode(TreeCache.REPL_ASYNC);
  -      cache.setFetchInMemoryState(false);
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(false, true));
  +      cache.getConfiguration().setCacheMode("REPL_ASYNC");
  +      cache.getConfiguration().setFetchInMemoryState(false);
         cache.createService();
         Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
         List list = InterceptorChainFactory.asList(chain);
  @@ -143,9 +143,9 @@
   
      public void testTxAndRepl() throws Exception
      {
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setCacheMode("repl_sync");
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setCacheMode("repl_sync");
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
         List list = InterceptorChainFactory.asList(chain);
         System.out.println("testTxAndRepl interceptors are:\n" + list);
  @@ -165,8 +165,8 @@
      public void testOptimisticChain() throws Exception
      {
         TreeCache cache = new TreeCache();
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setNodeLockingOptimistic(true);
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setNodeLockingOptimistic(true);
   
         Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
   
  @@ -190,9 +190,9 @@
      public void testOptimisticReplicatedChain() throws Exception
      {
         TreeCache cache = new TreeCache();
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setNodeLockingOptimistic(true);
  -      cache.setCacheMode("REPL_SYNC");
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setNodeLockingOptimistic(true);
  +      cache.getConfiguration().setCacheMode("REPL_SYNC");
   
         Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
   
  @@ -218,9 +218,9 @@
      public void testOptimisticCacheLoaderChain() throws Exception
      {
         TreeCache cache = new TreeCache();
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setNodeLockingOptimistic(true);
  -      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setNodeLockingOptimistic(true);
  +      cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
         cache.createService();
         Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
   
  @@ -249,9 +249,9 @@
      public void testOptimisticPassivationCacheLoaderChain() throws Exception
      {
         TreeCache cache = new TreeCache();
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setNodeLockingOptimistic(true);
  -      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(true, false));
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setNodeLockingOptimistic(true);
  +      cache.getConfiguration().setCacheLoaderConfiguration(getCacheLoaderConfig(true, false));
         cache.createService();
         Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
   
  @@ -280,8 +280,8 @@
      public void testInvalidationInterceptorChain() throws Exception
      {
         TreeCache cache = new TreeCache();
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setCacheMode(TreeCache.REPL_ASYNC);
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setCacheMode("REPL_ASYNC");
   
         Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
   
  @@ -303,8 +303,8 @@
   
         // now for my invalidation chain.
         cache = new TreeCache();
  -      cache.setUseInterceptorMbeans(false);
  -      cache.setCacheMode(TreeCache.INVALIDATION_ASYNC);
  +      cache.getConfiguration().setUseInterceptorMbeans(false);
  +      cache.getConfiguration().setCacheMode("INVALIDATION_ASYNC");
         chain = new InterceptorChainFactory().buildInterceptorChain(cache);
   
         // test the chain size.
  @@ -324,7 +324,7 @@
   
      public void testCacheMgmtConfig() throws Exception
      {
  -      cache.setUseInterceptorMbeans(true);
  +      cache.getConfiguration().setUseInterceptorMbeans(true);
         Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
         List list = InterceptorChainFactory.asList(chain);
         System.out.println("testCacheMgmtConfig interceptors are:\n" + list);
  @@ -362,9 +362,9 @@
   
           xmlString += "<buddyPoolName>buddyPoolName</buddyPoolName>";
           xmlString += "</config>";
  -       cache.setCacheMode("REPL_SYNC");
  -        cache.setBuddyReplicationConfig( XmlHelper.stringToElement(xmlString) );
  -        cache.setNodeLockingScheme("OPTIMISTIC");
  +        cache.getConfiguration().setCacheMode("REPL_SYNC");
  +        cache.getConfiguration().setBuddyReplicationConfig( XmlHelper.stringToElement(xmlString) );
  +        cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
   
           Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
   
  @@ -394,8 +394,8 @@
   
            xmlString += "<buddyPoolName>buddyPoolName</buddyPoolName>";
            xmlString += "</config>";
  -         cache.setCacheMode("REPL_SYNC");
  -         cache.setBuddyReplicationConfig( XmlHelper.stringToElement(xmlString) );
  +         cache.getConfiguration().setCacheMode("REPL_SYNC");
  +         cache.getConfiguration().setBuddyReplicationConfig( XmlHelper.stringToElement(xmlString) );
   
            Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
   
  
  
  
  1.3       +9 -8      JBossCache/tests/functional/org/jboss/cache/LifeCycleTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LifeCycleTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/LifeCycleTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- LifeCycleTest.java	3 Nov 2005 12:39:53 -0000	1.2
  +++ LifeCycleTest.java	20 Jul 2006 09:03:55 -0000	1.3
  @@ -6,6 +6,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.transaction.DummyTransactionManager;
  +import org.jboss.cache.config.Configuration;
   
   import javax.transaction.NotSupportedException;
   import javax.transaction.SystemException;
  @@ -14,14 +15,14 @@
   /**
    * Tests restart (stop-destroy-create-start) of TreeCache
    * @author Bela Ban
  - * @version $Id: LifeCycleTest.java,v 1.2 2005/11/03 12:39:53 msurtani Exp $
  + * @version $Id: LifeCycleTest.java,v 1.3 2006/07/20 09:03:55 msurtani Exp $
    */
   public class LifeCycleTest extends TestCase {
   
       private static Log log = LogFactory.getLog(LifeCycleTest.class);
   
      public void testLocalRestartNoTransactions() throws Exception {
  -      TreeCache cache=createCache(TreeCache.LOCAL);
  +      TreeCache cache=createCache(Configuration.CacheMode.LOCAL);
         cache.createService();
         cache.startService();
   
  @@ -39,7 +40,7 @@
   
   
      public void testLocalRestartWithTransactions() throws Exception {
  -      TreeCache cache=createCache(TreeCache.LOCAL);
  +      TreeCache cache=createCache(Configuration.CacheMode.LOCAL);
         cache.createService();
         cache.startService();
   
  @@ -61,7 +62,7 @@
      }
   
      public void testStartNoCreate() throws Exception {
  -      TreeCache cache=createCache(TreeCache.LOCAL);
  +      TreeCache cache=createCache(Configuration.CacheMode.LOCAL);
         cache.start();
   
         cache.put("/a/b/c", null);
  @@ -77,7 +78,7 @@
      }
   
      public void testReStartNoCreate() throws Exception {
  -      TreeCache cache=createCache(TreeCache.LOCAL);
  +      TreeCache cache=createCache(Configuration.CacheMode.LOCAL);
         cache.start();
         cache.stop();
         cache.start();
  @@ -94,10 +95,10 @@
         assertEquals(0, cache.getNumberOfLocksHeld());
      }
   
  -   TreeCache createCache(int cache_mode) throws Exception {
  +   TreeCache createCache(Configuration.CacheMode cache_mode) throws Exception {
         TreeCache retval=new TreeCache();
  -      retval.setCacheMode(cache_mode);
  -      retval.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      retval.getConfiguration().setCacheMode(cache_mode);
  +      retval.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         return retval;
      }
   
  
  
  
  1.2       +5 -7      JBossCache/tests/functional/org/jboss/cache/TreeCacheFunctionalTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCacheFunctionalTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/TreeCacheFunctionalTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- TreeCacheFunctionalTest.java	8 Jul 2005 05:58:07 -0000	1.1
  +++ TreeCacheFunctionalTest.java	20 Jul 2006 09:03:55 -0000	1.2
  @@ -3,9 +3,7 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -import org.jboss.cache.CacheException;
  -import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.Configuration;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.TimeoutException;
   import org.jboss.cache.transaction.DummyTransactionManager;
  @@ -18,7 +16,7 @@
   /**
    * Simple functional tests for TreeCache
    * @author Bela Ban
  - * @version $Id: TreeCacheFunctionalTest.java,v 1.1 2005/07/08 05:58:07 msurtani Exp $
  + * @version $Id: TreeCacheFunctionalTest.java,v 1.2 2006/07/20 09:03:55 msurtani Exp $
    */
   public class TreeCacheFunctionalTest extends TestCase {
      TreeCache cache=null;
  @@ -32,9 +30,9 @@
      protected void setUp() throws Exception {
         super.setUp();
         cache=new TreeCache();
  -      cache.setCacheMode(TreeCache.LOCAL);
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -      cache.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
  +      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
         cache.createService();
         cache.startService();
         ex=null;
  
  
  



More information about the jboss-cvs-commits mailing list