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:32 UTC

[1/2] qpid-jms git commit: NO-JIRA: move existing test to a more applicable location

Repository: qpid-jms
Updated Branches:
  refs/heads/master de50d9df5 -> 6553cfd5b


NO-JIRA: move existing test to a more applicable location


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/88a9afcc
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/88a9afcc
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/88a9afcc

Branch: refs/heads/master
Commit: 88a9afccf24356a21c8a8698c10a8045630efd10
Parents: de50d9d
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Sep 12 10:19:13 2016 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Mon Sep 12 10:19:13 2016 +0100

----------------------------------------------------------------------
 .../integration/ConsumerIntegrationTest.java    | 29 ++++++++++++++++++++
 .../jms/integration/SessionIntegrationTest.java | 27 ------------------
 2 files changed, 29 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/88a9afcc/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConsumerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConsumerIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConsumerIntegrationTest.java
index 8c3bbfc..c8914ae 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConsumerIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConsumerIntegrationTest.java
@@ -41,6 +41,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
 
 import org.apache.qpid.jms.JmsConnection;
 import org.apache.qpid.jms.JmsDefaultConnectionListener;
@@ -288,6 +289,34 @@ public class ConsumerIntegrationTest extends QpidJmsTestCase {
         }
     }
 
+    @Test(timeout = 20000)
+    public void testCloseDurableTopicSubscriberDetachesWithCloseFalse() 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);
+
+            testPeer.expectDetach(false, true, false);
+            subscriber.close();
+
+            testPeer.expectClose();
+            connection.close();
+
+            testPeer.waitForAllHandlersToComplete(1000);
+        }
+    }
+
     @Test(timeout=20000)
     public void testCloseDurableSubscriberWithUnackedAnUnconsumedPrefetchedMessages() throws Exception {
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/88a9afcc/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 15c5ee5..ccb55c0 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
@@ -1228,33 +1228,6 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
         }
     }
 
-    @Test(timeout = 20000)
-    public void testCloseDurableTopicSubscriberDetachesWithCloseFalse() 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);
-
-            testPeer.expectDetach(false, true, false);
-            subscriber.close();
-
-            testPeer.expectClose();
-            connection.close();
-
-            testPeer.waitForAllHandlersToComplete(1000);
-        }
-    }
 
     @Test(timeout = 20000)
     public void testCreateAnonymousProducerWhenAnonymousRelayNodeIsSupported() throws Exception {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[2/2] qpid-jms git commit: NO-JIRA: add a test verifying durable subscriber link is not closed during session close

Posted by ro...@apache.org.
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