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

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


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

  Modified:    tests/functional/org/jboss/cache/transaction     
                        AbortionTest.java ConcurrentTransactionalTest.java
                        DeadlockTest.java IsolationLevelNoneTest.java
                        IsolationLevelReadCommittedNodeCreationRollbackTest.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.3       +11 -12    JBossCache/tests/functional/org/jboss/cache/transaction/AbortionTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbortionTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/AbortionTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- AbortionTest.java	6 Jul 2006 16:57:07 -0000	1.2
  +++ AbortionTest.java	20 Jul 2006 10:32:09 -0000	1.3
  @@ -54,17 +54,16 @@
       private MyTC initCache(boolean notifying) throws Exception
       {
           MyTC c = new MyTC();
  -        c.setCacheMode("REPL_SYNC");
  -        c.setClusterProperties( getJGroupsStack() );
  -        c.setFetchStateOnStartup(false);
  -        c.setFetchInMemoryState(false);
  +        c.getConfiguration().setCacheMode("REPL_SYNC");
  +        c.getConfiguration().setClusterConfig( getJGroupsStack() );
  +        c.getConfiguration().setFetchInMemoryState(false);
           if (!notifying)
           {
  -            c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +            c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
           }
           else
           {
  -            c.setTransactionManagerLookupClass("org.jboss.cache.transaction.NotifyingTransactionManager");
  +            c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.NotifyingTransactionManager");
           }
           c.startService();
           return c;
  @@ -116,12 +115,12 @@
   
       private void performTest(boolean syncCommitRollback, boolean abortBeforeCompletion) throws Exception
       {
  -        cache1.setSyncCommitPhase(syncCommitRollback);
  -        cache1.setSyncRollbackPhase(syncCommitRollback);
  -        cache2.setSyncCommitPhase(syncCommitRollback);
  -        cache2.setSyncRollbackPhase(syncCommitRollback);
  -        cache3.setSyncCommitPhase(syncCommitRollback);
  -        cache3.setSyncRollbackPhase(syncCommitRollback);
  +        cache1.getConfiguration().setSyncCommitPhase(syncCommitRollback);
  +        cache1.getConfiguration().setSyncRollbackPhase(syncCommitRollback);
  +        cache2.getConfiguration().setSyncCommitPhase(syncCommitRollback);
  +        cache2.getConfiguration().setSyncRollbackPhase(syncCommitRollback);
  +        cache3.getConfiguration().setSyncCommitPhase(syncCommitRollback);
  +        cache3.getConfiguration().setSyncRollbackPhase(syncCommitRollback);
   
           TransactionManager mgr1 = cache1.getTransactionManager();
           TransactionManager mgr2 = cache2.getTransactionManager();
  
  
  
  1.3       +4 -3      JBossCache/tests/functional/org/jboss/cache/transaction/ConcurrentTransactionalTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConcurrentTransactionalTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/ConcurrentTransactionalTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ConcurrentTransactionalTest.java	21 Nov 2005 18:03:26 -0000	1.2
  +++ ConcurrentTransactionalTest.java	20 Jul 2006 10:32:09 -0000	1.3
  @@ -14,6 +14,7 @@
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.PropertyConfigurator;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.Configuration;
   import org.jboss.cache.lock.IsolationLevel;
   
   import javax.naming.Context;
  @@ -26,7 +27,7 @@
    * Unit test for local TreeCache. Use locking and multiple threads to test
    * concurrent access to the tree.
    *
  - * @version $Id: ConcurrentTransactionalTest.java,v 1.2 2005/11/21 18:03:26 msurtani Exp $
  + * @version $Id: ConcurrentTransactionalTest.java,v 1.3 2006/07/20 10:32:09 msurtani Exp $
    */
   public class ConcurrentTransactionalTest extends TestCase
   {
  @@ -61,8 +62,8 @@
         PropertyConfigurator config = new PropertyConfigurator();
         config.configure(cache, "META-INF/local-service.xml");
   
  -      cache.setCacheMode(TreeCache.LOCAL);
  -      cache.setIsolationLevel(level);
  +      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  +      cache.getConfiguration().setIsolationLevel(level);
         cache.start();
         cache.put("/a/b/c", null);
      }
  
  
  
  1.5       +9 -6      JBossCache/tests/functional/org/jboss/cache/transaction/DeadlockTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DeadlockTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/DeadlockTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- DeadlockTest.java	5 May 2006 12:06:59 -0000	1.4
  +++ DeadlockTest.java	20 Jul 2006 10:32:09 -0000	1.5
  @@ -16,6 +16,7 @@
   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.misc.TestingUtil;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.TimeoutException;
  @@ -29,7 +30,7 @@
    * Tests transactional access to a local TreeCache, with concurrent (deadlock-prone) access.
    * Note: we use DummpyTranasctionManager to replace jta
    *
  - * @version $Id: DeadlockTest.java,v 1.4 2006/05/05 12:06:59 msurtani Exp $
  + * @version $Id: DeadlockTest.java,v 1.5 2006/07/20 10:32:09 msurtani Exp $
    */
   public class DeadlockTest extends TestCase {
      TreeCache   cache=null;
  @@ -49,11 +50,13 @@
      public void setUp() throws Exception {
         super.setUp();
         DummyTransactionManager.getInstance();
  -      cache=new TreeCache("test", null, 10000);
  -      cache.setCacheMode(TreeCache.LOCAL);
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -      cache.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
  -      cache.setLockAcquisitionTimeout(3000);
  +      cache=new TreeCache();
  +      cache.getConfiguration().setInitialStateRetrievalTimeout(10000);
  +      cache.getConfiguration().setClusterName("test");
  +      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
  +      cache.getConfiguration().setLockAcquisitionTimeout(3000);
         cache.createService();
         cache.startService();
         thread_ex=null;
  
  
  
  1.3       +8 -8      JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelNoneTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: IsolationLevelNoneTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelNoneTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- IsolationLevelNoneTest.java	22 Jun 2006 10:43:57 -0000	1.2
  +++ IsolationLevelNoneTest.java	20 Jul 2006 10:32:09 -0000	1.3
  @@ -6,8 +6,8 @@
   import org.jboss.cache.DummyTransactionManagerLookup;
   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.transaction.DummyTransactionManager;
   
   import javax.transaction.NotSupportedException;
   import javax.transaction.SystemException;
  @@ -16,7 +16,7 @@
   /**
    * Tests whether modifications within callbacks (TreeCacheListener) are handled correctly
    * @author Bela Ban
  - * @version $Id: IsolationLevelNoneTest.java,v 1.2 2006/06/22 10:43:57 msurtani Exp $
  + * @version $Id: IsolationLevelNoneTest.java,v 1.3 2006/07/20 10:32:09 msurtani Exp $
    */
   public class IsolationLevelNoneTest extends TestCase {
      TreeCache cache=null;
  @@ -44,8 +44,8 @@
   
      public void testWithoutTransactions() throws Exception {
         cache=new TreeCache();
  -      cache.setCacheMode(TreeCache.LOCAL);
  -      cache.setIsolationLevel(IsolationLevel.NONE);
  +      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.NONE);
         cache.startService();
         cache.put(FQN, KEY, VALUE);
         cache.put(FQN + "/d", KEY, VALUE);
  @@ -57,8 +57,8 @@
   
      public void testWithTransactions() throws Exception {
         cache=new TreeCache();
  -      cache.setCacheMode(TreeCache.LOCAL);
  -      cache.setIsolationLevel(IsolationLevel.NONE);
  +      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.NONE);
         cache.setTransactionManagerLookup(new DummyTransactionManagerLookup());
         cache.startService();
         tx=startTransaction();
  @@ -74,8 +74,8 @@
   
      public void testWithTransactionsRepeatableRead() throws Exception {
         cache=new TreeCache();
  -      cache.setCacheMode(TreeCache.LOCAL);
  -      cache.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
  +      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
         cache.setTransactionManagerLookup(new DummyTransactionManagerLookup());
         cache.startService();
         tx=startTransaction();
  
  
  
  1.2       +5 -4      JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelReadCommittedNodeCreationRollbackTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: IsolationLevelReadCommittedNodeCreationRollbackTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelReadCommittedNodeCreationRollbackTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- IsolationLevelReadCommittedNodeCreationRollbackTest.java	22 Feb 2006 17:04:45 -0000	1.1
  +++ IsolationLevelReadCommittedNodeCreationRollbackTest.java	20 Jul 2006 10:32:09 -0000	1.2
  @@ -13,6 +13,7 @@
   import org.jboss.cache.TreeCache;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.DummyTransactionManagerLookup;
  +import org.jboss.cache.config.Configuration;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.TimeoutException;
   import EDU.oswego.cs.dl.util.concurrent.Latch;
  @@ -26,7 +27,7 @@
    *
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
    *
  - * @version $Id: IsolationLevelReadCommittedNodeCreationRollbackTest.java,v 1.1 2006/02/22 17:04:45 msurtani Exp $
  + * @version $Id: IsolationLevelReadCommittedNodeCreationRollbackTest.java,v 1.2 2006/07/20 10:32:09 msurtani Exp $
    */
   
   public class IsolationLevelReadCommittedNodeCreationRollbackTest extends TestCase
  @@ -53,9 +54,9 @@
         readerError = null;
   
         cache = new TreeCache();
  -      cache.setCacheMode(TreeCache.LOCAL);
  -      cache.setIsolationLevel(IsolationLevel.READ_COMMITTED);
  -      cache.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
  +      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
  +      cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
         cache.startService();
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list