Repository: qpid-jms Updated Branches: refs/heads/master 7a0439e43 -> e7f34c733
add test of durable subscriber close, ensure the underlying AMQP link does not detach with close=true Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/e7f34c73 Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/e7f34c73 Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/e7f34c73 Branch: refs/heads/master Commit: e7f34c73336330b014c46a1646f1ad7fcb00310c Parents: 7a0439e Author: Robert Gemmell <[email protected]> Authored: Thu Nov 13 09:47:24 2014 +0000 Committer: Robert Gemmell <[email protected]> Committed: Thu Nov 13 09:51:28 2014 +0000 ---------------------------------------------------------------------- .../jms/integration/SessionIntegrationTest.java | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/e7f34c73/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java index 95dc6fc..5a4a754 100644 --- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java +++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java @@ -143,6 +143,31 @@ public class SessionIntegrationTest extends QpidJmsTestCase { } @Test(timeout = 5000) + public void testCloseDurableTopicSubscriberDetachesWithCloseFalse() throws Exception { + try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) { + Connection connection = testFixture.establishConnecton(testPeer); + connection.start(); + + testPeer.expectBegin(true); + Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + + String topicName = "myTopic"; + Topic dest = session.createTopic(topicName); + String subscriptionName = "mySubscription"; + + testPeer.expectDurableSubscriberAttach(topicName, subscriptionName); + testPeer.expectLinkFlow(); + + TopicSubscriber subscriber = session.createDurableSubscriber(dest, subscriptionName); + + testPeer.expectDetach(false, true, false); + subscriber.close(); + + testPeer.waitForAllHandlersToComplete(1000); + } + } + + @Test(timeout = 5000) public void testCreateAnonymousProducerWhenAnonymousRelayNodeIsSupported() throws Exception { try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) { Connection connection = testFixture.establishConnecton(testPeer); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
