Author: mircea.markus
Date: 2008-12-12 04:22:34 -0500 (Fri, 12 Dec 2008)
New Revision: 7310
Modified:
core/trunk/src/test/java/org/jboss/cache/api/CacheSPITest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java
core/trunk/src/test/java/org/jboss/cache/util/internals/replicationlisteners/ReplicationListener.java
Log:
made replication listeners more stronger
Modified: core/trunk/src/test/java/org/jboss/cache/api/CacheSPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/CacheSPITest.java 2008-12-12 08:57:24 UTC
(rev 7309)
+++ core/trunk/src/test/java/org/jboss/cache/api/CacheSPITest.java 2008-12-12 09:22:34 UTC
(rev 7310)
@@ -55,13 +55,13 @@
cache2.start();
memb1 = cache1.getMembers();
- TestingUtil.blockUntilViewsReceived(5000, false, cache1, cache2);
+ TestingUtil.blockUntilViewsReceived(10000, false, cache1, cache2);
List memb2 = cache2.getMembers();
assertEquals("View has two members", 2, memb1.size());
assertEquals("Both caches have same view", memb1, memb2);
cache1.stop();
- TestingUtil.blockUntilViewsReceived(5000, false, cache2);
+ TestingUtil.blockUntilViewsReceived(10000, false, cache2);
memb2 = cache2.getMembers();
assertEquals("View has one member", 1, memb2.size());
assertFalse("Coordinator changed", coord.equals(memb2.get(0)));
Modified:
core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java 2008-12-12
08:57:24 UTC (rev 7309)
+++
core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java 2008-12-12
09:22:34 UTC (rev 7310)
@@ -139,7 +139,10 @@
// cleanup
TestingUtil.extractComponentRegistry(cache1).registerComponent(originalRpcManager,
RPCManager.class);
TestingUtil.extractComponentRegistry(cache1).rewire();
+
+ replListener2.expect(RemoveNodeCommand.class);
cache1.removeNode(fqn);
+ replListener2.waitForReplicationToOccur();
}
public void testTxSuspension() throws Exception
@@ -284,7 +287,7 @@
tm1.begin();
cache1.putForExternalRead(fqn, key, value);
tm1.commit();
- replListener2.waitForReplicationToOccur(10000);
+ replListener2.waitForReplicationToOccur();
assert cache1.getTransactionTable().getNumGlobalTransactions() == 0 : "Cache 1
should have no stale global TXs";
@@ -362,7 +365,10 @@
verify(rpcManager);
// cleanup
cache1.getConfiguration().getRuntimeConfig().setRPCManager(originalRpcManager);
+
+ replListener2.expect(RemoveNodeCommand.class);
cache1.removeNode(fqn);
+ replListener2.waitForReplicationToOccur();
}
protected abstract void assertLocked(Fqn fqn, CacheSPI cache, boolean writeLocked);
Modified:
core/trunk/src/test/java/org/jboss/cache/util/internals/replicationlisteners/ReplicationListener.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/util/internals/replicationlisteners/ReplicationListener.java 2008-12-12
08:57:24 UTC (rev 7309)
+++
core/trunk/src/test/java/org/jboss/cache/util/internals/replicationlisteners/ReplicationListener.java 2008-12-12
09:22:34 UTC (rev 7310)
@@ -58,7 +58,6 @@
*/
abstract public class ReplicationListener
{
-
public static final long DEFAULT_TIMEOUT = 10000;
private CountDownLatch latch = new CountDownLatch(1);
protected List<Class<? extends ReplicableCommand>> expectedCommands;
@@ -195,6 +194,7 @@
}
finally
{
+ System.out.println("Processed command: " + realOne);
if (realOne instanceof ReplicateCommand)
{
postReplicateExecution((ReplicateCommand)realOne);
Show replies by date