Author: timfox
Date: 2009-08-22 07:38:25 -0400 (Sat, 22 Aug 2009)
New Revision: 7886
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
Log:
make test more sturdy
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java 2009-08-22
11:14:59 UTC (rev 7885)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java 2009-08-22
11:38:25 UTC (rev 7886)
@@ -304,8 +304,22 @@
try
{
Context initialContext = context;
- Topic topic = (Topic)initialContext.lookup(topicName);
- ConnectionFactory cf =
(ConnectionFactory)initialContext.lookup("/cf");
+ Topic topic;
+ ConnectionFactory cf;
+ while (true)
+ {
+ try
+ {
+ topic = (Topic)initialContext.lookup(topicName);
+ cf = (ConnectionFactory)initialContext.lookup("/cf");
+ break;
+ }
+ catch (Exception e)
+ {
+ //retry until server is up
+ Thread.sleep(100);
+ }
+ }
connection = cf.createConnection();
connection.setExceptionListener(exceptionListener);
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Show replies by date