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

Brian Stansberry brian.stansberry at jboss.com
Tue Nov 21 23:02:51 EST 2006


  User: bstansberry
  Date: 06/11/21 23:02:51

  Modified:    tests/functional/org/jboss/cache/transaction  Tag:
                        Branch_JBossCache_1_4_0
                        IsolationLevelReadCommittedTest.java
  Log:
  We get a TimeoutException if test passes; don't fail because of it :)
  Make sure this works if the reader thread wants an Fqn below the removed node
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.4.2   +9 -2      JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelReadCommittedTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: IsolationLevelReadCommittedTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/transaction/IsolationLevelReadCommittedTest.java,v
  retrieving revision 1.5.4.1
  retrieving revision 1.5.4.2
  diff -u -b -r1.5.4.1 -r1.5.4.2
  --- IsolationLevelReadCommittedTest.java	21 Nov 2006 23:29:51 -0000	1.5.4.1
  +++ IsolationLevelReadCommittedTest.java	22 Nov 2006 04:02:51 -0000	1.5.4.2
  @@ -11,6 +11,7 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
   import org.jboss.cache.lock.IsolationLevel;
  +import org.jboss.cache.lock.TimeoutException;
   
   import javax.transaction.NotSupportedException;
   import javax.transaction.SystemException;
  @@ -23,7 +24,7 @@
    *
    * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
    *
  - * @version $Id: IsolationLevelReadCommittedTest.java,v 1.5.4.1 2006/11/21 23:29:51 bstansberry Exp $
  + * @version $Id: IsolationLevelReadCommittedTest.java,v 1.5.4.2 2006/11/22 04:02:51 bstansberry Exp $
    */
   
   public class IsolationLevelReadCommittedTest extends TestCase
  @@ -31,6 +32,7 @@
   
      private TreeCache cache = null;
      private final Fqn FQN = Fqn.fromString("/a/b/c");
  +   private final Fqn PARENT_FQN = Fqn.fromString("/a/b");
      private final String KEY = "key";
      private final String VALUE = "value";
   
  @@ -53,6 +55,7 @@
         cache.setCacheMode(TreeCache.LOCAL);
         cache.setIsolationLevel(IsolationLevel.READ_COMMITTED);
         cache.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
  +      cache.setLockAcquisitionTimeout(1000);
         cache.startService();
      }
   
  @@ -237,7 +240,7 @@
                  Transaction tx = startTransaction();
   
                  // change VALUE in a transaction
  -               cache.remove(FQN);
  +               cache.remove(PARENT_FQN);
   
                  // notify the reading thread
                  readerCanRead.release();
  @@ -275,6 +278,10 @@
            assertEquals("2nd thread cannot see uncommitted changes",
                          VALUE, cache.get(FQN, KEY));
         }
  +      catch (TimeoutException t)
  +      {
  +         // ignore, this is good
  +      }
         finally
         {               
            System.out.println("reader thread exits");
  
  
  



More information about the jboss-cvs-commits mailing list