[jbosscache-commits] JBoss Cache SVN: r5926 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Jun 2 11:20:57 EDT 2008


Author: mircea.markus
Date: 2008-06-02 11:20:57 -0400 (Mon, 02 Jun 2008)
New Revision: 5926

Modified:
   core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyAssignmentStateTransferTest.java
Log:
rolledback thread sleeps removals - new view propagation does not necesarily mean that state transfer is finished

Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyAssignmentStateTransferTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyAssignmentStateTransferTest.java	2008-06-02 15:05:58 UTC (rev 5925)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyAssignmentStateTransferTest.java	2008-06-02 15:20:57 UTC (rev 5926)
@@ -41,7 +41,7 @@
       caches.add(createCache(1, "TEST", false, true));
 
       TestingUtil.blockUntilViewsReceived(caches.toArray(new CacheSPI[0]), VIEW_BLOCK_TIMEOUT);
-//      TestingUtil.sleepThread(getSleepTimeout());
+      TestingUtil.sleepThread(getSleepTimeout());
 
       Fqn<String> test = BuddyFqnTransformer.getBackupFqn(caches.get(0).getLocalAddress(), main);
 
@@ -50,18 +50,17 @@
       caches.add(createCache(1, "TEST", false, true));
 
       TestingUtil.blockUntilViewsReceived(caches.toArray(new CacheSPI[0]), VIEW_BLOCK_TIMEOUT);
-//      TestingUtil.sleepThread(getSleepTimeout());
+      TestingUtil.sleepThread(getSleepTimeout());
 
       assertNull("State not transferred", caches.get(2).get(test, "name"));
 
       // Make 2 the buddy of 0
       caches.get(1).stop();
-      caches.remove(1);
-      TestingUtil.blockUntilViewsReceived(caches.toArray(new CacheSPI[0]), VIEW_BLOCK_TIMEOUT);
+      caches.set(1, null);
 
-//      TestingUtil.sleepThread(getSleepTimeout());
+      TestingUtil.sleepThread(getSleepTimeout());
 
-      assertEquals("State transferred", "Joe", caches.get(1).get(test, "name"));
+      assertEquals("State transferred", "Joe", caches.get(2).get(test, "name"));
    }
 
    public void testRegionBasedStateTransfer() throws Exception
@@ -89,7 +88,7 @@
       caches.get(3).start();
 
       TestingUtil.blockUntilViewsReceived(caches.toArray(new CacheSPI[0]), VIEW_BLOCK_TIMEOUT);
-//      TestingUtil.sleepThread(getSleepTimeout());
+      TestingUtil.sleepThread(getSleepTimeout());
 
       Fqn fqnA = Fqn.fromString("/a");
       Fqn fqnD = Fqn.fromString("/d");
@@ -161,7 +160,7 @@
       caches.get(1).start();
 
       TestingUtil.blockUntilViewsReceived(caches.toArray(new CacheSPI[0]), VIEW_BLOCK_TIMEOUT);
-//      TestingUtil.sleepThread(getSleepTimeout());
+      TestingUtil.sleepThread(getSleepTimeout());
 
       Fqn test = BuddyFqnTransformer.getBackupFqn(caches.get(0).getLocalAddress(), main);
 




More information about the jbosscache-commits mailing list