[hornetq-commits] JBoss hornetq SVN: r10102 - trunk/tests/src/org/hornetq/tests/integration/spring.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Jan 1 20:43:28 EST 2011


Author: clebert.suconic at jboss.com
Date: 2011-01-01 20:43:27 -0500 (Sat, 01 Jan 2011)
New Revision: 10102

Modified:
   trunk/tests/src/org/hornetq/tests/integration/spring/SpringIntegrationTest.java
Log:
tweaks

Modified: trunk/tests/src/org/hornetq/tests/integration/spring/SpringIntegrationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/spring/SpringIntegrationTest.java	2011-01-02 00:57:33 UTC (rev 10101)
+++ trunk/tests/src/org/hornetq/tests/integration/spring/SpringIntegrationTest.java	2011-01-02 01:43:27 UTC (rev 10102)
@@ -16,15 +16,27 @@
    public void testSpring() throws Exception
    {
       System.out.println("Creating bean factory...");
-      ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring-jms-beans.xml"});
-      MessageSender sender = (MessageSender)context.getBean("MessageSender");
-      System.out.println("Sending message...");
-      sender.send("Hello world");
-      Thread.sleep(100);
-      Assert.assertEquals(ExampleListener.lastMessage, "Hello world");
-      
-      EmbeddedJMS jms = (EmbeddedJMS) context.getBean("EmbeddedJms");
-      jms.stop();
-      
+      ApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "spring-jms-beans.xml" });
+      try
+      {
+         MessageSender sender = (MessageSender)context.getBean("MessageSender");
+         System.out.println("Sending message...");
+         sender.send("Hello world");
+         Thread.sleep(100);
+         Assert.assertEquals(ExampleListener.lastMessage, "Hello world");
+      }
+      finally
+      {
+         try
+         {
+            EmbeddedJMS jms = (EmbeddedJMS)context.getBean("EmbeddedJms");
+            jms.stop();
+         }
+         catch (Throwable ignored)
+         {
+            ignored.printStackTrace();
+         }
+      }
+
    }
 }



More information about the hornetq-commits mailing list