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

Brian Stansberry brian.stansberry at jboss.com
Fri Nov 3 23:29:58 EST 2006


  User: bstansberry
  Date: 06/11/03 23:29:58

  Modified:    tests/functional/org/jboss/cache/replicated   Tag:
                        Branch_JBossCache_1_4_0 SyncReplTxTest.java
                        AsyncReplTest.java
  Log:
  Add hooks for testing with multiplexer.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.2   +33 -1     JBossCache/tests/functional/org/jboss/cache/replicated/SyncReplTxTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SyncReplTxTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/replicated/SyncReplTxTest.java,v
  retrieving revision 1.9.2.1
  retrieving revision 1.9.2.2
  diff -u -b -r1.9.2.1 -r1.9.2.2
  --- SyncReplTxTest.java	3 Jul 2006 13:19:51 -0000	1.9.2.1
  +++ SyncReplTxTest.java	4 Nov 2006 04:29:58 -0000	1.9.2.2
  @@ -17,6 +17,7 @@
   import org.jboss.cache.CacheException;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.TreeCacheMBean;
   import org.jboss.cache.aop.AOPInstance;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.transaction.DummyTransactionManager;
  @@ -29,7 +30,7 @@
    * Note: we use DummyTransactionManager for Tx purpose instead of relying on
    * jta.
    *
  - * @version $Revision: 1.9.2.1 $
  + * @version $Revision: 1.9.2.2 $
    */
   public class SyncReplTxTest extends TestCase {
       private static Log log = LogFactory.getLog(SyncReplTxTest.class);
  @@ -107,8 +108,39 @@
   */
         cache1.setLockAcquisitionTimeout(5000);
         cache2.setLockAcquisitionTimeout(5000);
  +      
  +      configureMultiplexer(cache1);      
  +      configureMultiplexer(cache2);
  +      
         cache1.start();
         cache2.start();
  +      
  +      validateMultiplexer(cache1);
  +      validateMultiplexer(cache2);
  +   }
  +   
  +   /**
  +    * Provides a hook for multiplexer integration. This default implementation
  +    * is a no-op; subclasses that test mux integration would override
  +    * to integrate the given cache with a multiplexer.
  +    *
  +    * param cache a cache that has been configured but not yet created.
  +    */
  +   protected void configureMultiplexer(TreeCacheMBean cache) throws Exception
  +   {
  +      // default does nothing
  +   }
  +   
  +   /**
  +    * Provides a hook to check that the cache's channel came from the
  +    * multiplexer, or not, as expected.  This default impl asserts that
  +    * the channel did not come from the multiplexer.
  +    * 
  +    * @param cache a cache that has already been started
  +    */
  +   protected void validateMultiplexer(TreeCacheMBean cache)
  +   {
  +      assertFalse("Cache is not using multiplexer", cache.isUsingMultiplexer());
      }
   
      void destroyCaches() throws Exception {
  
  
  
  1.7.2.1   +33 -1     JBossCache/tests/functional/org/jboss/cache/replicated/AsyncReplTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AsyncReplTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/replicated/AsyncReplTest.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -b -r1.7 -r1.7.2.1
  --- AsyncReplTest.java	24 May 2006 10:18:55 -0000	1.7
  +++ AsyncReplTest.java	4 Nov 2006 04:29:58 -0000	1.7.2.1
  @@ -16,6 +16,7 @@
   import org.jboss.cache.PropertyConfigurator;
   import org.jboss.cache.TreeCache;
   import org.jboss.cache.Fqn;
  +import org.jboss.cache.TreeCacheMBean;
   import org.jboss.cache.misc.TestingUtil;
   
   import javax.transaction.TransactionManager;
  @@ -24,7 +25,7 @@
    * Unit test for replicated async TreeCache. Use locking and multiple threads to test
    * concurrent access to the tree.
    *
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.7.2.1 $
    */
   public class AsyncReplTest extends TestCase {
      TreeCache cache1, cache2;
  @@ -49,11 +50,42 @@
         PropertyConfigurator config=new PropertyConfigurator();
         config.configure(tree, "META-INF/replAsync-service.xml"); // read in generic replAsync xml
         tree.setClusterName(name);
  +      
  +      // Call the hook that allows mux integration
  +      configureMultiplexer(tree);
  +      
         tree.createService();
         tree.startService();
  +      
  +      validateMultiplexer(tree);
  +      
         return tree;
      }
   
  +   /**
  +    * Provides a hook for multiplexer integration. This default implementation
  +    * is a no-op; subclasses that test mux integration would override
  +    * to integrate the given cache with a multiplexer.
  +    *
  +    * param cache a cache that has been configured but not yet created.
  +    */
  +   protected void configureMultiplexer(TreeCacheMBean cache) throws Exception
  +   {
  +      // default does nothing
  +   }
  +   
  +   /**
  +    * Provides a hook to check that the cache's channel came from the
  +    * multiplexer, or not, as expected.  This default impl asserts that
  +    * the channel did not come from the multiplexer.
  +    * 
  +    * @param cache a cache that has already been started
  +    */
  +   protected void validateMultiplexer(TreeCacheMBean cache)
  +   {
  +      assertFalse("Cache is not using multiplexer", cache.isUsingMultiplexer());
  +   }
  +
      public void tearDown() throws Exception {
         super.tearDown();
         if(cache1 != null) {
  
  
  



More information about the jboss-cvs-commits mailing list