activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: Ensure all PooledConnectionFactory instances are stopped at tests end to ensure that pooled connections are all closed to release VM Transport resrouces
Date Fri, 03 Jun 2016 22:29:07 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 28e7cb0b2 -> 27ce49f1c


Ensure all PooledConnectionFactory instances are stopped at tests end to
ensure that pooled connections are all closed to release VM Transport
resrouces

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/27ce49f1
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/27ce49f1
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/27ce49f1

Branch: refs/heads/master
Commit: 27ce49f1c8db0445d47ecb5cf6cc5a3d6c5fbff1
Parents: 28e7cb0
Author: Timothy Bish <tabish121@gmail.com>
Authored: Fri Jun 3 18:28:57 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Fri Jun 3 18:28:57 2016 -0400

----------------------------------------------------------------------
 .../pool/ConnectionExpiryEvictsFromPoolTest.java   | 13 +++++++++++++
 .../PooledConnectionFactoryMaximumActiveTest.java  |  2 ++
 .../jms/pool/PooledConnectionFactoryTest.java      | 17 ++++++++++++++++-
 .../jms/pool/PooledConnectionFailoverTest.java     | 13 +++++++++++++
 .../PooledConnectionSecurityExceptionTest.java     | 17 +++++++++++++++++
 .../jms/pool/PooledConnectionTempQueueTest.java    |  2 ++
 .../activemq/jms/pool/PooledConnectionTest.java    |  5 ++++-
 .../PooledSessionExhaustionBlockTimeoutTest.java   | 13 +++++++++++++
 .../jms/pool/PooledSessionExhaustionTest.java      | 13 +++++++++++++
 .../pool/PooledSessionNoPublisherCachingTest.java  | 13 +++++++++++++
 .../activemq/jms/pool/PooledSessionTest.java       | 13 +++++++++++++
 .../jms/pool/PooledTopicPublisherTest.java         | 17 +++++++++++++----
 .../activemq/jms/pool/XAConnectionPoolTest.java    |  8 ++++++++
 13 files changed, 140 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/ConnectionExpiryEvictsFromPoolTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/ConnectionExpiryEvictsFromPoolTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/ConnectionExpiryEvictsFromPoolTest.java
index be1ae5e..83bf58d 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/ConnectionExpiryEvictsFromPoolTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/ConnectionExpiryEvictsFromPoolTest.java
@@ -28,6 +28,7 @@ import javax.jms.Session;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -54,6 +55,18 @@ public class ConnectionExpiryEvictsFromPoolTest extends JmsPoolTestSupport
{
         pooledFactory.setMaxConnections(1);
     }
 
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        try {
+            pooledFactory.stop();
+        } catch (Exception ex) {
+            // ignored
+        }
+
+        super.tearDown();
+    }
+
     @Test(timeout = 60000)
     public void testEvictionOfIdle() throws Exception {
         pooledFactory.setIdleTimeout(10);

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryMaximumActiveTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryMaximumActiveTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryMaximumActiveTest.java
index 141a97d..4f36487 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryMaximumActiveTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryMaximumActiveTest.java
@@ -88,6 +88,8 @@ public class PooledConnectionFactoryMaximumActiveTest extends JmsPoolTestSupport
 
         // Take all threads down
         executor.shutdownNow();
+
+        cf.stop();
     }
 
     static class TestRunner2 implements Callable<Boolean> {

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java
index e06a6e1..7cdf2b9 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java
@@ -63,6 +63,7 @@ public class PooledConnectionFactoryTest extends JmsPoolTestSupport {
         PooledConnectionFactory pcf = new PooledConnectionFactory();
         assertTrue(pcf instanceof QueueConnectionFactory);
         assertTrue(pcf instanceof TopicConnectionFactory);
+        pcf.stop();
     }
 
     @Test(timeout = 60000)
@@ -95,6 +96,8 @@ public class PooledConnectionFactoryTest extends JmsPoolTestSupport {
         assertNotSame(conn1.getConnection(), conn2.getConnection());
         assertNotSame(conn1.getConnection(), conn3.getConnection());
         assertNotSame(conn2.getConnection(), conn3.getConnection());
+
+        cf.stop();
     }
 
     @Test(timeout = 60000)
@@ -115,6 +118,8 @@ public class PooledConnectionFactoryTest extends JmsPoolTestSupport {
         assertNotSame(conn2.getConnection(), conn3.getConnection());
 
         assertEquals(3, cf.getNumConnections());
+
+        cf.stop();
     }
 
     @Test(timeout = 60000)
@@ -138,6 +143,8 @@ public class PooledConnectionFactoryTest extends JmsPoolTestSupport {
             assertNotSame(previous, current);
             previous = current;
         }
+
+        cf.stop();
     }
 
     @Test(timeout = 60000)
