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

Brian Stansberry brian.stansberry at jboss.com
Tue May 22 18:53:09 EDT 2007


  User: bstansberry
  Date: 07/05/22 18:53:09

  Modified:    tests/functional/org/jboss/cache/jmx  
                        InterceptorRegistrationTest.java
                        CacheJmxWrapperTest.java
  Log:
  [JBCACHE-1068] Get rid of LifeCycle interface
  [JBCACHE-1047] Revert manageCacheLifecycle attribute
  
  Revision  Changes    Path
  1.2       +9 -78     JBossCache/tests/functional/org/jboss/cache/jmx/InterceptorRegistrationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InterceptorRegistrationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/jmx/InterceptorRegistrationTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- InterceptorRegistrationTest.java	9 May 2007 18:34:12 -0000	1.1
  +++ InterceptorRegistrationTest.java	22 May 2007 22:53:09 -0000	1.2
  @@ -28,7 +28,7 @@
    * Tests the interceptor registration function of CacheJmxWrapper.
    * 
    * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class InterceptorRegistrationTest extends CacheJmxWrapperTestBase
   {
  @@ -53,6 +53,8 @@
         
         interceptorRegistrationTest(true);
         
  +      // These should be ignored because we 
  +      // never did wrapper.create()/start()
         wrapper.stop();
         wrapper.destroy();
         
  @@ -90,8 +92,8 @@
         wrapper.stop();
         wrapper.destroy();
         
  -      // Should still be registered
  -      interceptorRegistrationTest(true);
  +      // Should still no longer be registered
  +      interceptorRegistrationTest(false);
         
         unregisterWrapper();
         
  @@ -178,7 +180,7 @@
      public void testInterceptorMBeans5() throws Exception
      {
         CacheJmxWrapperMBean wrapper = registerWrapper();
  -      wrapper.setManageCacheLifecycle(true);
  +//      wrapper.setManageCacheLifecycle(true);
         assertTrue("Should be registered", mBeanServer.isRegistered(mBeanName));
         
         // have to start the cache to have any interceptors
  @@ -199,7 +201,7 @@
      }
   
      /**
  -    * Confirms interceptor mbeans are NOT registered if the following events
  +    * Confirms interceptor mbeans are registered if the following events
       * occur:
       * 
       * cache constructed;
  @@ -217,7 +219,7 @@
         wrapper.create();
         wrapper.start();
         
  -      interceptorRegistrationTest(false);
  +      interceptorRegistrationTest(true);
         
         wrapper.stop();
         wrapper.destroy();
  @@ -230,7 +232,7 @@
      }
   
      /**
  -    * Confirms interceptor mbeans are NOT registered if the following events
  +    * Confirms interceptor mbeans are registered if the following events
       * occur:
       * 
       * cache constructed;
  @@ -250,78 +252,7 @@
         wrapper = registerWrapper(wrapper);
         assertTrue("Should be registered", mBeanServer.isRegistered(mBeanName));
         
  -      interceptorRegistrationTest(false);
  -      
  -      wrapper.stop();
  -      wrapper.destroy();
  -      
  -      interceptorRegistrationTest(false);
  -      
  -      unregisterWrapper();
  -      
  -      interceptorRegistrationTest(false);
  -   }
  -
  -   /**
  -    * Confirms interceptor mbeans are NOT registered if the following events
  -    * occur:
  -    * 
  -    * wrapper created from config
  -    * wrapper.managerCacheLifecycle=false
  -    * wrapper created and started
  -    * wrapper registered
  -    * 
  -    * @throws Exception
  -    */
  -   public void testInterceptorMBeans8() throws Exception
  -   {
  -      CacheJmxWrapperMBean wrapper = new CacheJmxWrapper(createCache(createConfiguration()));
  -      wrapper.setManageCacheLifecycle(false);
  -      
  -      // have to start the cache to have any interceptors
  -      wrapper.create();
  -      wrapper.start();
  -      
  -      wrapper = registerWrapper(wrapper);
  -      assertTrue("Should be registered", mBeanServer.isRegistered(mBeanName));
  -      
  -      interceptorRegistrationTest(false);
  -      
  -      wrapper.stop();
  -      wrapper.destroy();
  -      
  -      interceptorRegistrationTest(false);
  -      
  -      unregisterWrapper();
  -      
  -      interceptorRegistrationTest(false);
  -   }
  -
  -   /**
  -    * Confirms interceptor mbeans are NOT registered if the following events
  -    * occur:
  -    * 
  -    * wrapper created from config
  -    * wrapper.managerCacheLifecycle=false
  -    * wrapper registered
  -    * wrapper created and started
  -    * 
  -    * @throws Exception
  -    */
  -   public void testInterceptorMBeans9() throws Exception
  -   {
  -      CacheJmxWrapperMBean wrapper = new CacheJmxWrapper(createCache(createConfiguration()));
  -      wrapper.setManageCacheLifecycle(false);
  -      
  -      wrapper = registerWrapper(wrapper);
  -      
  -      assertTrue("Should be registered", mBeanServer.isRegistered(mBeanName));
  -      
  -      // have to start the cache to have any interceptors
  -      wrapper.create();
  -      wrapper.start();
  -      
  -      interceptorRegistrationTest(false);
  +      interceptorRegistrationTest(true);
         
         wrapper.stop();
         wrapper.destroy();
  
  
  
  1.3       +12 -1     JBossCache/tests/functional/org/jboss/cache/jmx/CacheJmxWrapperTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheJmxWrapperTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/jmx/CacheJmxWrapperTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CacheJmxWrapperTest.java	11 May 2007 16:48:09 -0000	1.2
  +++ CacheJmxWrapperTest.java	22 May 2007 22:53:09 -0000	1.3
  @@ -7,7 +7,9 @@
   import org.jboss.cache.Cache;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.config.Configuration.CacheMode;
   import org.jboss.cache.transaction.DummyTransactionManagerLookup;
  +import org.jgroups.stack.IpAddress;
   
   /**
    * Tests the JMX wrapper class around the cache.
  @@ -216,6 +218,15 @@
         getLockInfoTest(true);
      }
   
  +   public void testGetLocalAddress() throws Exception
  +   {
  +      Configuration c = createConfiguration();
  +      c.setCacheMode(CacheMode.REPL_ASYNC);
  +      CacheJmxWrapperMBean wrapper = registerWrapper(c);
  +      wrapper.start();
  +      assertTrue("Got an IpAddress", wrapper.getLocalAddress() instanceof IpAddress);
  +   }
  +
      private String getCacheDetailsTest(boolean html) throws Exception
      {
         CacheJmxWrapperMBean wrapper = registerWrapper();
  @@ -244,7 +255,7 @@
         Cache c = createCache(config);
         CacheJmxWrapperMBean wrapper = registerWrapper(c);
         
  -      wrapper.setManageCacheLifecycle(true);
  +//      wrapper.setManageCacheLifecycle(true);
         wrapper.create();
         wrapper.start();
         
  
  
  



More information about the jboss-cvs-commits mailing list