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

Manik Surtani msurtani at jboss.com
Sat Dec 30 14:48:48 EST 2006


  User: msurtani
  Date: 06/12/30 14:48:48

  Modified:    tests/functional/org/jboss/cache/statetransfer  
                        VersionedTestBase.java StateTransferTestBase.java
  Log:
  Genericised, autoboxed
  
  Revision  Changes    Path
  1.22      +59 -62    JBossCache/tests/functional/org/jboss/cache/statetransfer/VersionedTestBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: VersionedTestBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/VersionedTestBase.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -b -r1.21 -r1.22
  --- VersionedTestBase.java	22 Dec 2006 18:55:05 -0000	1.21
  +++ VersionedTestBase.java	30 Dec 2006 19:48:48 -0000	1.22
  @@ -422,7 +422,7 @@
                            aException.getCause() instanceof InactiveRegionException);
               if (gotUnexpectedException)
               {
  -               fail("Activator " + names[i] + " caught an exception " +aException);
  +               fail("Activator " + names[i] + " caught an exception " + aException);
               }
   
               for (int j = 0; j < count; j++)
  @@ -451,13 +451,13 @@
       * Starts two caches where each cache has N regions. We put some data in each of the regions. 
       * We run two threads where each thread creates a cache then goes into a loop where it 
       * activates the N regions, with a 1 sec pause between activations.
  -    * 
  +    * <p/>
       * Threads are started with 10 sec difference.
  -    * 
  +    * <p/>
       * This test simulates a 10 sec staggered start of 2 servers in a cluster, with each server 
       * then deploying webapps.
  -    * 
  -    * 
  +    * <p/>
  +    * <p/>
       * <p/>
       * Failure condition is if any node sees an exception or if the final state
       * of all caches is not consistent.
  @@ -467,7 +467,7 @@
       */
      private void concurrentActivationTest2(boolean sync) throws Exception
      {
  -      String[] names = {"A","B"};
  +      String[] names = {"A", "B"};
         int count = names.length;
         int regionsToActivate = 15;
         int sleepTimeBetweenNodeStarts = 10000;
  @@ -485,7 +485,7 @@
            CacheSPI[] caches = new CacheSPI[count];
            for (int i = 0; i < count; i++)
            {
  -            activators[i] = new StaggeredWebDeployerActivator(semaphore, names[i], sync,regionsToActivate);
  +            activators[i] = new StaggeredWebDeployerActivator(semaphore, names[i], sync, regionsToActivate);
               caches[i] = activators[i].getCacheSPI();        
               
               // Release the semaphore to allow the thread to start working 
  @@ -523,7 +523,7 @@
                            aException.getCause() instanceof InactiveRegionException);
               if (gotUnexpectedException)
               {
  -               fail("Activator " + names[i] + " caught an exception " +aException);
  +               fail("Activator " + names[i] + " caught an exception " + aException);
               }
   
               for (int j = 0; j < regionsToActivate; j++)
  @@ -550,18 +550,16 @@
       * Starts two caches where each cache has N regions. We put some data in each of the regions. 
       * We run two threads where each thread creates a cache then goes into a loop where it 
       * activates the N regions, with a 1 sec pause between activations.
  -    * 
  +    * <p/>
       * Threads are started with 10 sec difference.
  -    * 
  +    * <p/>
       * This test simulates a 10 sec staggered start of 2 servers in a cluster, with each server 
       * then deploying webapps.
  -    * 
  -    * 
  +    * <p/>
  +    * <p/>
       * <p/>
       * Failure condition is if any node sees an exception or if the final state
       * of all caches is not consistent.
  -    *  
  -    *
       */
      public void testConcurrentStartupActivationAsync() throws Exception
      {     
  @@ -572,18 +570,16 @@
       * Starts two caches where each cache has N regions. We put some data in each of the regions. 
       * We run two threads where each thread creates a cache then goes into a loop where it 
       * activates the N regions, with a 1 sec pause between activations.
  -    * 
  +    * <p/>
       * Threads are started with 10 sec difference.
  -    * 
  +    * <p/>
       * This test simulates a 10 sec staggered start of 2 servers in a cluster, with each server 
       * then deploying webapps.
  -    * 
  -    * 
  +    * <p/>
  +    * <p/>
       * <p/>
       * Failure condition is if any node sees an exception or if the final state
       * of all caches is not consistent.
  -    *  
  -    *
       */
      public void testConcurrentStartupActivationSync() throws Exception
      {     
  @@ -753,7 +749,7 @@
         Object addr = addrClazz.newInstance();
         setCity.invoke(addr, new Object[]{"San Jose"});
         setStreet.invoke(addr, new Object[]{"1007 Home"});
  -      setZip.invoke(addr, new Object[]{new Integer(90210)});
  +      setZip.invoke(addr, new Object[]{90210});
   
         Class benClazz = loader.loadClass(PERSON_CLASSNAME);
         Method setName = benClazz.getMethod("setName", new Class[]{String.class});
  @@ -798,6 +794,7 @@
      {
   
         int regionCount = 15;
  +
         StaggeredWebDeployerActivator(Semaphore semaphore,
                        String name,
                        boolean sync,
  @@ -812,7 +809,7 @@
         {         
            for (int i = 0; i < regionCount; i++)
            {
  -            cache.getRegion(Fqn.fromString("/a/"+i), true).activate();
  +            cache.getRegion(Fqn.fromString("/a/" + i), true).activate();
               
               Fqn childFqn = Fqn.fromString("/a/" + i + "/" + name);           
               cache.put(childFqn, "KEY", "VALUE");
  @@ -865,7 +862,7 @@
                  factor = random.nextInt(50);
   
                  fqn = Fqn.fromString("/" + name + "/" + String.valueOf(factor % SUBTREE_SIZE));
  -               Integer value = new Integer(factor / SUBTREE_SIZE);
  +               Integer value = factor / SUBTREE_SIZE;
                  cache.put(fqn, "KEY", value);
   
                  TestingUtil.sleepThread((long) factor);
  
  
  
  1.28      +2 -2      JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransferTestBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: StateTransferTestBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransferTestBase.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -b -r1.27 -r1.28
  --- StateTransferTestBase.java	30 Dec 2006 17:49:59 -0000	1.27
  +++ StateTransferTestBase.java	30 Dec 2006 19:48:48 -0000	1.28
  @@ -55,8 +55,8 @@
      public static final String JOE = "JOE";
      public static final String BOB = "BOB";
      public static final String JANE = "JANE";
  -   public static final Integer TWENTY = new Integer(20);
  -   public static final Integer FORTY = new Integer(40);
  +   public static final Integer TWENTY = 20;
  +   public static final Integer FORTY = 40;
   
      protected Map caches;
      private ClassLoader orig_TCL;
  
  
  



More information about the jboss-cvs-commits mailing list