diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2009-06-22 13:21:50 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2009-06-22 13:21:50 +0000 |
| commit | 669e4215a0b455c4cc98c8132d73b4d31f363e1d (patch) | |
| tree | ccfe388213c8bf2abf5c38ceea35fec00bd7bb62 /java/systests/src | |
| parent | f058de0f9c944bb38c2dfd0e53b5a52d3026434c (diff) | |
| download | qpid-python-669e4215a0b455c4cc98c8132d73b4d31f363e1d.tar.gz | |
QPID-1923: made createDurableSubscriber fail on a temporary topic
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@787231 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src')
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java index cbe25e4f32..c5cdb83bbf 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java @@ -37,6 +37,7 @@ import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; +import javax.jms.Topic; import javax.jms.TopicSubscriber; /** @@ -389,6 +390,32 @@ public class DurableSubscriptionTest extends QpidTestCase session.unsubscribe("testResubscribeWithChangedSelector"); } + public void testDurableSubscribeWithTemporaryTopic() throws Exception + { + Connection conn = getConnection(); + conn.start(); + Session ssn = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); + Topic topic = ssn.createTemporaryTopic(); + try + { + ssn.createDurableSubscriber(topic, "test"); + fail("expected InvalidDestinationException"); + } + catch (InvalidDestinationException ex) + { + // this is expected + } + try + { + ssn.createDurableSubscriber(topic, "test", null, false); + fail("expected InvalidDestinationException"); + } + catch (InvalidDestinationException ex) + { + // this is expected + } + } + private void sendMatchingAndNonMatchingMessage(Session session, MessageProducer producer) throws JMSException { TextMessage msg = session.createTextMessage("testResubscribeWithChangedSelector1"); |
