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

Manik Surtani msurtani at jboss.com
Mon Sep 11 13:42:41 EDT 2006


  User: msurtani
  Date: 06/09/11 13:42:41

  Modified:    tests/functional/org/jboss/cache/statetransfer   
                        FailedStateTransferTest.java
                        StateTransfer200Test.java VersionedTestBase.java
  Log:
  - fixed breakage of BR tests in state transfer
  
  Revision  Changes    Path
  1.6       +1 -1      JBossCache/tests/functional/org/jboss/cache/statetransfer/FailedStateTransferTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FailedStateTransferTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/FailedStateTransferTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- FailedStateTransferTest.java	6 Sep 2006 15:31:00 -0000	1.5
  +++ FailedStateTransferTest.java	11 Sep 2006 17:42:41 -0000	1.6
  @@ -50,7 +50,7 @@
   
         // Put the cache in the map before starting, so if it fails in
         // start it can still be destroyed later
  -      caches.put("secretive", tree);
  +      caches.put("secretive", tree.getCacheSPI());
   
         tree.create();
         tree.start();
  
  
  
  1.8       +14 -14    JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransfer200Test.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: StateTransfer200Test.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransfer200Test.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- StateTransfer200Test.java	7 Sep 2006 17:42:29 -0000	1.7
  +++ StateTransfer200Test.java	11 Sep 2006 17:42:41 -0000	1.8
  @@ -10,8 +10,8 @@
   import org.jboss.cache.CacheSPI;
   import org.jboss.cache.DataNode;
   import org.jboss.cache.Fqn;
  +import org.jboss.cache.TreeCacheProxyImpl;
   import org.jboss.cache.buddyreplication.BuddyManager;
  -import org.jboss.cache.config.Option;
   import org.jboss.cache.misc.TestingUtil;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
  @@ -23,7 +23,7 @@
    * Tests that state transfer works properly if the version is 2.0.0.GA.
    *
    * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public class StateTransfer200Test extends VersionedTestBase
   {
  @@ -68,19 +68,19 @@
         // Pause to give caches time to see each other
         TestingUtil.blockUntilViewsReceived(new CacheSPI[]{cache1, cache2}, 60000);
   
  -      Option option = new Option();
  -      option.setCacheModeLocal(true);
  -
         Fqn backup = Fqn.fromString(BuddyManager.BUDDY_BACKUP_SUBTREE);
         backup = new Fqn(backup, "a");
  -      cache1.getInvocationContext().setOptionOverrides(option);
  +      cache1.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
         cache1.put(backup, null);
  -      DataNode target = (DataNode) cache1.get(backup);
  +
  +      DataNode target = ((TreeCacheProxyImpl) cache1).peek(backup);
  +
  +      assertNotNull("Data Node should not be null", target);
   
         Fqn abc = Fqn.fromString("/a/b/c");
  -      cache2.getInvocationContext().setOptionOverrides(option);
  +      cache2.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
         cache2.put(abc, "name", JOE);
  -      cache2.getInvocationContext().setOptionOverrides(option);
  +      cache2.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
         cache2.put(A_D, "name", JANE);
   
         Object[] sources = cache1.getMembers().toArray();
  @@ -97,19 +97,19 @@
      
      public void testCacheLoaderFailure() throws Exception
      {
  -      CacheSPI cache1 = createCache("cache1", false, false, "org.jboss.cache.statetransfer.CorruptedFileCacheLoader",false,true);
  +      CacheSPI cache1 = createCache("cache1", false, false, "org.jboss.cache.statetransfer.CorruptedFileCacheLoader", false, true);
   
         cache1.put(A_B, "name", JOE);
         cache1.put(A_B, "age", TWENTY);
         cache1.put(A_C, "name", BOB);
         cache1.put(A_C, "age", FORTY);
   
  -      CacheSPI cache2 = createCache("cache2", false, false, true,false,true);            
  +      CacheSPI cache2 = createCache("cache2", false, false, true, false, true);
         // Pause to give caches time to see each other
         TestingUtil.blockUntilViewsReceived(new CacheSPI[]{cache1, cache2}, 60000);
         
         //when persistent transfer fails as in this case state recipient cacheloader should be wiped clean
  -      assertFalse("/a/b is not in cache loader ",cache2.getCacheLoader().exists(A_B));
  +      assertFalse("/a/b is not in cache loader ", cache2.getCacheLoader().exists(A_B));
      }
   
   
  
  
  
  1.10      +6 -3      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.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- VersionedTestBase.java	6 Sep 2006 15:31:00 -0000	1.9
  +++ VersionedTestBase.java	11 Sep 2006 17:42:41 -0000	1.10
  @@ -33,7 +33,10 @@
      public static final Fqn A = Fqn.fromString("/a");
      public static final Fqn B = Fqn.fromString("/b");
      public static final Fqn C = Fqn.fromString("/c");
  -   ;
  +
  +   protected static final String ADDRESS_CLASSNAME = "org.jboss.cache.marshall.data.Address";
  +   protected static final String PERSON_CLASSNAME = "org.jboss.cache.marshall.data.Person";
  +
      public static final Fqn A_B = Fqn.fromString("/a/b");
      public static final Fqn A_C = Fqn.fromString("/a/c");
      public static final Fqn A_D = Fqn.fromString("/a/d");
  @@ -602,7 +605,7 @@
   
      private Object createBen(ClassLoader loader) throws Exception
      {
  -      Class addrClazz = loader.loadClass("org.jboss.cache.marshall.Address");
  +      Class addrClazz = loader.loadClass(ADDRESS_CLASSNAME);
         Method setCity = addrClazz.getMethod("setCity", new Class[]{String.class});
         Method setStreet = addrClazz.getMethod("setStreet", new Class[]{String.class});
         Method setZip = addrClazz.getMethod("setZip", new Class[]{int.class});
  @@ -611,7 +614,7 @@
         setStreet.invoke(addr, new Object[]{"1007 Home"});
         setZip.invoke(addr, new Object[]{new Integer(90210)});
   
  -      Class benClazz = loader.loadClass("org.jboss.cache.marshall.Person");
  +      Class benClazz = loader.loadClass(PERSON_CLASSNAME);
         Method setName = benClazz.getMethod("setName", new Class[]{String.class});
         Method setAddress = benClazz.getMethod("setAddress", new Class[]{addrClazz});
         Object ben = benClazz.newInstance();
  
  
  



More information about the jboss-cvs-commits mailing list