Do a bit more resource cleanup on tearDown

This commit is contained in:
Timothy Bish 2016-06-15 19:15:21 -04:00
parent f595f3c20d
commit 0b65c8d93c
1 changed files with 11 additions and 1 deletions

View File

@ -41,6 +41,7 @@ public class JmsXARollback2CxTransactionTest extends JmsQueueTransactionTest {
private static final String DEFAULT_HOST = "vm://localhost?create=false";
private ManagedConnectionProxy cx2;
private ConnectionManagerAdapter connectionManager = new ConnectionManagerAdapter();
private static long txGenerator;
private Xid xid;
@ -53,6 +54,15 @@ public class JmsXARollback2CxTransactionTest extends JmsQueueTransactionTest {
super.setUp();
}
@Override
protected void tearDown() throws Exception {
if (cx2 != null) {
cx2.close();
}
super.tearDown();
}
@Override
protected void setSessionTransacted() {
resourceProvider.setTransacted(false);
@ -90,7 +100,7 @@ public class JmsXARollback2CxTransactionTest extends JmsQueueTransactionTest {
protected void reconnect() throws Exception {
super.reconnect();
xares[0] = getXAResource(connection);
ManagedConnectionProxy cx2 = (ManagedConnectionProxy) connectionFactory.createConnection();
cx2 = (ManagedConnectionProxy) connectionFactory.createConnection();
xares[1] = getXAResource(cx2);
}