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

Manik Surtani msurtani at jboss.com
Thu Jan 4 00:35:40 EST 2007


  User: msurtani
  Date: 07/01/04 00:35:40

  Modified:    tests/functional/org/jboss/cache/buddyreplication  
                        GravitateResultTest.java
                        BuddyReplicationTestsBase.java
  Log:
  Major changes around nodes, and the way they interact with the interceptor stack.
  Also removed redundant methods in NodeSPI and removed the need for casting to NodeSPI in most cases.
  
  Revision  Changes    Path
  1.3       +36 -36    JBossCache/tests/functional/org/jboss/cache/buddyreplication/GravitateResultTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: GravitateResultTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/GravitateResultTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- GravitateResultTest.java	25 Nov 2006 07:25:48 -0000	1.2
  +++ GravitateResultTest.java	4 Jan 2007 05:35:40 -0000	1.3
  @@ -1,22 +1,22 @@
   package org.jboss.cache.buddyreplication;
   
  -import java.util.ArrayList;
  -import java.util.List;
  -
  +import junit.framework.TestCase;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Node;
   
  -import junit.framework.TestCase;
  +import java.util.ArrayList;
  +import java.util.List;
   
   public class GravitateResultTest extends TestCase
   {
      
  -   public void testBasic() {
  +   public void testBasic()
  +   {
         GravitateResult gr = GravitateResult.noDataFound();
         assertEquals(false, gr.getDataFound());
         gr.toString();
         assertEquals(1, gr.asList().size());
  -      assertEquals(Boolean.FALSE, (Boolean)gr.asList().get(0));
  +      assertEquals(Boolean.FALSE, gr.asList().get(0));
         
         List<Node> l = new ArrayList();
         gr = GravitateResult.subtreeResult(l, Fqn.ROOT);
  @@ -25,7 +25,7 @@
         gr.toString();
         assertEquals(Fqn.ROOT, gr.getBuddyBackupRegion());
         assertEquals(3, gr.asList().size());
  -      assertEquals(Boolean.TRUE, (Boolean)gr.asList().get(0));
  +      assertEquals(Boolean.TRUE, gr.asList().get(0));
         
         byte b[] = new byte[0];
         gr = GravitateResult.marshalledResult(b, Fqn.ROOT);
  
  
  
  1.37      +7 -4      JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyReplicationTestsBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -b -r1.36 -r1.37
  --- BuddyReplicationTestsBase.java	3 Jan 2007 04:03:47 -0000	1.36
  +++ BuddyReplicationTestsBase.java	4 Jan 2007 05:35:40 -0000	1.37
  @@ -7,7 +7,6 @@
   package org.jboss.cache.buddyreplication;
   
   import junit.framework.TestCase;
  -
   import org.jboss.cache.Cache;
   import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  @@ -84,7 +83,7 @@
            c.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
         }
         c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  -      c.getConfiguration().setSyncCommitPhase(true); // helps track down breakages
  +      c.getConfiguration().setSyncCommitPhase(true);// helps track down breakages
   
         // Call the hook that allows mux integration if that's what the test wants
         configureMultiplexer(c);
  @@ -179,7 +178,9 @@
         CacheLoaderConfig cfg = XmlConfigurationParser.parseCacheLoaderConfig(element);
         cache.getConfiguration().setCacheLoaderConfig(cfg);
         if (start)
  +      {
            cache.start();
  +      }
   
         return cache;
      }
  @@ -264,8 +265,8 @@
   
      protected void assertIsBuddy(CacheImpl dataOwner, CacheImpl buddy, boolean onlyBuddy)
      {
  -      Address dataOwnerLocalAddress = (Address) dataOwner.getLocalAddress();
  -      Address buddyLocalAddress = (Address) buddy.getLocalAddress();
  +      Address dataOwnerLocalAddress = dataOwner.getLocalAddress();
  +      Address buddyLocalAddress = buddy.getLocalAddress();
   
         System.out.println("*** assert with groups.  Testing that " + buddyLocalAddress + " is a buddy for owner " + dataOwnerLocalAddress + " only buddy? " + onlyBuddy);
         printBuddyGroup(dataOwner);
  @@ -293,7 +294,9 @@
         for (int i = 0; i < caches.length; i++)
         {
            if (caches[i] == null)
  +         {
               System.out.println("  ** Cache " + i + " is null!");
  +         }
            else
            {
               System.out.println("  ** Cache " + i + " is " + caches[i].getLocalAddress());
  
  
  



More information about the jboss-cvs-commits mailing list