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

Manik Surtani msurtani at belmont.prod.atl2.jboss.com
Wed Aug 30 16:01:58 EDT 2006


  User: msurtani
  Date: 06/08/30 16:01:58

  Modified:    tests/functional/org/jboss/cache/optimistic 
                        ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
  Log:
  Fixed concurrency issues with notifications
  
  Revision  Changes    Path
  1.16      +166 -163  JBossCache/tests/functional/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- ThreadedOptimisticCreateIfNotExistsInterceptorTest.java	18 Aug 2006 15:40:40 -0000	1.15
  +++ ThreadedOptimisticCreateIfNotExistsInterceptorTest.java	30 Aug 2006 20:01:58 -0000	1.16
  @@ -35,7 +35,7 @@
   
       }
   
  -    protected void setTransactionsInInvocationCtx(TransactionManager mgr, TreeCache cache) throws Exception
  +   protected synchronized void setTransactionsInInvocationCtx(TransactionManager mgr, TreeCache cache) throws Exception
       {
           cache.getInvocationContext().setTransaction(mgr.getTransaction());
           cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction());
  @@ -64,6 +64,9 @@
   
           cache.setInterceptorChain(interceptor);
   
  +      // should just be the root node
  +      assertEquals(0, cache.getNumberOfNodes());
  +
           Runnable run = new Runnable()
           {
   
  @@ -180,7 +183,7 @@
           }
           mgr.commit();
   
  -        TestingUtil.sleepThread((long)4000);
  +      TestingUtil.sleepThread((long) 4000);
   
           assertEquals(2, listener.getNodesAdded());
           cache.stopService();
  
  
  



More information about the jboss-cvs-commits mailing list