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

Manik Surtani msurtani at jboss.com
Sat Dec 30 12:49:53 EST 2006


  User: msurtani
  Date: 06/12/30 12:49:53

  Modified:    tests/functional/org/jboss/cache/transaction              
                        TransactionTest.java
                        IsolationLevelRepeatableReadTest.java
                        AbortionTest.java InvocationContextCleanupTest.java
                        ReplicatedTransactionDeadlockTest.java
                        IsolationLevelReadCommittedTest.java
                        IsolationLevelReadCommittedNodeCreationRollbackTest.java
                        PrepareTxTest.java ConcurrentTransactionalTest.java
                        SuspendTxTest.java
                        IsolationLevelSerializableTest.java
                        DeadlockTest.java ConcurrentBankTest.java
                        IsolationLevelNoneTest.java
  Log:
  Major changes to restructure cache and node object model
  
  Revision  Changes    Path
  1.20      +14 -15    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.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- TransactionTest.java	14 Dec 2006 17:18:48 -0000	1.19
  +++ TransactionTest.java	30 Dec 2006 17:49:53 -0000	1.20
  @@ -12,13 +12,12 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.jboss.cache.CacheException;
  -import org.jboss.cache.DataNode;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.GlobalTransaction;
  -import org.jboss.cache.NodeImpl;
  -import org.jboss.cache.TreeCache;
  -import org.jboss.cache.lock.IdentityLock;
  +import org.jboss.cache.Node;
   import org.jboss.cache.lock.IsolationLevel;
  +import org.jboss.cache.lock.NodeLock;
   
   import javax.naming.Context;
   import javax.naming.InitialContext;
  @@ -35,14 +34,14 @@
   import java.util.Set;
   
   /**
  - * Tests transactional access to a local TreeCache.
  + * Tests transactional access to a local CacheImpl.
    * Note: we use DummpyTranasctionManager to replace jta
    *
  - * @version $Id: TransactionTest.java,v 1.19 2006/12/14 17:18:48 msurtani Exp $
  + * @version $Id: TransactionTest.java,v 1.20 2006/12/30 17:49:53 msurtani Exp $
    */
   public class TransactionTest extends TestCase
   {
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
      UserTransaction tx = null;
      Properties p = null;
      String old_factory = null;
  @@ -68,7 +67,7 @@
         }
   
         tx = (UserTransaction) new InitialContext(p).lookup("UserTransaction");
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setClusterName("test");
         cache.getConfiguration().setInitialStateRetrievalTimeout(10000);
         cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  @@ -545,22 +544,22 @@
         cache.put("/a/b/c", null);
         cache.put("/a/b/c", null);
   
  -      NodeImpl n = cache.get("/a");
  -      IdentityLock lock = n.getLock();
  +      Node n = cache.get("/a");
  +      NodeLock lock = n.getNodeSPI().getLock();
         int num = lock.getReaderOwners().size();
         assertEquals(0, num);
         // make sure this is write locked.
         assertLocked(gtx, "/a", true);
   
         n = cache.get("/a/b");
  -      lock = n.getLock();
  +      lock = n.getNodeSPI().getLock();
         num = lock.getReaderOwners().size();
         assertEquals(0, num);
         // make sure this is write locked.
         assertLocked(gtx, "/a/b", true);
   
         n = cache.get("/a/b/c");
  -      lock = n.getLock();
  +      lock = n.getNodeSPI().getLock();
         num = lock.getReaderOwners().size();
         assertEquals(0, num);
         // make sure this is write locked.
  @@ -572,8 +571,8 @@
   
      private void assertLocked(Object owner, String fqn, boolean write_locked) throws Exception
      {
  -      NodeImpl n = (NodeImpl) cache.peek(Fqn.fromString(fqn));
  -      IdentityLock lock = n.getLock();
  +      Node n = cache.peek(Fqn.fromString(fqn));
  +      NodeLock lock = n.getNodeSPI().getLock();
         if (owner == null)
         {
            owner = Thread.currentThread();
  @@ -799,7 +798,7 @@
            cache.put("/bela/ban", m);
            tx.rollback();
   
  -         DataNode n = cache.get("/bela/ban");
  +         Node n = cache.get("/bela/ban");
            if (n.getData() == null) return;
            assertEquals("map should be empty", 0, n.getData().size());
         }
  
  
  
  1.3       +4 -4      JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelRepeatableReadTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: IsolationLevelRepeatableReadTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelRepeatableReadTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- IsolationLevelRepeatableReadTest.java	14 Dec 2006 14:38:59 -0000	1.2
  +++ IsolationLevelRepeatableReadTest.java	30 Dec 2006 17:49:53 -0000	1.3
  @@ -5,9 +5,9 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.DummyTransactionManagerLookup;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.TimeoutException;
   
  @@ -19,13 +19,13 @@
    * Tests READ_COMMITED isolation level.
    *
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  - * @version $Id: IsolationLevelRepeatableReadTest.java,v 1.2 2006/12/14 14:38:59 msurtani Exp $
  + * @version $Id: IsolationLevelRepeatableReadTest.java,v 1.3 2006/12/30 17:49:53 msurtani Exp $
    */
   
   public class IsolationLevelRepeatableReadTest extends TestCase
   {
   
  -   private TreeCache cache = null;
  +   private CacheImpl cache = null;
      private final Fqn FQN = Fqn.fromString("/a");
      private final String KEY = "key";
      private final String VALUE = "value";
  @@ -40,7 +40,7 @@
         writerFailed = false;
         writerError = null;
   
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setCacheMode("LOCAL");
         cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
         cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
  
  
  
  1.5       +2 -2      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.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- AbortionTest.java	6 Sep 2006 15:31:00 -0000	1.4
  +++ AbortionTest.java	30 Dec 2006 17:49:53 -0000	1.5
  @@ -7,7 +7,7 @@
   package org.jboss.cache.transaction;
   
   import junit.framework.TestCase;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.interceptors.OrderedSynchronizationHandler;
   import org.jboss.cache.misc.TestingUtil;
   import org.jgroups.JChannel;
  @@ -206,7 +206,7 @@
      }
   
   
  -   public static class MyTC extends TreeCache
  +   public static class MyTC extends CacheImpl
      {
         JChannel myChannel;
         RpcDispatcher myDispatcher;
  
  
  
  1.5       +7 -7      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.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- InvocationContextCleanupTest.java	6 Sep 2006 15:31:00 -0000	1.4
  +++ InvocationContextCleanupTest.java	30 Dec 2006 17:49:53 -0000	1.5
  @@ -7,7 +7,7 @@
   package org.jboss.cache.transaction;
   
   import junit.framework.TestCase;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.interceptors.OrderedSynchronizationHandler;
   import org.jboss.cache.misc.TestingUtil;
  @@ -24,11 +24,11 @@
    */
   public class InvocationContextCleanupTest extends TestCase
   {
  -   private TreeCache[] caches;
  +   private CacheImpl[] caches;
   
  -   private TreeCache createCache(boolean optimistic) throws Exception
  +   private CacheImpl createCache(boolean optimistic) throws Exception
      {
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
         if (optimistic) cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
         cache.getConfiguration().setClusterName("InvocationContextCleanupTest");
  @@ -61,7 +61,7 @@
   
      private void test2CachesSync(boolean optimistic) throws Exception
      {
  -      caches = new TreeCache[2];
  +      caches = new CacheImpl[2];
         caches[0] = createCache(optimistic);
         caches[1] = createCache(optimistic);
   
  @@ -91,10 +91,10 @@
   
      public static class DummySynchronization implements Synchronization
      {
  -      private TreeCache cache;
  +      private CacheImpl cache;
         private TransactionManager mgr;
   
  -      public DummySynchronization(TreeCache cache, TransactionManager mgr)
  +      public DummySynchronization(CacheImpl cache, TransactionManager mgr)
         {
            this.cache = cache;
            this.mgr = mgr;
  
  
  
  1.6       +7 -7      JBossCache/tests/functional/org/jboss/cache/transaction/ReplicatedTransactionDeadlockTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ReplicatedTransactionDeadlockTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/ReplicatedTransactionDeadlockTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ReplicatedTransactionDeadlockTest.java	12 Sep 2006 11:49:00 -0000	1.5
  +++ ReplicatedTransactionDeadlockTest.java	30 Dec 2006 17:49:53 -0000	1.6
  @@ -5,8 +5,8 @@
   import junit.framework.TestSuite;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.factories.XmlConfigurationParser;
   
  @@ -57,7 +57,7 @@
    *
    * @author Marian Nikolov
    * @author $Author: msurtani $
  - * @version $Date: 2006/09/12 11:49:00 $
  + * @version $Date: 2006/12/30 17:49:53 $
    */
   public class ReplicatedTransactionDeadlockTest extends TestCase
   {
  @@ -93,11 +93,11 @@
      /**
       * The source cache where we put modifications.
       */
  -   private TreeCache srcCache = null;
  +   private CacheImpl srcCache = null;
      /**
       * The target cache where we replicate modifications.
       */
  -   private TreeCache dstCache = null;
  +   private CacheImpl dstCache = null;
   
      private Log log = LogFactory.getLog(ReplicatedTransactionDeadlockTest.class);
   
  @@ -129,7 +129,7 @@
         System.setProperty(Context.INITIAL_CONTEXT_FACTORY, CONTEXT_FACTORY);
         DummyTransactionManager.getInstance();
         // setup and start the source cache
  -      srcCache = new TreeCache();
  +      srcCache = new CacheImpl();
         srcCache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replSync-service.xml"));
         srcCache.getConfiguration().setTransactionManagerLookupClass(
                 "org.jboss.cache.DummyTransactionManagerLookup");
  @@ -140,7 +140,7 @@
         srcCache.create();
         srcCache.start();
         // setup and start the destination cache
  -      dstCache = new TreeCache();
  +      dstCache = new CacheImpl();
         dstCache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replSync-service.xml"));
         dstCache.getConfiguration().setTransactionManagerLookupClass(
                 "org.jboss.cache.DummyTransactionManagerLookup");
  @@ -227,7 +227,7 @@
       *
       * @author Marian Nikolov
       * @author $Author: msurtani $
  -    * @version $Date: 2006/09/12 11:49:00 $
  +    * @version $Date: 2006/12/30 17:49:53 $
       */
      private class Worker extends Thread
      {
  
  
  
  1.12      +3 -2      JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelReadCommittedTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: IsolationLevelReadCommittedTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelReadCommittedTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- IsolationLevelReadCommittedTest.java	14 Dec 2006 17:52:29 -0000	1.11
  +++ IsolationLevelReadCommittedTest.java	30 Dec 2006 17:49:53 -0000	1.12
  @@ -7,6 +7,7 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.jboss.cache.Cache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.DummyTransactionManagerLookup;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.config.Configuration;
  @@ -24,7 +25,7 @@
    * Tests READ_COMMITED isolation level.
    *
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  - * @version $Id: IsolationLevelReadCommittedTest.java,v 1.11 2006/12/14 17:52:29 msurtani Exp $
  + * @version $Id: IsolationLevelReadCommittedTest.java,v 1.12 2006/12/30 17:49:53 msurtani Exp $
    */
   
   public class IsolationLevelReadCommittedTest extends TestCase
  @@ -297,7 +298,7 @@
         // wait for the writer to finish
         writerDone.acquire();
   
  -      assertNull("Node was removed", cache.get(FQN));
  +      assertNull("Node was removed", ((CacheImpl) cache).get(FQN));
   
         // If any assertion failed, throw on the AssertionFailedError
   
  
  
  
  1.4       +4 -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.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- IsolationLevelReadCommittedNodeCreationRollbackTest.java	6 Sep 2006 15:31:00 -0000	1.3
  +++ IsolationLevelReadCommittedNodeCreationRollbackTest.java	30 Dec 2006 17:49:53 -0000	1.4
  @@ -11,9 +11,9 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   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.lock.TimeoutException;
  @@ -26,13 +26,13 @@
    * Tests READ_COMMITED isolation level.
    *
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  - * @version $Id: IsolationLevelReadCommittedNodeCreationRollbackTest.java,v 1.3 2006/09/06 15:31:00 msurtani Exp $
  + * @version $Id: IsolationLevelReadCommittedNodeCreationRollbackTest.java,v 1.4 2006/12/30 17:49:53 msurtani Exp $
    */
   
   public class IsolationLevelReadCommittedNodeCreationRollbackTest extends TestCase
   {
   
  -   private TreeCache cache = null;
  +   private CacheImpl cache = null;
      private final Fqn FQN = Fqn.fromString("/a/b/c");
      private final String KEY = "key";
      private final String VALUE = "value";
  @@ -52,7 +52,7 @@
         writerError = null;
         readerError = null;
   
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
         cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
  
  
  
  1.5       +3 -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.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- PrepareTxTest.java	14 Dec 2006 17:52:29 -0000	1.4
  +++ PrepareTxTest.java	30 Dec 2006 17:49:53 -0000	1.5
  @@ -4,8 +4,8 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.jboss.cache.CacheException;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.TransactionTable;
  -import org.jboss.cache.TreeCache;
   
   import javax.transaction.NotSupportedException;
   import javax.transaction.Synchronization;
  @@ -19,12 +19,12 @@
    */
   public class PrepareTxTest extends TestCase
   {
  -   TreeCache cache;
  +   CacheImpl cache;
   
      protected void setUp() throws Exception
      {
         super.setUp();
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setCacheMode("local");
         cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         cache.create();
  
  
  
  1.6       +5 -5      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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ConcurrentTransactionalTest.java	6 Sep 2006 15:31:00 -0000	1.5
  +++ ConcurrentTransactionalTest.java	30 Dec 2006 17:49:53 -0000	1.6
  @@ -12,7 +12,7 @@
   import junit.framework.TestSuite;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.lock.IsolationLevel;
  @@ -29,14 +29,14 @@
   import java.util.Set;
   
   /**
  - * Unit test for local TreeCache. Use locking and multiple threads to test
  + * Unit test for local CacheImpl. Use locking and multiple threads to test
    * concurrent access to the tree.
    *
  - * @version $Id: ConcurrentTransactionalTest.java,v 1.5 2006/09/06 15:31:00 msurtani Exp $
  + * @version $Id: ConcurrentTransactionalTest.java,v 1.6 2006/12/30 17:49:53 msurtani Exp $
    */
   public class ConcurrentTransactionalTest extends TestCase
   {
  -   TreeCache cache;
  +   CacheImpl cache;
      private Log logger_ = LogFactory.getLog(ConcurrentTransactionalTest.class);
      static Throwable thread_ex = null;
      final int NUM = 10000;
  @@ -64,7 +64,7 @@
   
      private void createCache(IsolationLevel level) throws Exception
      {
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-service.xml"));
   
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  
  
  
  1.4       +3 -3      JBossCache/tests/functional/org/jboss/cache/transaction/SuspendTxTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SuspendTxTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/SuspendTxTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- SuspendTxTest.java	14 Dec 2006 17:52:29 -0000	1.3
  +++ SuspendTxTest.java	30 Dec 2006 17:49:53 -0000	1.4
  @@ -3,8 +3,8 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   
   import javax.transaction.Transaction;
   import javax.transaction.TransactionManager;
  @@ -17,13 +17,13 @@
    */
   public class SuspendTxTest extends TestCase
   {
  -   TreeCache cache;
  +   CacheImpl cache;
      TransactionManager mgr;
   
      protected void setUp() throws Exception
      {
         super.setUp();
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setCacheMode("local");
         cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         cache.start();
  
  
  
  1.3       +22 -25    JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelSerializableTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: IsolationLevelSerializableTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelSerializableTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- IsolationLevelSerializableTest.java	22 Nov 2006 04:55:44 -0000	1.2
  +++ IsolationLevelSerializableTest.java	30 Dec 2006 17:49:53 -0000	1.3
  @@ -1,17 +1,13 @@
   package org.jboss.cache.transaction;
   
   
  -
  -import javax.transaction.NotSupportedException;
  -import javax.transaction.SystemException;
  -import javax.transaction.Transaction;
  -
  +import EDU.oswego.cs.dl.util.concurrent.Latch;
   import junit.framework.AssertionFailedError;
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -
   import org.jboss.cache.Cache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.DummyTransactionManagerLookup;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.config.Configuration;
  @@ -20,16 +16,16 @@
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.TimeoutException;
   
  -import EDU.oswego.cs.dl.util.concurrent.Latch;
  -
  +import javax.transaction.NotSupportedException;
  +import javax.transaction.SystemException;
  +import javax.transaction.Transaction;
   
   
   /**
    * Tests READ_COMMITED isolation level.
    *
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  - *
  - * @version $Id: IsolationLevelSerializableTest.java,v 1.2 2006/11/22 04:55:44 bstansberry Exp $
  + * @version $Id: IsolationLevelSerializableTest.java,v 1.3 2006/12/30 17:49:53 msurtani Exp $
    */
   
   public class IsolationLevelSerializableTest extends TestCase
  @@ -66,7 +62,7 @@
   
         cache.stop();
         cache.destroy();
  -      cache=null;
  +      cache = null;
      }
      
      /**
  @@ -109,7 +105,7 @@
               {
                  writerError = e;
               }
  -            catch(Throwable t)
  +            catch (Throwable t)
               {
                  t.printStackTrace();
                  writerFailed = true;
  @@ -147,7 +143,7 @@
         // wait for the writer to finish
         writerDone.acquire();
   
  -      assertNull("Node was removed", cache.get(FQN));
  +      assertNull("Node was removed", ((CacheImpl) cache).get(FQN));
   
         // If any assertion failed, throw on the AssertionFailedError
         
  @@ -165,12 +161,13 @@
   
      private Transaction startTransaction() throws SystemException, NotSupportedException
      {
  -      DummyTransactionManager mgr=DummyTransactionManager.getInstance();
  +      DummyTransactionManager mgr = DummyTransactionManager.getInstance();
         mgr.begin();
         return mgr.getTransaction();
      }
   
  -   public static Test suite() {
  +   public static Test suite()
  +   {
   
         return new TestSuite(IsolationLevelSerializableTest.class);
   
  
  
  
  1.8       +5 -5      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.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- DeadlockTest.java	14 Dec 2006 17:52:29 -0000	1.7
  +++ DeadlockTest.java	30 Dec 2006 17:49:53 -0000	1.8
  @@ -14,8 +14,8 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.CacheException;
  +import org.jboss.cache.CacheImpl;
   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;
  @@ -27,14 +27,14 @@
   import javax.transaction.Transaction;
   
   /**
  - * Tests transactional access to a local TreeCache, with concurrent (deadlock-prone) access.
  + * Tests transactional access to a local CacheImpl, with concurrent (deadlock-prone) access.
    * Note: we use DummpyTranasctionManager to replace jta
    *
  - * @version $Id: DeadlockTest.java,v 1.7 2006/12/14 17:52:29 msurtani Exp $
  + * @version $Id: DeadlockTest.java,v 1.8 2006/12/30 17:49:53 msurtani Exp $
    */
   public class DeadlockTest extends TestCase
   {
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
      Exception thread_ex;
   
      final Fqn NODE = Fqn.fromString("/a/b/c");
  @@ -53,7 +53,7 @@
      {
         super.setUp();
         DummyTransactionManager.getInstance();
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setInitialStateRetrievalTimeout(10000);
         cache.getConfiguration().setClusterName("test");
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
  
  
  
  1.7       +7 -7      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.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- ConcurrentBankTest.java	6 Sep 2006 15:31:00 -0000	1.6
  +++ ConcurrentBankTest.java	30 Dec 2006 17:49:53 -0000	1.7
  @@ -6,7 +6,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.CacheException;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.TimeoutException;
  @@ -21,16 +21,16 @@
   import java.util.Set;
   
   /**
  - * Unit test for local TreeCache with concurrent transactions.
  + * Unit test for local CacheImpl with concurrent transactions.
    * Uses locking and multiple threads to test concurrent r/w access to the tree.
    *
    * @author <a href="mailto:spohl at users.sourceforge.net">Stefan Pohl</a>
    * @author Ben Wang
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public class ConcurrentBankTest extends TestCase
   {
  -   TreeCache cache;
  +   CacheImpl cache;
      private static Log logger_ = LogFactory.getLog(ConcurrentBankTest.class);
      static Properties p = null;
      String old_factory = null;
  @@ -64,7 +64,7 @@
            p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
         }
   
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
   
         cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-lru-eviction-service.xml"));
   
  @@ -148,9 +148,9 @@
   
      class Teller extends Thread
      {
  -      TreeCache cache;
  +      CacheImpl cache;
   
  -      public Teller(String str, TreeCache cache)
  +      public Teller(String str, CacheImpl cache)
         {
            super(str);
            this.cache = cache;
  
  
  
  1.6       +6 -6      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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- IsolationLevelNoneTest.java	14 Dec 2006 17:52:29 -0000	1.5
  +++ IsolationLevelNoneTest.java	30 Dec 2006 17:49:53 -0000	1.6
  @@ -3,9 +3,9 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   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;
   
  @@ -17,11 +17,11 @@
    * Tests whether modifications within callbacks (TreeCacheListener) are handled correctly
    *
    * @author Bela Ban
  - * @version $Id: IsolationLevelNoneTest.java,v 1.5 2006/12/14 17:52:29 msurtani Exp $
  + * @version $Id: IsolationLevelNoneTest.java,v 1.6 2006/12/30 17:49:53 msurtani Exp $
    */
   public class IsolationLevelNoneTest extends TestCase
   {
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
      final Fqn FQN = Fqn.fromString("/a/b/c");
      final String KEY = "key";
      final String VALUE = "value";
  @@ -47,7 +47,7 @@
   
      public void testWithoutTransactions() throws Exception
      {
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         cache.getConfiguration().setIsolationLevel(IsolationLevel.NONE);
         cache.start();
  @@ -61,7 +61,7 @@
   
      public void testWithTransactions() throws Exception
      {
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         cache.getConfiguration().setIsolationLevel(IsolationLevel.NONE);
         cache.setTransactionManagerLookup(new DummyTransactionManagerLookup());
  @@ -79,7 +79,7 @@
   
      public void testWithTransactionsRepeatableRead() throws Exception
      {
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
         cache.setTransactionManagerLookup(new DummyTransactionManagerLookup());
  
  
  



More information about the jboss-cvs-commits mailing list