[jboss-cvs] JBoss Messaging SVN: r1387 - trunk/tests/src/org/jboss/test/messaging/jms

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 28 19:58:09 EDT 2006


Author: ovidiu.feodorov at jboss.com
Date: 2006-09-28 19:58:08 -0400 (Thu, 28 Sep 2006)
New Revision: 1387

Modified:
   trunk/tests/src/org/jboss/test/messaging/jms/DurableSubscriberTest.java
Log:
extra test used while investigating http://jira.jboss.org/jira/browse/JBMESSAGING-564

Modified: trunk/tests/src/org/jboss/test/messaging/jms/DurableSubscriberTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/DurableSubscriberTest.java	2006-09-28 23:56:52 UTC (rev 1386)
+++ trunk/tests/src/org/jboss/test/messaging/jms/DurableSubscriberTest.java	2006-09-28 23:58:08 UTC (rev 1387)
@@ -33,6 +33,7 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
 import javax.management.ObjectName;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -458,7 +459,32 @@
          // OK
       }
    }
-   
+
+   /**
+    * See http://jira.jboss.org/jira/browse/JBMESSAGING-564
+    */
+   public void testUnsubscribe() throws Exception
+   {
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
+      Topic topic = (Topic)ic.lookup("/topic/Topic");
+
+      Connection conn = cf.createConnection();
+      conn.setClientID("zeke");
+
+      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      TopicSubscriber dursub = s.createDurableSubscriber(topic, "dursub0");
+
+      s.unsubscribe("dursub0");
+
+      // TODO - what happens with dursub? It is not closed, but its associated subscriber does
+      //        not exist anymore.
+
+      dursub.close();
+
+      conn.close();
+   }
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------




More information about the jboss-cvs-commits mailing list