Author: clebert.suconic(a)jboss.com
Date: 2011-07-07 01:33:22 -0400 (Thu, 07 Jul 2011)
New Revision: 10942
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverOnFlowControlTest.java
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/TestableServer.java
Log:
Fixing tests
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverOnFlowControlTest.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverOnFlowControlTest.java 2011-07-07
00:15:00 UTC (rev 10941)
+++
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverOnFlowControlTest.java 2011-07-07
05:33:22 UTC (rev 10942)
@@ -86,7 +86,7 @@
InVMConnection.flushEnabled = false;
try
{
- crash(sessionList.get(0));
+ crash(false, sessionList.get(0));
}
finally
{
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-07-07
00:15:00 UTC (rev 10941)
+++
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-07-07
05:33:22 UTC (rev 10942)
@@ -400,6 +400,11 @@
liveServer.crash(sessions);
}
+ protected void crash(final boolean waitFailure, final ClientSession... sessions)
throws Exception
+ {
+ liveServer.crash(waitFailure, sessions);
+ }
+
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java 2011-07-07
00:15:00 UTC (rev 10941)
+++
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java 2011-07-07
05:33:22 UTC (rev 10942)
@@ -116,6 +116,11 @@
public void crash(ClientSession... sessions) throws Exception
{
+ crash(true, sessions);
+ }
+
+ public void crash(final boolean waitFailure, ClientSession... sessions) throws
Exception
+ {
final CountDownLatch latch = new CountDownLatch(sessions.length);
class MyListener implements SessionFailureListener
@@ -140,10 +145,13 @@
serverProcess = null;
}
- // Wait to be informed of failure
- boolean ok = latch.await(10000, TimeUnit.MILLISECONDS);
-
- Assert.assertTrue(ok);
+ if (waitFailure)
+ {
+ // Wait to be informed of failure
+ boolean ok = latch.await(10000, TimeUnit.MILLISECONDS);
+
+ Assert.assertTrue(ok);
+ }
}
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-07-07
00:15:00 UTC (rev 10941)
+++
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-07-07
05:33:22 UTC (rev 10942)
@@ -81,6 +81,11 @@
public void crash(ClientSession... sessions) throws Exception
{
+ crash(true, sessions);
+ }
+
+ public void crash(boolean waitFailure, ClientSession... sessions) throws Exception
+ {
final CountDownLatch latch = new CountDownLatch(sessions.length);
class MyListener implements SessionFailureListener
@@ -105,6 +110,12 @@
clusterManager.clear();
server.stop(true);
+ if (waitFailure)
+ {
+ // Wait to be informed of failure
+ boolean ok = latch.await(10000, TimeUnit.MILLISECONDS);
+ Assert.assertTrue(ok);
+ }
}
/* (non-Javadoc)
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/TestableServer.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/TestableServer.java 2011-07-07
00:15:00 UTC (rev 10941)
+++
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/util/TestableServer.java 2011-07-07
05:33:22 UTC (rev 10942)
@@ -34,6 +34,8 @@
public void stop() throws Exception;
public void crash(ClientSession... sessions) throws Exception;
+
+ public void crash(boolean waitFailure, ClientSession... sessions) throws Exception;
public boolean isInitialised();
Show replies by date