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

Manik Surtani manik at jboss.org
Wed May 23 06:28:53 EDT 2007


  User: msurtani
  Date: 07/05/23 06:28:53

  Modified:    tests/functional/org/jboss/cache/jmx    
                        CacheJmxWrapperTestBase.java
                        CacheJmxWrapperTest.java
                        CacheLegacyJmxWrapperTest.java
                        NotificationTest.java
  Log:
  Initiated a bunch of performance fixes, including replacing CopyOnWriteArraySets with org.jboss.cache.util.concurrent.ConcurrentHashSet.
  Also ran an imports optimiser on the code base - there were a lot of unused imports floating about.
  
  Revision  Changes    Path
  1.3       +29 -26    JBossCache/tests/functional/org/jboss/cache/jmx/CacheJmxWrapperTestBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheJmxWrapperTestBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/jmx/CacheJmxWrapperTestBase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CacheJmxWrapperTestBase.java	11 May 2007 22:43:07 -0000	1.2
  +++ CacheJmxWrapperTestBase.java	23 May 2007 10:28:53 -0000	1.3
  @@ -1,17 +1,16 @@
   package org.jboss.cache.jmx;
   
  +import junit.framework.TestCase;
  +import org.jboss.cache.Cache;
  +import org.jboss.cache.DefaultCacheFactory;
  +import org.jboss.cache.config.Configuration;
  +
   import javax.management.MBeanServer;
   import javax.management.MBeanServerFactory;
   import javax.management.MBeanServerInvocationHandler;
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   
  -import junit.framework.TestCase;
  -
  -import org.jboss.cache.Cache;
  -import org.jboss.cache.DefaultCacheFactory;
  -import org.jboss.cache.config.Configuration;
  -
   /**
    * Tests the JMX wrapper class around the cache.
    *
  @@ -114,7 +113,9 @@
            {
               cache.stop();
            }
  -         catch (Exception ignored) {}
  +         catch (Exception ignored)
  +         {
  +         }
            
            cache = null;
         }
  @@ -125,7 +126,9 @@
               jmxWrapper.stop();
               jmxWrapper.destroy();
            }
  -         catch (Exception ignored) {}
  +         catch (Exception ignored)
  +         {
  +         }
            
            jmxWrapper = null;
         }
  
  
  
  1.6       +73 -70    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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- CacheJmxWrapperTest.java	23 May 2007 01:37:03 -0000	1.5
  +++ CacheJmxWrapperTest.java	23 May 2007 10:28:53 -0000	1.6
  @@ -1,11 +1,5 @@
   package org.jboss.cache.jmx;
   
  -import java.util.List;
  -
  -import javax.management.ObjectName;
  -import javax.transaction.Transaction;
  -import javax.transaction.TransactionManager;
  -
   import org.jboss.cache.AbstractCacheListener;
   import org.jboss.cache.Cache;
   import org.jboss.cache.CacheSPI;
  @@ -18,6 +12,11 @@
   import org.jgroups.Address;
   import org.jgroups.stack.IpAddress;
   
  +import javax.management.ObjectName;
  +import javax.transaction.Transaction;
  +import javax.transaction.TransactionManager;
  +import java.util.List;
  +
   /**
    * Tests the JMX wrapper class around the cache.
    *
  @@ -248,7 +247,7 @@
         {
            cache2 = createCache(c);
            cache2.start();
  -         Cache[] caches = new Cache[]{wrapper.getCache(), cache2 };
  +         Cache[] caches = new Cache[]{wrapper.getCache(), cache2};
            TestingUtil.blockUntilViewsReceived(caches, 5000);
            
            Address addr = wrapper.getLocalAddress();
  @@ -307,7 +306,9 @@
            wrapper.start();
            fail("Listener did not prevent start");         
         }
  -      catch (IllegalStateException good) {}
  +      catch (IllegalStateException good)
  +      {
  +      }
         
         assertEquals("Correct state", LifecycleState.FAILED, wrapper.getLifecycleState());
         
  @@ -328,7 +329,9 @@
            wrapper.stop();
            fail("Listener did not prevent stop");         
         }
  -      catch (IllegalStateException good) {}
  +      catch (IllegalStateException good)
  +      {
  +      }
         
         assertEquals("Correct state", LifecycleState.FAILED, wrapper.getLifecycleState());
         
  
  
  
  1.3       +179 -180  JBossCache/tests/functional/org/jboss/cache/jmx/CacheLegacyJmxWrapperTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLegacyJmxWrapperTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/jmx/CacheLegacyJmxWrapperTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CacheLegacyJmxWrapperTest.java	23 May 2007 05:45:45 -0000	1.2
  +++ CacheLegacyJmxWrapperTest.java	23 May 2007 10:28:53 -0000	1.3
  @@ -22,27 +22,17 @@
   
   package org.jboss.cache.jmx;
   
  -import java.lang.reflect.InvocationHandler;
  -import java.lang.reflect.Method;
  -import java.lang.reflect.Proxy;
  -import java.util.List;
  -import java.util.Properties;
  -
  -import javax.management.MBeanServerInvocationHandler;
  -import javax.management.ObjectName;
  -import javax.transaction.TransactionManager;
  -
   import org.jboss.cache.Version;
   import org.jboss.cache.config.BuddyReplicationConfig;
  +import org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig;
   import org.jboss.cache.config.CacheLoaderConfig;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.config.Configuration.CacheMode;
  +import org.jboss.cache.config.Configuration.NodeLockingScheme;
   import org.jboss.cache.config.EvictionConfig;
   import org.jboss.cache.config.EvictionRegionConfig;
   import org.jboss.cache.config.RuntimeConfig;
  -import org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig;
  -import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
  -import org.jboss.cache.config.Configuration.CacheMode;
  -import org.jboss.cache.config.Configuration.NodeLockingScheme;
   import org.jboss.cache.eviction.FIFOConfiguration;
   import org.jboss.cache.eviction.FIFOPolicy;
   import org.jboss.cache.eviction.LRUConfiguration;
  @@ -59,11 +49,20 @@
   import org.jgroups.JChannelFactory;
   import org.w3c.dom.Element;
   
  +import javax.management.MBeanServerInvocationHandler;
  +import javax.management.ObjectName;
  +import javax.transaction.TransactionManager;
  +import java.lang.reflect.InvocationHandler;
  +import java.lang.reflect.Method;
  +import java.lang.reflect.Proxy;
  +import java.util.List;
  +import java.util.Properties;
  +
   /**
    * Test of the CacheLegacyJmxWrapper.
    * 
    * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class CacheLegacyJmxWrapperTest extends CacheJmxWrapperTestBase
   {
  @@ -262,7 +261,7 @@
         "          <buddyCommunicationTimeout>600000</buddyCommunicationTimeout>\n" +
         "          <buddyLocatorClass>org.jboss.cache.buddyreplication.TestBuddyLocator</buddyLocatorClass>\n" +
         "          <buddyLocatorProperties>numBuddies = 2</buddyLocatorProperties>\n" +
  -      "          <buddyPoolName>testpool</buddyPoolName>"+
  +                         "          <buddyPoolName>testpool</buddyPoolName>" +
         "          <autoDataGravitation>false</autoDataGravitation>\n" +
         "          <dataGravitationRemoveOnFind>false</dataGravitationRemoveOnFind>\n" +
         "          <dataGravitationSearchBackupTrees>false</dataGravitationSearchBackupTrees>" +
  
  
  
  1.3       +43 -45    JBossCache/tests/functional/org/jboss/cache/jmx/NotificationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NotificationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/jmx/NotificationTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- NotificationTest.java	10 May 2007 17:30:52 -0000	1.2
  +++ NotificationTest.java	23 May 2007 10:28:53 -0000	1.3
  @@ -1,17 +1,7 @@
   package org.jboss.cache.jmx;
   
  -import java.util.EnumSet;
  -import java.util.HashMap;
  -
  -import javax.management.MBeanServer;
  -import javax.management.MBeanServerFactory;
  -import javax.management.Notification;
  -import javax.management.NotificationListener;
  -import javax.management.ObjectName;
  -
   import junit.framework.AssertionFailedError;
   import junit.framework.TestCase;
  -
   import org.jboss.cache.CacheImpl;
   import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
  @@ -24,11 +14,19 @@
   import org.jboss.cache.xml.XmlHelper;
   import org.w3c.dom.Element;
   
  +import javax.management.MBeanServer;
  +import javax.management.MBeanServerFactory;
  +import javax.management.Notification;
  +import javax.management.NotificationListener;
  +import javax.management.ObjectName;
  +import java.util.EnumSet;
  +import java.util.HashMap;
  +
   /**
    * Functional tests for CacheJmxWrapper broadcast of cache event notifications
    *
    * @author Jerry Gauthier
  - * @version $Id: NotificationTest.java,v 1.2 2007/05/10 17:30:52 bstansberry Exp $
  + * @version $Id: NotificationTest.java,v 1.3 2007/05/23 10:28:53 msurtani Exp $
    */
   public class NotificationTest extends TestCase
   {
  
  
  



More information about the jboss-cvs-commits mailing list