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

Manik Surtani msurtani at jboss.com
Mon Mar 5 14:15:56 EST 2007


  User: msurtani
  Date: 07/03/05 14:15:56

  Modified:    tests/functional/org/jboss/cache/transaction 
                        TransactionTest.java
  Log:
  JBCACHE-999
  
  Revision  Changes    Path
  1.29      +79 -1     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.28
  retrieving revision 1.29
  diff -u -b -r1.28 -r1.29
  --- TransactionTest.java	9 Feb 2007 13:47:14 -0000	1.28
  +++ TransactionTest.java	5 Mar 2007 19:15:56 -0000	1.29
  @@ -38,7 +38,7 @@
    * Tests transactional access to a local CacheImpl.
    * Note: we use DummpyTranasctionManager to replace jta
    *
  - * @version $Id: TransactionTest.java,v 1.28 2007/02/09 13:47:14 msurtani Exp $
  + * @version $Id: TransactionTest.java,v 1.29 2007/03/05 19:15:56 msurtani Exp $
    */
   public class TransactionTest extends TestCase
   {
  @@ -1068,6 +1068,84 @@
      }
   
   
  +   public void testRootNodeRemoval() throws Exception
  +   {
  +      Fqn root = Fqn.ROOT;
  +      Fqn fqn = new Fqn(root, 1);
  +      //put first time
  +      tx.begin();
  +      this.cache.put(fqn, "k", "v");
  +      tx.commit();
  +
  +      //get works fine
  +      tx.begin();
  +      assertEquals("v", this.cache.get(fqn, "k"));
  +      tx.commit();
  +
  +      //remove all
  +      tx.begin();
  +      this.cache.remove(root);
  +      tx.commit();
  +
  +      //get returns null - ok
  +      //put - endless loop
  +      tx.begin();
  +      assertNull(this.cache.get(fqn, "k"));
  +      this.cache.put(fqn, "k", "v");
  +      tx.commit();
  +   }
  +
  +   public void testNodeAdditionAfterRemoval() throws Exception
  +   {
  +      Fqn fqn = Fqn.fromString("/1/2/3/4");
  +      //put first time
  +      tx.begin();
  +      this.cache.put(fqn, "k", "v");
  +      tx.commit();
  +
  +      //get works fine
  +      tx.begin();
  +      assertEquals("v", this.cache.get(fqn, "k"));
  +      tx.commit();
  +
  +      //remove all
  +      tx.begin();
  +      this.cache.remove(Fqn.ROOT);
  +      tx.commit();
  +
  +      //get returns null - ok
  +      //put - endless loop
  +      tx.begin();
  +      assertNull(this.cache.get(fqn, "k"));
  +      this.cache.put(fqn, "k", "v");
  +      tx.commit();
  +   }
  +
  +
  +   public void testRootNodeRemovalRollback() throws Exception
  +   {
  +
  +      Fqn root = Fqn.ROOT;
  +      Fqn fqn = new Fqn(root, 1);
  +      //put first time
  +      tx.begin();
  +      this.cache.put(fqn, "k", "v");
  +      tx.commit();
  +
  +      //get works fine
  +      tx.begin();
  +      assertEquals("v", this.cache.get(fqn, "k"));
  +      tx.commit();
  +
  +      //remove all
  +      tx.begin();
  +      this.cache.remove(root);
  +      tx.rollback();
  +
  +      assertEquals("v", this.cache.get(fqn, "k"));
  +   }
  +
  +
      /*  public void testConcurrentReadAccess() throws Exception {
            cache.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
            cache.setUseMbean(false);
  
  
  



More information about the jboss-cvs-commits mailing list