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

Manik Surtani manik at jboss.org
Tue Jun 26 14:03:42 EDT 2007


  User: msurtani
  Date: 07/06/26 14:03:42

  Modified:    tests/functional/org/jboss/cache/buddyreplication 
                        BuddyReplicationContentTest.java
  Log:
  fixed test
  
  Revision  Changes    Path
  1.18      +25 -4     JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationContentTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyReplicationContentTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationContentTest.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- BuddyReplicationContentTest.java	27 May 2007 15:21:54 -0000	1.17
  +++ BuddyReplicationContentTest.java	26 Jun 2007 18:03:42 -0000	1.18
  @@ -250,20 +250,41 @@
         log.info("1 ** " + caches[1].printLockInfo());
         log.info("2 ** " + caches[2].printLockInfo());
   
  -
         TestingUtil.sleepThread(getSleepTimeout());
   
         assertEquals("value", caches[0].get("/2", "key"));
   
  +      log.info("0 ** " + caches[0].printLockInfo());
  +      log.info("1 ** " + caches[1].printLockInfo());
  +      log.info("2 ** " + caches[2].printLockInfo());
  +
         TestingUtil.sleepThread(getSleepTimeout());
   
         caches[1].stop();
  +      log.info("0 ** " + caches[0].printLockInfo());
  +      log.info("1 ** " + caches[1].printLockInfo());
  +      log.info("2 ** " + caches[2].printLockInfo());
   
         // cache[0] is all thats left!!
   
  -
         assertEquals("value", caches[0].get("/0", "key"));
  -      assertEquals("value", caches[1].get("/1", "key"));
  -      assertEquals("value", caches[2].get("/2", "key"));
  +
  +      try
  +      {
  +         assertEquals("value", caches[0].get("/1", "key"));
  +      }
  +      catch (Exception e)
  +      {
  +         // may barf the first time around since we are unable to contact our buddy and store this data.
  +         if (e instanceof RuntimeException)
  +         {
  +            assertEquals(IllegalArgumentException.class, e.getCause().getClass());
  +         }
  +         else throw e;
  +      }
  +
  +      // now try the assertion again since the local gravitation would have worked.
  +      assertEquals("value", caches[0].get("/1", "key"));
  +      assertEquals("value", caches[0].get("/2", "key"));
      }
   }
  
  
  



More information about the jboss-cvs-commits mailing list