[hornetq-commits] JBoss hornetq SVN: r11981 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jan 5 13:24:12 EST 2012


Author: clebert.suconic at 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());
    }
 



More information about the hornetq-commits mailing list