Skip to content

Commit

Permalink
Do a bit more resource cleanup on tearDown
Browse files Browse the repository at this point in the history
  • Loading branch information
tabish121 committed Jun 15, 2016
1 parent f595f3c commit 0b65c8d
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -53,6 +54,15 @@ protected void setUp() throws Exception {
super.setUp();
}

@Override
protected void tearDown() throws Exception {
if (cx2 != null) {
cx2.close();
}

super.tearDown();
}

@Override
protected void setSessionTransacted() {
resourceProvider.setTransacted(false);
Expand Down Expand Up @@ -90,7 +100,7 @@ public void testRepeatReceiveTwoThenRollback() throws Exception {
protected void reconnect() throws Exception {
super.reconnect();
xares[0] = getXAResource(connection);
ManagedConnectionProxy cx2 = (ManagedConnectionProxy) connectionFactory.createConnection();
cx2 = (ManagedConnectionProxy) connectionFactory.createConnection();
xares[1] = getXAResource(cx2);
}

Expand Down

0 comments on commit 0b65c8d

Please sign in to comment.