[hornetq-commits] JBoss hornetq SVN: r7910 - trunk/tests/src/org/hornetq/tests/integration/jms.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Aug 25 06:12:07 EDT 2009


Author: jmesnil
Date: 2009-08-25 06:12:07 -0400 (Tue, 25 Aug 2009)
New Revision: 7910

Modified:
   trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
Log:
Manual Reconnection test

* checked that the client reconnects to the server after it is restarted

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java	2009-08-24 14:56:53 UTC (rev 7909)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java	2009-08-25 10:12:07 UTC (rev 7910)
@@ -85,6 +85,8 @@
 
    private CountDownLatch exceptionLatch = new CountDownLatch(1);
 
+   private CountDownLatch reconnectionLatch = new CountDownLatch(1);
+
    private boolean afterRestart = false;
 
    private boolean receivedMessagesAfterRestart = false;
@@ -157,6 +159,8 @@
             Thread.sleep(5000);
             restartServer();
             afterRestart = true;
+            boolean clientReconnected = reconnectionLatch.await(10, SECONDS);
+            assertTrue("client did not reconnect after server was restarted", clientReconnected);
          }
       }
 
@@ -327,6 +331,7 @@
          consumer = session.createConsumer(topic);
          consumer.setMessageListener(listener);
          connection.start();
+         reconnectionLatch.countDown();
       }
       catch (Exception e)
       {



More information about the hornetq-commits mailing list