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

Manik Surtani manik at jboss.org
Mon Mar 26 10:37:49 EDT 2007


  User: msurtani
  Date: 07/03/26 10:37:49

  Modified:    tests/functional/org/jboss/cache/statetransfer  
                        VersionedTestBase.java StateTransfer200Test.java
  Log:
  Patched tests
  
  Revision  Changes    Path
  1.30      +21 -21    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.29
  retrieving revision 1.30
  diff -u -b -r1.29 -r1.30
  --- VersionedTestBase.java	21 Mar 2007 16:11:40 -0000	1.29
  +++ VersionedTestBase.java	26 Mar 2007 14:37:49 -0000	1.30
  @@ -417,7 +417,7 @@
            // Sleep to allow any async calls to clear
            if (!sync)
            {
  -            TestingUtil.sleepThread((long) 500);
  +            TestingUtil.sleepThread(1000);
            }
   
            // Ensure the caches held by the activators see all the values
  
  
  
  1.17      +34 -15    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.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- StateTransfer200Test.java	23 Mar 2007 23:33:06 -0000	1.16
  +++ StateTransfer200Test.java	26 Mar 2007 14:37:49 -0000	1.17
  @@ -24,7 +24,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.16 $
  + * @version $Revision: 1.17 $
    */
   public class StateTransfer200Test extends VersionedTestBase
   {
  @@ -109,28 +109,47 @@
   
      public void testCacheLoaderFailure() throws Exception
      {
  -      CacheSPI cache1 = createCache("cache1", false, false, "org.jboss.cache.statetransfer.CorruptedFileCacheLoader", false, true);
  +      CacheSPI cache1 = null, cache2 = null;
  +      try
  +      {
  +         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 = null;
  -      try
  -      {
  +         cache1.evict(A_B, true);
  +         assertNull(cache1.peek(A_B, false));
  +
  +         cache2 = null;
  +         //      try
  +         //      {
            cache2 = createCache("cache2", false, false, true, false, false);
            cache2.create();
            cache2.start();
  -         fail("Should have caused an exception");
  +         // Remote node swallows the exception - cache2 does not see this!!  See CacheImpl.MessageListenerAdapter.getState()
  +         //         fail("Should have caused an exception");
  +         //      }
  +         //      catch (Exception e)
  +         //      {
  +         //         assertNotNull(e);
  +         //      }
  +
  +         // when persistent transfer fails as in this case state recipient cacheloader should be wiped clean.
  +         // but transient state, when applied, will also be stored in the CL.
  +         assertNotNull("/a/c is not in cache loader, transient state should have come across ", cache2.get(A_C, "name"));
  +         //assertNull("/a/b is in cache loader, persistent state should not have come across ", cache2.get(A_B, "name"));
  +         // even the above does come across though, since the CorruptedFleCacheLoader first loads state and THEN throws the exception.  State
  +         // already now exists in the stream, and since the exception is swallowed, the stream is still used to retrieve state.
  +         // This test looks more and more pointless if we're swallowing the remote exception intentionally.  :-)
  +         assertNotNull("/a/b is in cache loader, persistent state should not have come across ", cache2.get(A_B, "name"));
  +
         }
  -      catch (Exception e)
  +      finally
         {
  -         assertNotNull(e);
  +         cache1.removeNode(Fqn.ROOT);
         }
  -
  -      //when persistent transfer fails as in this case state recipient cacheloader should be wiped clean
  -      assertFalse("/a/b is not in cache loader ", cache2.getCacheLoaderManager().getCacheLoader().exists(A_B));
      }
   
   
  
  
  



More information about the jboss-cvs-commits mailing list