[jboss-cvs] JBossAS SVN: r67900 - trunk/testsuite/src/main/org/jboss/test/mdb/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 4 12:18:11 EST 2007


Author: adrian at jboss.org
Date: 2007-12-04 12:18:11 -0500 (Tue, 04 Dec 2007)
New Revision: 67900

Modified:
   trunk/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java
Log:
Fix the problem of things not getting undeployed in the mdb unit test case

Modified: trunk/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java	2007-12-04 16:45:14 UTC (rev 67899)
+++ trunk/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java	2007-12-04 17:18:11 UTC (rev 67900)
@@ -291,27 +291,53 @@
                            "jboss.messaging.destination:service=Queue,name=DLQ"),
                      "removeAllMessages", new Object[0], new String[0]);
             }
-            catch (Exception e)
+            catch (Exception ignored)
             {
-               e.printStackTrace();
+               getLog().warn("unable to clear dlq", ignored);
             }
 
             ClassLoader loader = Thread.currentThread().getContextClassLoader();
-            undeploy("mdb.jar");
+            try
+            {
+               undeploy("mdb.jar");
+            }
+            catch (Exception ignored)
+            {
+               getLog().warn("Unable to undeploy mdb.jar", ignored);
+            }
 
-            // Remove the durable subscription
-            TopicConnectionFactory topicFactory = (TopicConnectionFactory) getInitialContext()
-                  .lookup(TOPIC_FACTORY);
-            TopicConnection topicConnection = topicFactory
-                  .createTopicConnection("john", "needle");
-            TopicSession session = topicConnection.createTopicSession(false,
-                  Session.AUTO_ACKNOWLEDGE);
-            session.unsubscribe("DurableSubscriberExample");
-            topicConnection.close();
+            try
+            {
+               // Remove the durable subscription
+               TopicConnectionFactory topicFactory = (TopicConnectionFactory) getInitialContext()
+                     .lookup(TOPIC_FACTORY);
+               TopicConnection topicConnection = topicFactory
+                     .createTopicConnection("john", "needle");
+               try
+               {
+                  TopicSession session = topicConnection.createTopicSession(false,
+                     Session.AUTO_ACKNOWLEDGE);
+                  session.unsubscribe("DurableSubscriberExample");
+               }
+               finally
+               {
+                  topicConnection.close();
+               }
+            }
+            catch (Exception ignored)
+            {
+               getLog().warn("Unable to unsubscribe", ignored);
+            }
 
-            undeploy(loader.getResource(
+            try
+            {
+               undeploy(loader.getResource(
                   "messaging/test-destinations-full-service.xml").toString());
-
+            }
+            catch (Exception ignored)
+            {
+               getLog().warn("Unable to remove destinations", ignored);
+            }
          }
       };
 




More information about the jboss-cvs-commits mailing list