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

Galder Zamarreno galder.zamarreno at jboss.com
Wed Feb 28 05:58:42 EST 2007


  User: gzamarreno
  Date: 07/02/28 05:58:42

  Modified:    tests/functional/org/jboss/cache/optimistic   Tag:
                        Branch_JBossCache_1_4_0 CacheTest.java
  Removed:     tests/functional/org/jboss/cache/optimistic   Tag:
                        Branch_JBossCache_1_4_0 RemoveAfterPutTest.java
  Log:
  [JBCACHE-927] Fix backported to the 1.4.x branch
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.17.2.2  +30 -0     JBossCache/tests/functional/org/jboss/cache/optimistic/CacheTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/CacheTest.java,v
  retrieving revision 1.17.2.1
  retrieving revision 1.17.2.2
  diff -u -b -r1.17.2.1 -r1.17.2.2
  --- CacheTest.java	11 Nov 2006 17:50:03 -0000	1.17.2.1
  +++ CacheTest.java	28 Feb 2007 10:58:42 -0000	1.17.2.2
  @@ -34,6 +34,12 @@
   import java.io.ObjectOutput;
   import java.util.List;
   
  +/**
  + * Tests cache operations on optimistic cache
  + *
  + * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
  + * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  + */
   public class CacheTest extends AbstractOptimisticTestCase
   {
       Log log = LogFactory.getLog(CacheTest.class);
  @@ -520,4 +526,28 @@
   
           Assert.assertTrue("Concurrent mod should result in a rollback", ok);
       }
  +
  +    public void testRemoveAndCreate() throws Exception
  +    {
  +        TreeCache cache = createCache();
  +        TransactionManager tm = cache.getTransactionManager();
  +        Fqn f = Fqn.fromString("/person/test");
  +        Fqn f1 = new Fqn(f, "1");
  +        Fqn f2 = new Fqn(f, "2");
  +       
  +        tm.begin();
  +        cache.put(f1, "test", "test");
  +        cache.put(f2, "test", "test");
  +        tm.commit();
  +
  +        assertEquals(2, cache.get(f).getChildren().size());
  +
  +        tm.begin();
  +        cache.remove(f1);
  +        cache.put(f1, "test2", "test2");
  +        tm.commit();
  +
  +        assertEquals("test2", cache.get(f1, "test2"));
  +        assertEquals(2, cache.get(f).getChildren().size());
  +    }
   }
  
  
  



More information about the jboss-cvs-commits mailing list