You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2015/09/24 21:19:28 UTC
qpid-jms git commit: NO-JIRA move a broker agnostic test into the
client integration tests
Repository: qpid-jms
Updated Branches:
refs/heads/master b2e99092e -> 208ab4c9b
NO-JIRA move a broker agnostic test into the client integration tests
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/208ab4c9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/208ab4c9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/208ab4c9
Branch: refs/heads/master
Commit: 208ab4c9b8b729a64bda44b03b7c60c6b0c79eaf
Parents: b2e9909
Author: Timothy Bish <ta...@gmail.com>
Authored: Thu Sep 24 15:19:13 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Thu Sep 24 15:19:13 2015 -0400
----------------------------------------------------------------------
.../jms/integration/SessionIntegrationTest.java | 33 ++++++++++++++++++++
.../jms/consumer/JmsDurableSubscriberTest.java | 26 ---------------
2 files changed, 33 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/208ab4c9/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 f17f446..dbccd2e 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
@@ -606,6 +606,39 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
}
@Test(timeout = 20000)
+ public void testDurableSubscriptionUnsubscribeInUseThrowsJMSEx() 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);
+
+ try {
+ session.unsubscribe(subscriptionName);
+ fail("Should have thrown a JMSException");
+ } catch (JMSException ex) {
+ }
+
+ testPeer.expectDetach(false, true, false);
+
+ subscriber.close();
+
+ testPeer.waitForAllHandlersToComplete(1000);
+ }
+ }
+
+ @Test(timeout = 20000)
public void testCreateDurableTopicSubscriberFailsIfConnectionDoesntHaveExplicitClientID() throws Exception {
try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
// Create a connection without an explicit clientId
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/208ab4c9/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsDurableSubscriberTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsDurableSubscriberTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsDurableSubscriberTest.java
index e2bcb5b..596a4ee 100644
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsDurableSubscriberTest.java
+++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsDurableSubscriberTest.java
@@ -126,32 +126,6 @@ public class JmsDurableSubscriberTest extends AmqpTestSupport {
}
@Test(timeout = 60000)
- public void testDurableSubscriptionUnsubscribeInUseThrowsJMSEx() throws Exception {
- connection = createAmqpConnection();
- connection.setClientID("DURABLE-AMQP");
- connection.start();
-
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- assertNotNull(session);
- Topic topic = session.createTopic(name.getMethodName());
- MessageConsumer consumer = session.createDurableSubscriber(topic, getSubscriptionName());
- assertNotNull(consumer);
-
- BrokerViewMBean broker = getProxyToBroker();
- assertEquals(1, broker.getDurableTopicSubscribers().length);
- assertEquals(0, broker.getInactiveDurableTopicSubscribers().length);
-
- try {
- session.unsubscribe(getSubscriptionName());
- fail("Should have thrown a JMSException");
- } catch (JMSException ex) {
- }
-
- assertEquals(1, broker.getDurableTopicSubscribers().length);
- assertEquals(0, broker.getInactiveDurableTopicSubscribers().length);
- }
-
- @Test(timeout = 60000)
public void testDurableSubscriptionUnsubscribeInUseThrowsAndRecovers() throws Exception {
connection = createAmqpConnection();
connection.setClientID("DURABLE-AMQP");
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org