Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7C7B62004C8 for ; Mon, 9 May 2016 21:15:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7B0D91609A8; Mon, 9 May 2016 19:15:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C3B4916099C for ; Mon, 9 May 2016 21:15:50 +0200 (CEST) Received: (qmail 25833 invoked by uid 500); 9 May 2016 19:15:50 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 25824 invoked by uid 99); 9 May 2016 19:15:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 May 2016 19:15:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D6AC0DFB38; Mon, 9 May 2016 19:15:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Message-Id: <9849054d490e48b7a94f9499c28e72b3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: 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. Date: Mon, 9 May 2016 19:15:49 +0000 (UTC) archived-at: Mon, 09 May 2016 19:15:51 -0000 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 Authored: Mon May 9 15:15:30 2016 -0400 Committer: Timothy Bish 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();