diff --git a/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionTest.java b/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionTest.java index 862ea34b17..5e51bec5ed 100644 --- a/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionTest.java +++ b/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionTest.java @@ -84,7 +84,9 @@ public class PooledConnectionTest extends TestCase { Assert.fail("calling ActiveMQConnection.setClientID() twice with different clientID must raise an IllegalStateException"); } catch (IllegalStateException ise) { log.debug("Correctly received " + ise); - } + } finally { + conn.close(); + } // 3rd test: try to call setClientID() after start() // should result in an exception @@ -96,7 +98,9 @@ public class PooledConnectionTest extends TestCase { Assert.fail("Calling setClientID() after start() mut raise a JMSException."); } catch (IllegalStateException ise) { log.debug("Correctly received " + ise); - } + } finally { + conn.close(); + } log.debug("Test finished."); }