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

Manik Surtani manik at jboss.org
Fri Jun 8 06:49:28 EDT 2007


  User: msurtani
  Date: 07/06/08 06:49:28

  Modified:    tests/functional/org/jboss/cache/loader 
                        BdbjeCacheLoaderTest.java
  Log:
  Added to the test
  
  Revision  Changes    Path
  1.21      +22 -1     JBossCache/tests/functional/org/jboss/cache/loader/BdbjeCacheLoaderTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BdbjeCacheLoaderTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/BdbjeCacheLoaderTest.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- BdbjeCacheLoaderTest.java	23 May 2007 10:28:54 -0000	1.20
  +++ BdbjeCacheLoaderTest.java	8 Jun 2007 10:49:28 -0000	1.21
  @@ -2,13 +2,14 @@
   
   import junit.framework.Test;
   import junit.framework.TestSuite;
  +import org.jboss.cache.Fqn;
   import org.jboss.cache.misc.TestingUtil;
   
   /**
    * Runs the same tests as {@link FileCacheLoaderTest}, but with Berkeley DB instead of a file-based CacheLoader
    *
    * @author Bela Ban
  - * @version $Id: BdbjeCacheLoaderTest.java,v 1.20 2007/05/23 10:28:54 msurtani Exp $
  + * @version $Id: BdbjeCacheLoaderTest.java,v 1.21 2007/06/08 10:49:28 msurtani Exp $
    */
   public class BdbjeCacheLoaderTest extends CacheLoaderTestsBase
   {
  @@ -21,6 +22,26 @@
         TestingUtil.recursiveFileRemove(tmpCLLoc);
      }
   
  +   public void testTransaction() throws Exception
  +   {
  +      // to help recreate the issue in
  +      // http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048003#4048003
  +
  +      Fqn fqn = Fqn.fromString("/a/b/c");
  +      String key = "key", value = "value";
  +
  +      cache.put(fqn, key, value);
  +      cache.getTransactionManager().begin();
  +      assertEquals(value, cache.get(fqn, key));
  +      cache.getTransactionManager().commit();
  +
  +      // now repeat this.
  +
  +      cache.getTransactionManager().begin();
  +      assertEquals(value, cache.get(fqn, key));
  +      cache.getTransactionManager().commit();
  +   }
  +
      public static Test suite()
      {
         return new TestSuite(BdbjeCacheLoaderTest.class);
  
  
  



More information about the jboss-cvs-commits mailing list