Author: clebert.suconic(a)jboss.com
Date: 2010-11-16 15:11:51 -0500 (Tue, 16 Nov 2010)
New Revision: 9895
Modified:
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
Log:
fixing test
Modified:
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
---
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2010-11-16
16:34:05 UTC (rev 9894)
+++
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2010-11-16
20:11:51 UTC (rev 9895)
@@ -359,6 +359,8 @@
System.out.println("queueName is: " + queueName);
+ Connection connection = null;
+
try
{
startHornetQServer(NettyAcceptorFactory.class.getName());
@@ -372,7 +374,7 @@
ConnectionFactory cf1 =
JMSUtil.createFactory(NettyConnectorFactory.class.getName(),
JMSServerControl2Test.CONNECTION_TTL,
JMSServerControl2Test.PING_PERIOD);
- Connection connection = cf1.createConnection();
+ connection = cf1.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(queue);
@@ -408,6 +410,7 @@
assertTrue(sessInfos.length > 0);
boolean lastMsgFound = false;
+ Thread.sleep(1000);
for (JMSSessionInfo sInfo : sessInfos)
{
System.out.println("Session name: " + sInfo.getSessionID());
@@ -434,11 +437,23 @@
}
finally
{
- if (serverManager != null)
+ try
{
- serverManager.destroyQueue(queueName);
- serverManager.stop();
+ if (connection != null)
+ {
+ connection.close();
+ }
+
+ if (serverManager != null)
+ {
+ serverManager.destroyQueue(queueName);
+ serverManager.stop();
+ }
}
+ catch (Throwable ignored)
+ {
+ ignored.printStackTrace();
+ }
if (server != null)
{