[hornetq-commits] JBoss hornetq SVN: r11259 - in branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration: spring and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Aug 31 12:07:12 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-08-31 12:07:12 -0400 (Wed, 31 Aug 2011)
New Revision: 11259

Modified:
   branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
   branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/spring/SpringIntegrationTest.java
Log:
fixing thread leaks

Modified: branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java	2011-08-31 12:54:38 UTC (rev 11258)
+++ branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java	2011-08-31 16:07:12 UTC (rev 11259)
@@ -94,6 +94,8 @@
    protected void setUp() throws Exception
    {
       super.setUp();
+      
+      forceGC();
 
       UnitTestCase.checkFreePort(ClusterTestBase.PORTS);
 
@@ -2040,7 +2042,6 @@
          log.info("started server " + node);
 
          waitForServer(servers[node]);
-         Thread.sleep(100);
 
       }
 
@@ -2055,6 +2056,7 @@
             for (ClusterConnection cc : servers[node].getClusterManager().getClusterConnections())
             {
                cc.stop();
+               cc.flushExecutor();
             }
          }
       }

Modified: branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/spring/SpringIntegrationTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/spring/SpringIntegrationTest.java	2011-08-31 12:54:38 UTC (rev 11258)
+++ branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/spring/SpringIntegrationTest.java	2011-08-31 16:07:12 UTC (rev 11259)
@@ -2,6 +2,7 @@
 
 import junit.framework.Assert;
 
+import org.hornetq.core.logging.Logger;
 import org.hornetq.jms.client.HornetQConnectionFactory;
 import org.hornetq.jms.server.embedded.EmbeddedJMS;
 import org.hornetq.tests.util.UnitTestCase;
@@ -15,6 +16,16 @@
  */
 public class SpringIntegrationTest extends UnitTestCase
 {
+   Logger log = Logger.getLogger(SpringIntegrationTest.class);
+   
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      // Need to force GC as the connection on the spring needs to be cleared
+      // otherwise the sprint thread may leak here
+      forceGC();
+   }
+   
    public void testSpring() throws Exception
    {
       System.out.println("Creating bean factory...");



More information about the hornetq-commits mailing list