[jboss-cvs] JBoss Messaging SVN: r3643 - in branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms: server and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 29 22:33:27 EST 2008


Author: miclark
Date: 2008-01-29 22:33:27 -0500 (Tue, 29 Jan 2008)
New Revision: 3643

Removed:
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/server/endpoint/
Modified:
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/TemporaryDestinationTest.java
Log:
Moved test for [JBMESSAGING-1215] from org.jboss.test.messaging.jms.server.endpoint.ServerConnectionEndpointTest to org.jboss.test.messaging.jms.TemporaryDestinationTest. Since this was the only test in ServerConnectionEndpointTest, it was removed.

Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/TemporaryDestinationTest.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/TemporaryDestinationTest.java	2008-01-30 03:33:09 UTC (rev 3642)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/TemporaryDestinationTest.java	2008-01-30 03:33:27 UTC (rev 3643)
@@ -21,7 +21,10 @@
   */
 package org.jboss.test.messaging.jms;
 
+import java.util.Set;
+
 import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -33,7 +36,10 @@
 import javax.naming.NamingException;
 
 import org.jboss.jms.message.MessageProxy;
+import org.jboss.jms.server.DestinationManager;
 
+import org.jboss.test.messaging.tools.ServerManagement;
+
 /**
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
@@ -549,7 +555,34 @@
    	}
    }
 
+   /**
+    * Verifies that a created TemporaryQueue is deleted when the associated
+    * connection is closed (JBMESSAGING-1215).
+    */
+   public void testDeleteTemporaryQueueOnClose() throws Exception
+   {
+      ConnectionFactory factory = (ConnectionFactory) ic.lookup("ConnectionFactory");
+      Connection connection = factory.createConnection();
 
+      Session responseSession = connection.createSession(false,
+            Session.AUTO_ACKNOWLEDGE);
+
+      TemporaryQueue tempQueue = responseSession.createTemporaryQueue();
+      log.info("Created TemporaryQueue: " + tempQueue);
+      
+      DestinationManager dm = ServerManagement.getDestinationManager();
+      Set destinations = dm.getDestinations();
+      log.info("Destinations after temp queue creation: " + destinations);
+      
+      assertTrue("Temporary destination is not registered in destination manager.", destinations.contains(tempQueue));
+      
+      connection.close();
+      
+      destinations = dm.getDestinations();
+      log.info("Destinations after connection.close(): " + destinations);
+      assertTrue("Temporary destination is registered in destination manager.", ! destinations.contains(tempQueue)); 
+   }
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------




More information about the jboss-cvs-commits mailing list