summaryrefslogtreecommitdiff
path: root/java/client/src/test
diff options
context:
space:
mode:
authorRobert Greig <rgreig@apache.org>2006-12-16 14:22:01 +0000
committerRobert Greig <rgreig@apache.org>2006-12-16 14:22:01 +0000
commit159db77661f43cbe78bec888019002c9632ad256 (patch)
tree0d15eda16f9271ffb56a03f51ae0ecb7b3df80de /java/client/src/test
parentd9aa5a9c9a8622e12ebc897222b6c0f38676f3e4 (diff)
downloadqpid-python-159db77661f43cbe78bec888019002c9632ad256.tar.gz
QPID-204 : Implement TemporaryTopic.delete
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@487804 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src/test')
-rw-r--r--java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
index 3b6e3517c2..80de66735c 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
@@ -200,6 +200,45 @@ public class TopicSessionTest extends TestCase
con.close();
}
+ public void testTempoaryTopic() throws Exception
+ {
+ AMQConnection conn = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test", "/test");
+ TopicSession session = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+ TemporaryTopic topic = session.createTemporaryTopic();
+ assertNotNull(topic);
+ TopicPublisher producer = session.createPublisher(topic);
+ MessageConsumer consumer = session.createConsumer(topic);
+ conn.start();
+ producer.send(session.createTextMessage("hello"));
+ TextMessage tm = (TextMessage) consumer.receive(2000);
+ assertNotNull(tm);
+ assertEquals("hello",tm.getText());
+
+ try
+ {
+ topic.delete();
+ fail("Expected JMSException : should not be able to delete while there are active consumers");
+ }
+ catch(JMSException je)
+ {
+ ; //pass
+ }
+
+ consumer.close();
+
+ try
+ {
+ topic.delete();
+ }
+ catch(JMSException je)
+ {
+ fail("Unexpected Exception: " + je.getMessage());
+ }
+
+ conn.close();
+ }
+
+
public static junit.framework.Test suite()
{
return new junit.framework.TestSuite(TopicSessionTest.class);