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

Manik Surtani manik at jboss.org
Fri Jun 15 08:54:09 EDT 2007


  User: msurtani
  Date: 07/06/15 08:54:09

  Modified:    tests/functional/org/jboss/cache/optimistic 
                        NodeInterceptorRemoveNodeTest.java
  Log:
  Patched more tests to deal with async notifications
  
  Revision  Changes    Path
  1.21      +6 -1      JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeInterceptorRemoveNodeTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- NodeInterceptorRemoveNodeTest.java	22 May 2007 11:43:35 -0000	1.20
  +++ NodeInterceptorRemoveNodeTest.java	15 Jun 2007 12:54:09 -0000	1.21
  @@ -13,6 +13,7 @@
   import org.jboss.cache.interceptors.CallInterceptor;
   import org.jboss.cache.interceptors.Interceptor;
   import org.jboss.cache.loader.SamplePojo;
  +import org.jboss.cache.misc.TestingUtil;
   import org.jboss.cache.transaction.GlobalTransaction;
   import org.jboss.cache.transaction.OptimisticTransactionEntry;
   import org.jboss.cache.transaction.TransactionTable;
  @@ -31,6 +32,7 @@
      private TestListener listener;
      private MockInterceptor dummy;
      private TransactionManager mgr;
  +   private static final int LISTENER_WAIT_TIME = 200; // needed since notifications are delivered asynchronously
   
      /**
       * @param name
  @@ -99,7 +101,7 @@
         assertEquals(1, entry.getModifications().size());
         assertTrue(!cache.exists("/one/two"));
         assertEquals(null, dummy.getCalled());
  -
  +      TestingUtil.sleepThread(LISTENER_WAIT_TIME);
         assertEquals(0, listener.getNodesAdded());
      }
   
  @@ -312,6 +314,7 @@
   
         assertEquals(3, entry.getModifications().size());
         assertEquals(null, dummy.getCalled());
  +      TestingUtil.sleepThread(LISTENER_WAIT_TIME);
         assertEquals(4, listener.getNodesAdded());
      }
   
  @@ -381,6 +384,7 @@
         assertEquals(3, entry.getModifications().size());
         assertTrue(!cache.exists("/one/two"));
         assertEquals(null, dummy.getCalled());
  +      TestingUtil.sleepThread(LISTENER_WAIT_TIME);
         assertEquals(3, listener.getNodesAdded());
      }
   
  @@ -434,6 +438,7 @@
         assertEquals(2, entry.getModifications().size());
         assertTrue(!cache.exists("/one/two"));
         assertEquals(null, dummy.getCalled());
  +      TestingUtil.sleepThread(LISTENER_WAIT_TIME);
         assertEquals(2, listener.getNodesAdded());
      }
   }
  
  
  



More information about the jboss-cvs-commits mailing list