Author: clebert.suconic(a)jboss.com
Date: 2012-01-05 13:24:11 -0500 (Thu, 05 Jan 2012)
New Revision: 11981
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java
Log:
test fix (no code changes)
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java 2012-01-05
17:48:44 UTC (rev 11980)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java 2012-01-05
18:24:11 UTC (rev 11981)
@@ -68,11 +68,21 @@
protected void assertActiveConnections(final int expectedActiveConnections) throws
Exception
{
+ long timeout = System.currentTimeMillis() + 5000;
+ while (timeout > System.currentTimeMillis() &&
server.getHornetQServerControl().getConnectionCount() != expectedActiveConnections)
+ {
+ Thread.sleep(100);
+ }
Assert.assertEquals(expectedActiveConnections,
server.getHornetQServerControl().getConnectionCount());
}
protected void assertActiveSession(final int expectedActiveSession) throws Exception
{
+ long timeout = System.currentTimeMillis() + 5000;
+ while (timeout > System.currentTimeMillis() &&
server.getSessions().size() != expectedActiveSession)
+ {
+ Thread.sleep(100);
+ }
Assert.assertEquals(expectedActiveSession, server.getSessions().size());
}