You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2016/09/12 09:32:33 UTC
[2/2] qpid-jms git commit: NO-JIRA: add a test verifying durable
subscriber link is not closed during session close
NO-JIRA: add a test verifying durable subscriber link is not closed during session close
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/6553cfd5
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/6553cfd5
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/6553cfd5
Branch: refs/heads/master
Commit: 6553cfd5b549354e4ab6a95e3c08d6b83b259346
Parents: 88a9afc
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Sep 12 10:19:22 2016 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Mon Sep 12 10:26:42 2016 +0100
----------------------------------------------------------------------
.../jms/integration/SessionIntegrationTest.java | 32 ++++++++++++++++++++
1 file changed, 32 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/6553cfd5/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 ccb55c0..7bf35e4 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
@@ -1167,6 +1167,35 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
}
@Test(timeout = 20000)
+ public void testCloseSessionWithExistingDurableTopicSubscriberDoesNotCloseSubscriberLink() throws Exception {
+ try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
+ Connection connection = testFixture.establishConnecton(testPeer);
+ connection.start();
+
+ testPeer.expectBegin();
+ 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);
+ assertNotNull("TopicSubscriber object was null", subscriber);
+
+ testPeer.expectEnd();
+ session.close();
+
+ testPeer.expectClose();
+ connection.close();
+
+ testPeer.waitForAllHandlersToComplete(1000);
+ }
+ }
+
+ @Test(timeout = 20000)
public void testDurableSubscriptionUnsubscribeInUseThrowsJMSEx() throws Exception {
try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
Connection connection = testFixture.establishConnecton(testPeer);
@@ -1195,6 +1224,9 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
subscriber.close();
+ testPeer.expectClose();
+ connection.close();
+
testPeer.waitForAllHandlersToComplete(1000);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org