ensure connection is closed - fix intermittent failure

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1442172 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2013-02-04 16:50:53 +00:00
parent 0d529af312
commit 274d228114
1 changed files with 2 additions and 1 deletions

View File

@ -46,6 +46,7 @@ public class FailoverUpdateURIsTest extends TestCase {
BrokerService bs1 = null;
BrokerService bs2 = null;
@Override
public void tearDown() throws Exception {
if (connection != null) {
connection.close();
@ -123,7 +124,7 @@ public class FailoverUpdateURIsTest extends TestCase {
bs1.start();
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("failover:(" + firstTcpUri + ")");
Connection connection = cf.createConnection();
connection = cf.createConnection();
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Queue theQueue = session.createQueue(QUEUE_NAME);