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

Manik Surtani manik at jboss.org
Fri May 25 12:34:51 EDT 2007


  User: msurtani
  Date: 07/05/25 12:34:51

  Modified:    tests/functional/org/jboss/cache/buddyreplication  
                        BuddyReplicationFailoverTest.java
                        BuddyReplicationTestsBase.java
  Log:
  Fixed some pretty nasty BR issues
  
  Revision  Changes    Path
  1.22      +15 -8     JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationFailoverTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyReplicationFailoverTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationFailoverTest.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -b -r1.21 -r1.22
  --- BuddyReplicationFailoverTest.java	23 May 2007 10:28:56 -0000	1.21
  +++ BuddyReplicationFailoverTest.java	25 May 2007 16:34:51 -0000	1.22
  @@ -34,8 +34,8 @@
      {
         caches = createCaches(3, false, true, optimisticLocks);
   
  -      String fqn = "/test";
  -      String backupFqn = "/" + BuddyManager.BUDDY_BACKUP_SUBTREE + "/" + BuddyManager.getGroupNameFromAddress(caches[0].getLocalAddress()) + fqn;
  +      Fqn fqn = Fqn.fromString("/test");
  +      Fqn backupFqn = BuddyManager.getBackupFqn(caches[0].getLocalAddress(), fqn);
   
         dumpCacheContents(caches);
   
  @@ -51,15 +51,22 @@
         assertTrue("Should be false", !caches[1].exists(fqn));
         assertTrue("Should be false", !caches[2].exists(fqn));
   
  -      assertNull("Should be null", caches[0].get(backupFqn, key));
  -      assertEquals("Value should exist", value, caches[1].get(backupFqn, key));
  -      assertNull("Should be null", caches[2].get(backupFqn, key));
  +      assertFalse("Should be false", caches[0].exists(backupFqn));
  +      assertTrue("Value be true", caches[1].exists(backupFqn));
  +      assertFalse("Should be false", caches[2].exists(backupFqn));
   
         if (killOwner)
         {
  +         System.out.println("***** About to kill original data owner (" + caches[0].getLocalAddress() + ").  *****");
  +         // make sure the JGroups channel shutdown is forced.
  +//         System.setProperty("org.jboss.cache.shutdown.force", "true");
            caches[0].stop();
            caches[0] = null;
  -         TestingUtil.sleepThread(500);
  +         // wait up to 5 mins?  :S
  +         TestingUtil.blockUntilViewsReceived(5 * 60 * 1000, false, caches[1], caches[2]);
  +
  +//         TestingUtil.sleepThread(600000);
  +//         TestingUtil.sleepThread(1000);
         }
   
         System.out.println("***** Killed original data owner, about to call a get on a different cache instance.  *****");
  
  
  
  1.47      +1 -0      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.46
  retrieving revision 1.47
  diff -u -b -r1.46 -r1.47
  --- BuddyReplicationTestsBase.java	25 May 2007 12:38:26 -0000	1.46
  +++ BuddyReplicationTestsBase.java	25 May 2007 16:34:51 -0000	1.47
  @@ -39,6 +39,7 @@
      protected void tearDown() throws Exception
      {
         System.out.println("***** TEARING DOWN *****");
  +      System.setProperty("org.jboss.cache.shutdown.force", "true");
         if (caches != null)
         {
            for (CacheImpl c : caches)
  
  
  



More information about the jboss-cvs-commits mailing list