From do-not-reply at jboss.org Thu Aug 4 22:36:17 2011 Content-Type: multipart/mixed; boundary="===============8768787097631943119==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: hornetq-commits at lists.jboss.org Subject: [hornetq-commits] JBoss hornetq SVN: r11128 - branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/spring. Date: Thu, 04 Aug 2011 22:36:17 -0400 Message-ID: <201108050236.p752aHRf014079@svn01.web.mwc.hst.phx2.redhat.com> --===============8768787097631943119== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: clebert.suconic(a)jboss.com Date: 2011-08-04 22:36:17 -0400 (Thu, 04 Aug 2011) New Revision: 11128 Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integ= ration/spring/MessageSender.java branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integ= ration/spring/SpringIntegrationTest.java Log: fixing thread leakage on test Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/test= s/integration/spring/MessageSender.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/inte= gration/spring/MessageSender.java 2011-08-05 00:56:43 UTC (rev 11127) +++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/inte= gration/spring/MessageSender.java 2011-08-05 02:36:17 UTC (rev 11128) @@ -47,6 +47,7 @@ MessageProducer producer =3D session.createProducer(destination); TextMessage message =3D session.createTextMessage(msg); producer.send(message); + conn.close(); } catch (Exception ex) { Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/test= s/integration/spring/SpringIntegrationTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/inte= gration/spring/SpringIntegrationTest.java 2011-08-05 00:56:43 UTC (rev 1112= 7) +++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/inte= gration/spring/SpringIntegrationTest.java 2011-08-05 02:36:17 UTC (rev 1112= 8) @@ -2,10 +2,12 @@ = import junit.framework.Assert; = +import org.hornetq.jms.client.HornetQConnectionFactory; import org.hornetq.jms.server.embedded.EmbeddedJMS; import org.hornetq.tests.util.UnitTestCase; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.jms.listener.DefaultMessageListenerContainer; = /** * @author Bill Burke @@ -24,11 +26,21 @@ sender.send("Hello world"); Thread.sleep(100); Assert.assertEquals(ExampleListener.lastMessage, "Hello world"); + ((HornetQConnectionFactory)sender.getConnectionFactory()).close(); } finally { try { + DefaultMessageListenerContainer container =3D (DefaultMessageL= istenerContainer)context.getBean("listenerContainer"); + container.stop(); + } + catch (Throwable ignored) + { + ignored.printStackTrace(); + } + try + { EmbeddedJMS jms =3D (EmbeddedJMS)context.getBean("EmbeddedJms"= ); jms.stop(); } --===============8768787097631943119==--