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

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


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

  Modified:    tests/functional/org/jboss/cache/lock    
                        UpgradeLockTest.java BreakDeadMemberLocksTest.java
                        AcquireAllTest.java LockReleaseTest.java
  Log:
  Major changes to restructure cache and node object model
  
  Revision  Changes    Path
  1.6       +5 -5      JBossCache/tests/functional/org/jboss/cache/lock/UpgradeLockTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: UpgradeLockTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/lock/UpgradeLockTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- UpgradeLockTest.java	18 Dec 2006 12:54:23 -0000	1.5
  +++ UpgradeLockTest.java	30 Dec 2006 17:49:58 -0000	1.6
  @@ -12,7 +12,7 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.apache.commons.logging.Log;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.transaction.DummyTransactionManager;
   
   import javax.naming.Context;
  @@ -24,11 +24,11 @@
    * Tests upgrade locks from read -> write
    *
    * @author Bela Ban
  - * @version $Id: UpgradeLockTest.java,v 1.5 2006/12/18 12:54:23 msurtani Exp $
  + * @version $Id: UpgradeLockTest.java,v 1.6 2006/12/30 17:49:58 msurtani Exp $
    */
   public class UpgradeLockTest extends TestCase
   {
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
      UserTransaction tx = null;
      Log log;
      Properties p = null;
  @@ -87,9 +87,9 @@
         }
      }
   
  -   TreeCache createCache(IsolationLevel level) throws Exception
  +   CacheImpl createCache(IsolationLevel level) throws Exception
      {
  -      TreeCache c = new TreeCache();
  +      CacheImpl c = new CacheImpl();
         c.getConfiguration().setClusterName("test");
         c.getConfiguration().setInitialStateRetrievalTimeout(10000);
         c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup");
  
  
  
  1.4       +12 -12    JBossCache/tests/functional/org/jboss/cache/lock/BreakDeadMemberLocksTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BreakDeadMemberLocksTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/lock/BreakDeadMemberLocksTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- BreakDeadMemberLocksTest.java	6 Sep 2006 15:30:58 -0000	1.3
  +++ BreakDeadMemberLocksTest.java	30 Dec 2006 17:49:58 -0000	1.4
  @@ -23,7 +23,7 @@
   package org.jboss.cache.lock;
   
   import junit.framework.TestCase;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.misc.TestingUtil;
   
  @@ -54,7 +54,7 @@
   
      public void testBreakDeadMemberLocks() throws Exception
      {
  -      TreeCache cacheA = createCache("A");
  +      CacheImpl cacheA = createCache("A");
   
         cacheA.put("/1/A", "1", "A");
         cacheA.put("/1/A", "2", "A");
  @@ -63,10 +63,10 @@
         cacheA.put("/1/A/I", "1", "A");
         cacheA.put("/1/A/I", "2", "A");
   
  -      TreeCache cacheB = createCache("B");
  +      CacheImpl cacheB = createCache("B");
   
         // Pause to give caches time to see each other
  -      TestingUtil.blockUntilViewsReceived(new TreeCache[]{cacheA, cacheB}, 60000);
  +      TestingUtil.blockUntilViewsReceived(new CacheImpl[]{cacheA, cacheB}, 60000);
   
         final TransactionManager tm = cacheB.getTransactionManager();
         tm.begin();
  @@ -135,20 +135,20 @@
         }
      }
   
  -   protected TreeCache createCache(String cacheID) throws Exception
  +   protected CacheImpl createCache(String cacheID) throws Exception
      {
         if (caches.get(cacheID) != null)
            throw new IllegalStateException(cacheID + " already created");
   
  -      TreeCache tree = new TreeCache();
  -      tree.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replSync-service.xml"));
  +      CacheImpl cache = new CacheImpl();
  +      cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replSync-service.xml"));
   
  -      tree.create();
  -      tree.start();
  +      cache.create();
  +      cache.start();
   
  -      caches.put(cacheID, tree);
  +      caches.put(cacheID, cache);
   
  -      return tree;
  +      return cache;
      }
   
      protected void tearDown() throws Exception
  @@ -166,7 +166,7 @@
   
      protected void stopCache(String id)
      {
  -      TreeCache cache = (TreeCache) caches.get(id);
  +      CacheImpl cache = (CacheImpl) caches.get(id);
         if (cache != null)
         {
            try
  
  
  
  1.8       +10 -11    JBossCache/tests/functional/org/jboss/cache/lock/AcquireAllTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AcquireAllTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/lock/AcquireAllTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- AcquireAllTest.java	20 Nov 2006 03:53:56 -0000	1.7
  +++ AcquireAllTest.java	30 Dec 2006 17:49:58 -0000	1.8
  @@ -3,11 +3,10 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -import org.jboss.cache.DataNode;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Node;
  -import org.jboss.cache.NodeImpl;
  -import org.jboss.cache.TreeCache;
  +import org.jboss.cache.NodeSPI;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.transaction.DummyTransactionManager;
   
  @@ -15,11 +14,11 @@
   
   /**
    * @author Bela Ban
  - * @version $Id: AcquireAllTest.java,v 1.7 2006/11/20 03:53:56 genman Exp $
  + * @version $Id: AcquireAllTest.java,v 1.8 2006/12/30 17:49:58 msurtani Exp $
    */
   public class AcquireAllTest extends TestCase
   {
  -   TreeCache cache = null, cache2;
  +   CacheImpl cache = null, cache2;
      Transaction tx = null;
      final Fqn FQN = Fqn.fromString("/myNode");
      final String KEY = "key";
  @@ -50,15 +49,15 @@
   
      public void testAcquireAll() throws Exception
      {
  -      NodeImpl root;
  +      NodeSPI root;
         Object owner = Thread.currentThread();
   
         cache = createCache(Configuration.CacheMode.LOCAL, IsolationLevel.SERIALIZABLE);
         cache.put("/a/b/c", null);
         cache.put("/1/2/3", null);
   
  -      root = (NodeImpl)cache.getRoot();
  -      NodeLock lock = root.getNodeSPI().getLock();
  +      root = cache.getRoot().getNodeSPI();
  +      NodeLock lock = root.getLock();
   
         lock.acquireAll(owner, 2000, NodeLock.LockType.READ);
         lock.releaseAll(owner);
  @@ -74,7 +73,7 @@
   
      public void testAcquireAllReplicated() throws Exception
      {
  -      DataNode root;
  +      Node root;
         Object owner = Thread.currentThread();
   
         cache2 = createCache(Configuration.CacheMode.REPL_ASYNC, IsolationLevel.SERIALIZABLE);
  @@ -97,9 +96,9 @@
      }
   
   
  -   TreeCache createCache(Configuration.CacheMode mode, IsolationLevel level) throws Exception
  +   CacheImpl createCache(Configuration.CacheMode mode, IsolationLevel level) throws Exception
      {
  -      TreeCache c = new TreeCache();
  +      CacheImpl c = new CacheImpl();
         c.getConfiguration().setCacheMode(mode);
         c.getConfiguration().setIsolationLevel(level);
         c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  
  
  
  1.6       +5 -5      JBossCache/tests/functional/org/jboss/cache/lock/LockReleaseTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LockReleaseTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/lock/LockReleaseTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- LockReleaseTest.java	18 Dec 2006 12:54:23 -0000	1.5
  +++ LockReleaseTest.java	30 Dec 2006 17:49:58 -0000	1.6
  @@ -12,8 +12,8 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.apache.commons.logging.Log;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.transaction.DummyTransactionManager;
   
   import javax.naming.Context;
  @@ -26,11 +26,11 @@
    * Verifies that there are no read locks held when a transaction ends.
    *
    * @author Bela Ban
  - * @version $Id: LockReleaseTest.java,v 1.5 2006/12/18 12:54:23 msurtani Exp $
  + * @version $Id: LockReleaseTest.java,v 1.6 2006/12/30 17:49:58 msurtani Exp $
    */
   public class LockReleaseTest extends TestCase
   {
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
      UserTransaction tx = null;
      Log log;
      Properties p = null;
  @@ -89,9 +89,9 @@
         }
      }
   
  -   TreeCache createCache(IsolationLevel level) throws Exception
  +   CacheImpl createCache(IsolationLevel level) throws Exception
      {
  -      TreeCache c = new TreeCache();
  +      CacheImpl c = new CacheImpl();
         c.getConfiguration().setClusterName("test");
         c.getConfiguration().setInitialStateRetrievalTimeout(10000);
         c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup");
  
  
  



More information about the jboss-cvs-commits mailing list