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

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Jan 20 11:12:13 EST 2009


Author: mircea.markus
Date: 2009-01-20 11:12:13 -0500 (Tue, 20 Jan 2009)
New Revision: 7536

Modified:
   core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java
Log:
more strict replication controll

Modified: core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java	2009-01-20 15:42:05 UTC (rev 7535)
+++ core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java	2009-01-20 16:12:13 UTC (rev 7536)
@@ -7,10 +7,12 @@
 import org.jboss.cache.RPCManager;
 import org.jboss.cache.UnitTestCacheFactory;
 import org.jboss.cache.commands.ReplicableCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.factories.ComponentRegistry;
 import org.jboss.cache.util.TestingUtil;
 import org.jboss.cache.util.internals.ReplicationQueueNotifier;
+import org.jboss.cache.util.internals.replicationlisteners.ReplicationListener;
 import org.jgroups.Address;
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertNotNull;
@@ -29,6 +31,7 @@
    ReplicationQueue replQ;
    ComponentRegistry registry;
    RPCManager originalRpcManager;
+   private ReplicationListener replicationListener;
 
    protected void createCaches() throws Throwable
    {
@@ -45,6 +48,7 @@
       cache2 = new UnitTestCacheFactory<Object, Object>().createCache(cache.getConfiguration().clone(), getClass());
       registerCaches(cache, cache2);
       TestingUtil.blockUntilViewsReceived(60000, cache, cache2);
+      replicationListener = ReplicationListener.getReplicationListener(cache2);
    }
 
    @AfterMethod
@@ -162,10 +166,10 @@
       {
          cache.put("/a/b/c" + i, "key", "value");
          assertNotNull(cache.get("/a/b/c" + i, "key"));
+         replicationListener.expect(PutKeyValueCommand.class);
       }
-      ReplicationQueueNotifier notifier = new ReplicationQueueNotifier(cache);
-      notifier.waitUntillAllReplicated(500);
-//      TestingUtil.sleepThread(500);
+      replicationListener.waitForReplicationToOccur();
+
       for (int i = 0; i < COUNT; i++) assertNotNull("on get i = " + i, cache2.get("/a/b/c" + i, "key"));
    }
 }




More information about the jbosscache-commits mailing list