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

Manik Surtani msurtani at jboss.com
Sat Nov 11 13:53:51 EST 2006


  User: msurtani
  Date: 06/11/11 13:53:51

  Modified:    tests/functional/org/jboss/cache/optimistic  Tag:
                        Branch_JBossCache_1_4_0 VersioningOnReadTest.java
  Log:
  JBCACHE-842
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +61 -0     JBossCache/tests/functional/org/jboss/cache/optimistic/Attic/VersioningOnReadTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: VersioningOnReadTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/Attic/VersioningOnReadTest.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -b -r1.1.2.1 -r1.1.2.2
  --- VersioningOnReadTest.java	11 Nov 2006 18:01:03 -0000	1.1.2.1
  +++ VersioningOnReadTest.java	11 Nov 2006 18:53:51 -0000	1.1.2.2
  @@ -63,6 +63,67 @@
         }
      }
   
  +   public void testUpdateOnRemove() throws Exception
  +   {
  +      cache.put(fqn, "k", "v");
  +
  +      assertEquals("v", cache.get(fqn, "k"));
  +
  +      // now start a tx to mod the node
  +      tm.begin();
  +      cache.remove(fqn, "k");
  +
  +      // suspend the tx
  +      Transaction tx = tm.suspend();
  +
  +      // now modify the node
  +      cache.put(fqn, "k", "v3");
  +
  +      // resume the tx
  +      tm.resume(tx);
  +
  +      try
  +      {
  +         tm.commit();
  +         fail("Should have failed with a data version mismatch");
  +      }
  +      catch (Exception e)
  +      {
  +         // do nothing
  +      }
  +   }
  +
  +   public void testUpdateOnRemoveNode() throws Exception
  +   {
  +      cache.put(fqn, "k", "v");
  +
  +      assertEquals("v", cache.get(fqn, "k"));
  +
  +      // now start a tx to mod the node
  +      tm.begin();
  +      cache.remove(fqn);
  +
  +      // suspend the tx
  +      Transaction tx = tm.suspend();
  +
  +      // now modify the node
  +      cache.put(fqn, "k", "v3");
  +
  +      // resume the tx
  +      tm.resume(tx);
  +
  +      try
  +      {
  +         tm.commit();
  +         fail("Should have failed with a data version mismatch");
  +      }
  +      catch (Exception e)
  +      {
  +         // do nothing
  +      }
  +   }
  +
  +
      public void testUpdateOnRead() throws Exception
      {
         cache.put(fqn, "k", "v");
  
  
  



More information about the jboss-cvs-commits mailing list