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

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/transaction    
                        ConcurrentBankTest.java
                        InvocationContextCleanupTest.java
                        PrepareTxTest.java TransactionTest.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.4       +2 -2      JBossCache/tests/functional/org/jboss/cache/transaction/ConcurrentBankTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConcurrentBankTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/ConcurrentBankTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- ConcurrentBankTest.java	5 May 2006 12:06:59 -0000	1.3
  +++ ConcurrentBankTest.java	20 Jul 2006 09:03:55 -0000	1.4
  @@ -27,7 +27,7 @@
    *
    * @author <a href="mailto:spohl at users.sourceforge.net">Stefan Pohl</a>
    * @author Ben Wang
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    *
    */
   public class ConcurrentBankTest extends TestCase {
  @@ -69,7 +69,7 @@
         config.configure(cache, "META-INF/local-lru-eviction-service.xml");
   
         // XML file above only sets REPEATABLE-READ
  -      cache.setIsolationLevel(IsolationLevel.SERIALIZABLE);
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
   
         cache.createService();
         cache.startService();
  
  
  
  1.3       +6 -5      JBossCache/tests/functional/org/jboss/cache/transaction/InvocationContextCleanupTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InvocationContextCleanupTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/InvocationContextCleanupTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- InvocationContextCleanupTest.java	2 May 2006 15:49:57 -0000	1.2
  +++ InvocationContextCleanupTest.java	20 Jul 2006 09:03:55 -0000	1.3
  @@ -8,6 +8,7 @@
   
   import junit.framework.TestCase;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.Configuration;
   import org.jboss.cache.interceptors.OrderedSynchronizationHandler;
   import org.jboss.cache.misc.TestingUtil;
   
  @@ -28,11 +29,11 @@
       private TreeCache createCache(boolean optimistic) throws Exception
       {
           TreeCache cache = new TreeCache();
  -        cache.setCacheMode(TreeCache.REPL_SYNC);
  -        if (optimistic) cache.setNodeLockingScheme("OPTIMISTIC");
  -        cache.setClusterName("InvocationContextCleanupTest");
  -        cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -        cache.setLockAcquisitionTimeout(2000);
  +        cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
  +        if (optimistic) cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
  +        cache.getConfiguration().setClusterName("InvocationContextCleanupTest");
  +        cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +        cache.getConfiguration().setLockAcquisitionTimeout(2000);
           cache.startService();
           return cache;
       }
  
  
  
  1.2       +2 -3      JBossCache/tests/functional/org/jboss/cache/transaction/PrepareTxTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PrepareTxTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/PrepareTxTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- PrepareTxTest.java	8 Jul 2005 05:58:10 -0000	1.1
  +++ PrepareTxTest.java	20 Jul 2006 09:03:55 -0000	1.2
  @@ -6,7 +6,6 @@
   import org.jboss.cache.CacheException;
   import org.jboss.cache.TransactionTable;
   import org.jboss.cache.TreeCache;
  -import org.jboss.cache.transaction.DummyTransactionManager;
   
   import javax.transaction.NotSupportedException;
   import javax.transaction.Synchronization;
  @@ -24,8 +23,8 @@
      protected void setUp() throws Exception {
         super.setUp();
         cache=new TreeCache();
  -      cache.setCacheMode("local");
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setCacheMode("local");
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         cache.createService();
         cache.startService();
      }
  
  
  
  1.10      +6 -5      JBossCache/tests/functional/org/jboss/cache/transaction/TransactionTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TransactionTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/TransactionTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- TransactionTest.java	9 Feb 2006 16:01:45 -0000	1.9
  +++ TransactionTest.java	20 Jul 2006 09:03:55 -0000	1.10
  @@ -27,7 +27,7 @@
    * Tests transactional access to a local TreeCache.
    * Note: we use DummpyTranasctionManager to replace jta
    *
  - * @version $Id: TransactionTest.java,v 1.9 2006/02/09 16:01:45 bela Exp $
  + * @version $Id: TransactionTest.java,v 1.10 2006/07/20 09:03:55 msurtani Exp $
    */
   public class TransactionTest extends TestCase {
      TreeCache cache=null;
  @@ -53,9 +53,10 @@
         }
   
         tx=(UserTransaction)new InitialContext(p).lookup("UserTransaction");
  -      cache=new TreeCache("test", null, 10000);
  -      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -      cache.setIsolationLevel(IsolationLevel.SERIALIZABLE);
  +      cache.getConfiguration().setClusterName("test");
  +      cache.getConfiguration().setInitialStateRetrievalTimeout(10000);
  +      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
         cache.createService();
         cache.startService();
         thread_ex=null;
  @@ -606,7 +607,7 @@
   
   
      public void testConcurrentReadAndWriteAccess() throws Exception {
  -      cache.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
  +      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
   
         cache.put("/1/2/3/4", "foo", "bar"); // no TX, no locks held after put() returns
   
  
  
  



More information about the jboss-cvs-commits mailing list