You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2016/05/09 19:15:49 UTC

activemq git commit: Add waitFor to check that once the async processing kicks in the pool clears the bad connection and a new one is returned from the pool.

Repository: activemq
Updated Branches:
  refs/heads/master 7bdcca1bd -> 100c5e0b5


Add waitFor to check that once the async processing kicks in the pool
clears the bad connection and a new one is returned from the pool.

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

Branch: refs/heads/master
Commit: 100c5e0b59ec33dfa43de4956d490e074a92ccbe
Parents: 7bdcca1
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon May 9 15:15:30 2016 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon May 9 15:15:43 2016 -0400

----------------------------------------------------------------------
 .../pool/PooledConnectionSecurityExceptionTest.java    | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/100c5e0b/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 377c210..e18d356 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
@@ -106,8 +106,8 @@ public class PooledConnectionSecurityExceptionTest {
     }
 
     @Test
-    public void testFailureGetsNewConnectionOnRetry() throws JMSException {
-        Connection connection1 = pooledConnFact.createConnection("invalid", "credentials");
+    public void testFailureGetsNewConnectionOnRetry() throws Exception {
+        final Connection connection1 = pooledConnFact.createConnection("invalid", "credentials");
 
         try {
             connection1.start();
@@ -116,6 +116,15 @@ public class PooledConnectionSecurityExceptionTest {
             LOG.info("Caught expected security error");
         }
 
+        // The pool should process the async error
+        assertTrue("Should get new connection", Wait.waitFor(new Wait.Condition() {
+
+            @Override
+            public boolean isSatisified() throws Exception {
+                return connection1 != pooledConnFact.createConnection("invalid", "credentials");
+            }
+        }));
+
         Connection connection2 = pooledConnFact.createConnection("invalid", "credentials");
         try {
             connection2.start();