@@ -157,6 +164,8 @@ public class PooledConnectionFactoryTest extends JmsPoolTestSupport {
         assertSame(conn2.getConnection(), conn3.getConnection());
 
         assertEquals(1, cf.getNumConnections());
+
+        cf.stop();
     }
 
     @Test(timeout = 60000)
@@ -308,11 +317,13 @@ public class PooledConnectionFactoryTest extends JmsPoolTestSupport
{
             Connection conn = null;
             Session one = null;
 
+            PooledConnectionFactory cf = null;
+
             // wait at most 5 seconds for the call to createSession
             try {
                 ActiveMQConnectionFactory amq = new ActiveMQConnectionFactory(
                     "vm://broker1?marshal=false&broker.persistent=false&broker.useJmx=false");
-                PooledConnectionFactory cf = new PooledConnectionFactory();
+                cf = new PooledConnectionFactory();
                 cf.setConnectionFactory(amq);
                 cf.setMaxConnections(3);
                 cf.setMaximumActiveSessionPerConnection(1);
@@ -351,6 +362,10 @@ public class PooledConnectionFactoryTest extends JmsPoolTestSupport {
             } catch (Exception ex) {
                 LOG.error(ex.getMessage());
                 return new Boolean(false);
+            } finally {
+                if (cf != null) {
+                    cf.stop();
+                }
             }
 
             // all good, test succeeded

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFailoverTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFailoverTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFailoverTest.java
index 503cc0b..7383848 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFailoverTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFailoverTest.java
@@ -34,6 +34,7 @@ import javax.jms.Session;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -57,6 +58,18 @@ public class PooledConnectionFailoverTest extends JmsPoolTestSupport {
         pooledConnFact.setReconnectOnException(true);
     }
 
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        try {
+            pooledConnFact.stop();
+        } catch (Exception ex) {
+            // ignored
+        }
+
+        super.tearDown();
+    }
+
     @Test
     public void testConnectionFailures() throws Exception {
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionSecurityExceptionTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionSecurityExceptionTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionSecurityExceptionTest.java
index a2338ed..aeaca64 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionSecurityExceptionTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionSecurityExceptionTest.java
@@ -79,6 +79,8 @@ public class PooledConnectionSecurityExceptionTest {
         connection.start();
 
         LOG.info("Successfully create new connection.");
+
+        connection.close();
     }
 
     @Test
@@ -103,6 +105,8 @@ public class PooledConnectionSecurityExceptionTest {
         connection.start();
 
         LOG.info("Successfully create new connection.");
+
+        connection.close();
     }
 
     @Test
@@ -143,7 +147,11 @@ public class PooledConnectionSecurityExceptionTest {
             fail("Should fail to connect");
         } catch (JMSSecurityException ex) {
             LOG.info("Caught expected security error");
+        } finally {
+            connection2.close();
         }
+
+        connection1.close();
     }
 
     @Test
@@ -167,6 +175,9 @@ public class PooledConnectionSecurityExceptionTest {
         }
 
         assertNotSame(connection1, connection2);
+
+        connection1.close();
+        connection2.close();
     }
 
     @Test
@@ -192,6 +203,8 @@ public class PooledConnectionSecurityExceptionTest {
         connection.start();
 
         LOG.info("Successfully create new connection.");
+
+        connection.close();
     }
 
     @Test
@@ -233,7 +246,11 @@ public class PooledConnectionSecurityExceptionTest {
         } catch (JMSSecurityException ex) {
             LOG.info("Caught expected security error");
             connection2.close();
+        } finally {
+            connection2.close();
         }
+
+        connection1.close();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTempQueueTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTempQueueTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTempQueueTest.java
index 4122527..29290e0 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTempQueueTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTempQueueTest.java
@@ -68,6 +68,8 @@ public class PooledConnectionTempQueueTest extends JmsPoolTestSupport {
         });
 
         sendWithReplyToTemp(cf, SERVICE_QUEUE);
