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 <[email protected]> Authored: Wed Feb 25 16:35:51 2015 +0000 Committer: Robert Gemmell <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
