summaryrefslogtreecommitdiff
path: root/qpid/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
commita64cf149101cb9361207a478259adad1a89be099 (patch)
tree6c0a5d6cc0b0d5ee24022e49d7561965d54e6bb2 /qpid/java/client/src/test
parent3f174e5128a673f97481f346ca41ab494a6af9d9 (diff)
downloadqpid-python-a64cf149101cb9361207a478259adad1a89be099.tar.gz
QPID-204 : Implement TemporaryTopic.delete
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@487804 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client/src/test')
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java b/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
index 3b6e3517c2..80de66735c 100644
--- a/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
+++ b/qpid/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);