+
+        cf.stop();
     }
 
     private void sendWithReplyToTemp(ConnectionFactory cf, String serviceQueue) throws JMSException,

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTest.java
index 8b78426..9c6e059 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionTest.java
@@ -57,10 +57,11 @@ public class PooledConnectionTest extends JmsPoolTestSupport {
             conn.setClientID("newID");
             conn.start();
             conn.close();
-            cf = null;
         } catch (IllegalStateException ise) {
             LOG.error("Repeated calls to ActiveMQConnection.setClientID(\"newID\") caused
" + ise.getMessage());
             fail("Repeated calls to ActiveMQConnection.setClientID(\"newID\") caused " +
ise.getMessage());
+        } finally {
+            ((PooledConnectionFactory) cf).stop();
         }
 
         // 2nd test: call setClientID() twice with different IDs
@@ -76,6 +77,7 @@ public class PooledConnectionTest extends JmsPoolTestSupport {
             LOG.debug("Correctly received " + ise);
         } finally {
             conn.close();
+            ((PooledConnectionFactory) cf).stop();
         }
 
         // 3rd test: try to call setClientID() after start()
@@ -90,6 +92,7 @@ public class PooledConnectionTest extends JmsPoolTestSupport {
             LOG.debug("Correctly received " + ise);
         } finally {
             conn.close();
+            ((PooledConnectionFactory) cf).stop();
         }
 
         LOG.debug("Test finished.");

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionBlockTimeoutTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionBlockTimeoutTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionBlockTimeoutTest.java
index d5457a6..fe0a7ee 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionBlockTimeoutTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionBlockTimeoutTest.java
@@ -39,6 +39,7 @@ import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
 import org.apache.log4j.Logger;
+import org.junit.After;
 import org.junit.Test;
 
 public class PooledSessionExhaustionBlockTimeoutTest extends JmsPoolTestSupport {
@@ -75,6 +76,18 @@ public class PooledSessionExhaustionBlockTimeoutTest extends JmsPoolTestSupport
         pooledFactory.setMaximumActiveSessionPerConnection(1);
     }
 
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        try {
+            pooledFactory.stop();
+        } catch (Exception ex) {
+            // ignored
+        }
+
+        super.tearDown();
+    }
+
     class TestRunner implements Runnable {
 
         CyclicBarrier barrier;

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionTest.java
index 89ee46e..b92cd39 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionExhaustionTest.java
@@ -37,6 +37,7 @@ import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
 import org.apache.log4j.Logger;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -74,6 +75,18 @@ public class PooledSessionExhaustionTest extends JmsPoolTestSupport {
         pooledFactory.setMaximumActiveSessionPerConnection(1);
     }
 
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        try {
+            pooledFactory.stop();
+        } catch (Exception ex) {
+            // ignored
+        }
+
+        super.tearDown();
+    }
+
     class TestRunner implements Runnable {
 
         CyclicBarrier barrier;

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionNoPublisherCachingTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionNoPublisherCachingTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionNoPublisherCachingTest.java
index 4719a20..e01cfb5 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionNoPublisherCachingTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionNoPublisherCachingTest.java
@@ -28,6 +28,7 @@ import javax.jms.TopicSession;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -59,6 +60,18 @@ public class PooledSessionNoPublisherCachingTest extends JmsPoolTestSupport
{
         pooledFactory.setUseAnonymousProducers(false);
     }
 
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        try {
+            pooledFactory.stop();
+        } catch (Exception ex) {
+            // ignored
+        }
+
+        super.tearDown();
+    }
+        
     @Test(timeout = 60000)
     public void testMessageProducersAreUnique() throws Exception {
         PooledConnection connection = (PooledConnection) pooledFactory.createConnection();

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionTest.java
index c689344..530beab 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledSessionTest.java
@@ -33,6 +33,7 @@ import javax.jms.TopicSession;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -64,6 +65,18 @@ public class PooledSessionTest extends JmsPoolTestSupport {
         pooledFactory.setBlockIfSessionPoolIsFull(false);
     }
 
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        try {
+            pooledFactory.stop();
+        } catch (Exception ex) {
+            // ignored
+        }
+
+        super.tearDown();
+    }
+        
     @Test(timeout = 60000)
     public void testPooledSessionStats() throws Exception {
         PooledConnection connection = (PooledConnection) pooledFactory.createConnection();

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledTopicPublisherTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledTopicPublisherTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledTopicPublisherTest.java
index c0781ba..e8f14c9 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledTopicPublisherTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledTopicPublisherTest.java
@@ -43,22 +43,31 @@ import org.junit.Test;
 public class PooledTopicPublisherTest extends JmsPoolTestSupport {
 
     private TopicConnection connection;
+    private PooledConnectionFactory pcf;
 
     @Override
     @After
     public void tearDown() throws Exception {
         if (connection != null) {
-            connection.close();
+            try {
+                connection.close();
+            } catch (Exception ex) {}
             connection = null;
         }
 
+        if (pcf != null) {
+            try {
+                pcf.stop();
+            } catch (Exception ex) {}
+        }
+
         super.tearDown();
     }
 
     @Test(timeout = 60000)
     public void testPooledConnectionFactory() throws Exception {
         ActiveMQTopic topic = new ActiveMQTopic("test");
-        PooledConnectionFactory pcf = new PooledConnectionFactory();
+        pcf = new PooledConnectionFactory();
         pcf.setConnectionFactory(new ActiveMQConnectionFactory(
             "vm://test?broker.persistent=false&broker.useJmx=false"));
 
@@ -70,7 +79,7 @@ public class PooledTopicPublisherTest extends JmsPoolTestSupport {
 
     @Test(timeout = 60000)
     public void testSetGetExceptionListener() throws Exception {
-        PooledConnectionFactory pcf = new PooledConnectionFactory();
+        pcf = new PooledConnectionFactory();
         pcf.setConnectionFactory(new ActiveMQConnectionFactory(
             "vm://test?broker.persistent=false&broker.useJmx=false"));
 
@@ -97,7 +106,7 @@ public class PooledTopicPublisherTest extends JmsPoolTestSupport {
 
         SocketProxy proxy = new SocketProxy(networkConnector.getConnectUri());
 
-        PooledConnectionFactory pcf = new PooledConnectionFactory();
+        pcf = new PooledConnectionFactory();
         String uri = proxy.getUrl().toString() + "?trace=true&wireFormat.maxInactivityDuration=500&wireFormat.maxInactivityDurationInitalDelay=500";
         pcf.setConnectionFactory(new ActiveMQConnectionFactory(uri));
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/27ce49f1/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/XAConnectionPoolTest.java
----------------------------------------------------------------------
diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/XAConnectionPoolTest.java
b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/XAConnectionPoolTest.java
index 6944414..be13d37 100644
--- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/XAConnectionPoolTest.java
+++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/XAConnectionPoolTest.java
@@ -156,6 +156,8 @@ public class XAConnectionPoolTest extends JmsPoolTestSupport {
             sync.afterCompletion(1);
         }
         connection.close();
+
+        pcf.stop();
     }
 
     @Test(timeout = 60000)
@@ -256,6 +258,7 @@ public class XAConnectionPoolTest extends JmsPoolTestSupport {
             sync.afterCompletion(1);
         }
         connection.close();
+        pcf.stop();
     }
 
     @Test(timeout = 60000)
@@ -263,6 +266,7 @@ public class XAConnectionPoolTest extends JmsPoolTestSupport {
         XaPooledConnectionFactory pcf = new XaPooledConnectionFactory();
         assertTrue(pcf instanceof QueueConnectionFactory);
         assertTrue(pcf instanceof TopicConnectionFactory);
+        pcf.stop();
     }
 
     @Test(timeout = 60000)
@@ -271,6 +275,7 @@ public class XAConnectionPoolTest extends JmsPoolTestSupport {
         assertTrue(pcf instanceof ObjectFactory);
         assertTrue(((ObjectFactory)pcf).getObjectInstance(null, null, null, null) instanceof
XaPooledConnectionFactory);
         assertTrue(pcf.isTmFromJndi());
+        pcf.stop();
     }
 
     @Test(timeout = 60000)
@@ -281,6 +286,7 @@ public class XAConnectionPoolTest extends JmsPoolTestSupport {
         environment.put("tmFromJndi", String.valueOf(Boolean.FALSE));
         assertTrue(((ObjectFactory) pcf).getObjectInstance(null, null, null, environment)
instanceof XaPooledConnectionFactory);
         assertFalse(pcf.isTmFromJndi());
+        pcf.stop();
     }
 
     @Test(timeout = 60000)
@@ -302,6 +308,7 @@ public class XAConnectionPoolTest extends JmsPoolTestSupport {
         assertNotNull(topicPublisher.getTopic().getTopicName());
 
         topicConnection.close();
+        pcf.stop();
     }
 
     @Test(timeout = 60000)
@@ -362,6 +369,7 @@ public class XAConnectionPoolTest extends JmsPoolTestSupport {
         assertNotNull("can create session(false, 0)", connection.createQueueSession(false,
0));
 
         connection.close();
+        pcf.stop();
     }
 
     static class XAConnectionFactoryOnly implements XAConnectionFactory {


Mime
View raw message