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

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Jan 19 05:49:16 EST 2009


Author: mircea.markus
Date: 2009-01-19 05:49:16 -0500 (Mon, 19 Jan 2009)
New Revision: 7506

Modified:
   core/trunk/src/test/java/org/jboss/cache/passivation/ReplAndStateTransferWithPassivationTest.java
Log:
more strict replication control

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/ReplAndStateTransferWithPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/ReplAndStateTransferWithPassivationTest.java	2009-01-19 09:42:32 UTC (rev 7505)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/ReplAndStateTransferWithPassivationTest.java	2009-01-19 10:49:16 UTC (rev 7506)
@@ -22,7 +22,9 @@
 package org.jboss.cache.passivation;
 
 import org.jboss.cache.*;
+import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
 import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
+import org.jboss.cache.buddyreplication.BuddyReplicationTestsBase;
 import org.jboss.cache.config.BuddyReplicationConfig;
 import org.jboss.cache.config.CacheLoaderConfig;
 import org.jboss.cache.config.Configuration;
@@ -31,12 +33,13 @@
 import org.jboss.cache.factories.UnitTestConfigurationFactory;
 import org.jboss.cache.loader.testloaders.DummySharedInMemoryCacheLoader;
 import org.jboss.cache.util.TestingUtil;
+import org.jboss.cache.util.internals.replicationlisteners.ReplicationListener;
 import org.testng.annotations.Test;
 
 import java.util.HashSet;
 import java.util.Set;
 
- at Test(groups = "functional", sequential = true, testName = "passivation.ReplAndStateTransferWithPassivationTest")
+ at Test(groups = "functional", testName = "passivation.ReplAndStateTransferWithPassivationTest")
 public class ReplAndStateTransferWithPassivationTest
 {
    public void testStateTransferOfPassivatedState() throws Exception
@@ -142,13 +145,21 @@
          cache1.evict(A);
 
          cache2 = new UnitTestCacheFactory().createCache(buildConf(nls, "cache2", false, useBR, true), getClass());
+         TestingUtil.blockUntilViewReceived((CacheSPI)cache2, 2, 10000);
+
          if (useBR)
          {
+            BuddyReplicationTestsBase.waitForSingleBuddy(cache1, cache2);
             Set backupNameSet = new HashSet(nameSet);
             backupNameSet.remove(BuddyFqnTransformer.BUDDY_BACKUP_SUBTREE);
+
+            ReplicationListener replListener1 = ReplicationListener.getReplicationListener(cache1);
+            replListener1.expect(DataGravitationCleanupCommand.class);
             cache2.getInvocationContext().getOptionOverrides().setForceDataGravitation(true);
             Node backupNode = cache2.getNode(fqn);
-            assert backupNode.getChildrenNames().equals(backupNameSet) : "Expecting " + backupNameSet + " but got " + backupNode.getChildrenNames();
+            replListener1.waitForReplicationToOccur();
+
+           assert backupNode.getChildrenNames().equals(backupNameSet) : "Expecting " + backupNameSet + " but got " + backupNode.getChildrenNames();
          }
          else
          {




More information about the jbosscache-commits mailing list