Repository: qpid-jms Updated Branches: refs/heads/master 17694619c -> bfb107db9
tweak test to allow adding the remote-close action before the connection is established, help prevent failure due to race-to-add Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/bfb107db Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/bfb107db Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/bfb107db Branch: refs/heads/master Commit: bfb107db928fff04cf74ee542a8482c2c8645f0e Parents: 1769461 Author: Robert Gemmell <[email protected]> Authored: Wed Feb 25 16:27:15 2015 +0000 Committer: Robert Gemmell <[email protected]> Committed: Wed Feb 25 16:27:15 2015 +0000 ---------------------------------------------------------------------- .../jms/integration/ConnectionIntegrationTest.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bfb107db/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 19f3abf..921265d 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 @@ -100,7 +100,13 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase { try (TestAmqpPeer testPeer = new TestAmqpPeer();) { final CountDownLatch done = new CountDownLatch(1); - Connection connection = testFixture.establishConnecton(testPeer); + // Don't set a ClientId, so that the underlying AMQP connection isn't established yet + Connection connection = testFixture.establishConnecton(testPeer, null, null, null, false); + + // Tell the test peer to close the connection when executing its last handler + testPeer.remotelyEndConnection(true); + + //Add the exception listener connection.setExceptionListener(new ExceptionListener() { @Override @@ -109,11 +115,12 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase { } }); - testPeer.remotelyEndConnection(true); + // Trigger the underlying AMQP connection + connection.start(); assertTrue("Connection should report failure", done.await(5, TimeUnit.SECONDS)); - testPeer.waitForAllHandlersToComplete(5000); + testPeer.waitForAllHandlersToComplete(1000); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
