Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35390172C9 for ; Wed, 25 Feb 2015 16:36:18 +0000 (UTC) Received: (qmail 13840 invoked by uid 500); 25 Feb 2015 16:36:18 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 13810 invoked by uid 500); 25 Feb 2015 16:36:18 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 13797 invoked by uid 99); 25 Feb 2015 16:36:18 -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; Wed, 25 Feb 2015 16:36:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0282FE03F7; Wed, 25 Feb 2015 16:36:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: robbie@apache.org To: commits@qpid.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: qpid-jms git commit: add a condition check, make the test more deterministic Date: Wed, 25 Feb 2015 16:36:18 +0000 (UTC) Repository: qpid-jms Updated Branches: refs/heads/master bfb107db9 -> 2888373a1 add a condition check, make the test more deterministic Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/2888373a Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/2888373a Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/2888373a Branch: refs/heads/master Commit: 2888373a102b22a1855bf735a09041326fd26081 Parents: bfb107d Author: Robert Gemmell Authored: Wed Feb 25 16:35:51 2015 +0000 Committer: Robert Gemmell Committed: Wed Feb 25 16:35:51 2015 +0000 ---------------------------------------------------------------------- .../qpid/jms/integration/ConnectionIntegrationTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/2888373a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java index 921265d..4db603e 100644 --- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java +++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java @@ -37,7 +37,9 @@ import javax.jms.MessageConsumer; import javax.jms.Queue; import javax.jms.Session; +import org.apache.qpid.jms.JmsConnection; import org.apache.qpid.jms.test.QpidJmsTestCase; +import org.apache.qpid.jms.test.Wait; import org.apache.qpid.jms.test.testpeer.TestAmqpPeer; import org.apache.qpid.jms.test.testpeer.matchers.CoordinatorMatcher; import org.apache.qpid.proton.amqp.transaction.TxnCapability; @@ -127,7 +129,7 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase { @Test(timeout = 5000) public void testRemotelyEndConnectionWithSessionWithConsumer() throws Exception { try (TestAmqpPeer testPeer = new TestAmqpPeer();) { - Connection connection = testFixture.establishConnecton(testPeer); + final Connection connection = testFixture.establishConnecton(testPeer); testPeer.expectBegin(true); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -141,6 +143,12 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase { MessageConsumer consumer = session.createConsumer(queue); testPeer.waitForAllHandlersToComplete(1000); + assertTrue("connection never closed.", Wait.waitFor(new Wait.Condition() { + @Override + public boolean isSatisified() throws Exception { + return !((JmsConnection) connection).isConnected(); + } + }, 1000, 10)); // Verify the session is now marked closed try { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org