diff --git a/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java b/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java index 860b4f41d2..2eb85bf123 100644 --- a/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java +++ b/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionExpiryEvictsFromPoolTest.java @@ -34,6 +34,7 @@ public class ConnectionExpiryEvictsFromPoolTest extends TestSupport { protected void setUp() throws Exception { broker = new BrokerService(); + broker.setUseJmx(false); broker.setPersistent(false); TransportConnector connector = broker.addConnector("tcp://localhost:0"); broker.start(); @@ -46,32 +47,32 @@ public class ConnectionExpiryEvictsFromPoolTest extends TestSupport { pooledFactory.setIdleTimeout(10); PooledConnection connection = (PooledConnection) pooledFactory.createConnection(); ActiveMQConnection amq1 = connection.getConnection(); - + connection.close(); // let it idle timeout TimeUnit.SECONDS.sleep(1); - + PooledConnection connection2 = (PooledConnection) pooledFactory.createConnection(); ActiveMQConnection amq2 = connection2.getConnection(); assertTrue("not equal", !amq1.equals(amq2)); } - - + + public void testEvictionOfExpired() throws Exception { pooledFactory.setExpiryTimeout(10); Connection connection = pooledFactory.createConnection(); ActiveMQConnection amq1 = ((PooledConnection) connection).getConnection(); - + // let it expire while in use TimeUnit.SECONDS.sleep(1); connection.close(); - + Connection connection2 = pooledFactory.createConnection(); ActiveMQConnection amq2 = ((PooledConnection) connection2).getConnection(); assertTrue("not equal", !amq1.equals(amq2)); } - - + + protected void tearDown() throws Exception { broker.stop(); } diff --git a/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java b/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java index c338fa492e..c02eb18a1f 100644 --- a/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java +++ b/activemq-pool/src/test/java/org/apache/activemq/pool/ConnectionFailureEvictsFromPoolTest.java @@ -44,6 +44,7 @@ public class ConnectionFailureEvictsFromPoolTest extends TestSupport { protected void setUp() throws Exception { broker = new BrokerService(); + broker.setUseJmx(false); broker.setPersistent(false); TransportConnector connector = broker.addConnector("tcp://localhost:0"); broker.start(); @@ -68,7 +69,7 @@ public class ConnectionFailureEvictsFromPoolTest extends TestSupport { public void transportResumed() { } }); - + sendMessage(connection); LOG.info("sent one message worked fine"); createConnectionFailure(connection); diff --git a/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java b/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java index bd57ba1778..ed13e2f3e2 100644 --- a/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java +++ b/activemq-pool/src/test/java/org/apache/activemq/pool/PooledConnectionFactoryWithTemporaryDestinationsTest.java @@ -42,6 +42,7 @@ public class PooledConnectionFactoryWithTemporaryDestinationsTest extends TestSu protected void setUp() throws Exception { broker = new BrokerService(); + broker.setUseJmx(false); broker.setPersistent(false); TransportConnector connector = broker.addConnector("tcp://localhost:0"); broker.start(); @@ -60,29 +61,29 @@ public class PooledConnectionFactoryWithTemporaryDestinationsTest extends TestSu Session session2 = null; Queue tempQueue = null; Queue normalQueue = null; - + pooledConnection = pooledFactory.createConnection(); session = pooledConnection.createSession(false, Session.AUTO_ACKNOWLEDGE); tempQueue = session.createTemporaryQueue(); LOG.info("Created queue named: " + tempQueue.getQueueName()); - + assertEquals(1, countBrokerTemporaryQueues()); - + pooledConnection2 = pooledFactory.createConnection(); session2 = pooledConnection2.createSession(false, Session.AUTO_ACKNOWLEDGE); normalQueue = session2.createQueue("queue:FOO.TEST"); - LOG.info("Created queue named: " + normalQueue.getQueueName()); + LOG.info("Created queue named: " + normalQueue.getQueueName()); // didn't create a temp queue on pooledConnection2 so we should still have a temp queue - pooledConnection2.close(); + pooledConnection2.close(); assertEquals(1, countBrokerTemporaryQueues()); - - // after closing pooledConnection, where we created the temp queue, there should + + // after closing pooledConnection, where we created the temp queue, there should // be no temp queues left - pooledConnection.close(); + pooledConnection.close(); assertEquals(0, countBrokerTemporaryQueues()); } - + public void testTemporaryQueueLeakAfterConnectionClose() throws Exception { Connection pooledConnection = null; Session session = null;