[hornetq-commits] JBoss hornetq SVN: r11668 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Nov 8 10:17:56 EST 2011


Author: borges
Date: 2011-11-08 10:17:56 -0500 (Tue, 08 Nov 2011)
New Revision: 11668

Modified:
   trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterTest.java
   trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
Log:
make sure test will clean up properly

Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterTest.java	2011-11-08 15:17:39 UTC (rev 11667)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterTest.java	2011-11-08 15:17:56 UTC (rev 11668)
@@ -18,11 +18,11 @@
 
 /**
  * A SymmetricClusterTest
- * 
+ *
  * Most of the cases are covered in OneWayTwoNodeClusterTest - we don't duplicate them all here
  *
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * 
+ *
  * Created 3 Feb 2009 09:10:43
  *
  *
@@ -43,9 +43,14 @@
    protected void tearDown() throws Exception
    {
       log.info("#test tearDown");
-      stopServers();
-
-      super.tearDown();
+      try
+      {
+         stopServers();
+      }
+      finally
+      {
+         super.tearDown();
+      }
    }
 
    protected boolean isNetty()
@@ -1085,7 +1090,7 @@
    public void testRouteWhenNoConsumersFalseNoLocalConsumerLoadBalancedQueues() throws Exception
    {
       setupCluster(false);
-      
+
       startServers();
 
       for (int i = 0 ; i <= 4; i++)
@@ -1382,7 +1387,7 @@
    {
       doTestStartStopServers(1, 3000);
    }
-   
+
    public void doTestStartStopServers(long pauseBeforeServerRestarts, long pauseAfterServerRestarts) throws Exception
    {
       setupCluster();
@@ -1478,7 +1483,7 @@
       System.out.println(clusterDescription(servers[3]));
       System.out.println(clusterDescription(servers[4]));
       System.out.println("#####################################");
-      
+
       waitForBindings(0, "queues.testaddress", 23, 23, false);
       waitForBindings(1, "queues.testaddress", 23, 23, false);
       waitForBindings(2, "queues.testaddress", 23, 23, false);
@@ -1521,9 +1526,9 @@
       System.out.println(clusterDescription(servers[3]));
       System.out.println(clusterDescription(servers[4]));
       System.out.println("#####################################");
-      
+
       Thread.sleep(pauseBeforeServerRestarts);
-      
+
       startServers(3, 0);
 
       Thread.sleep(pauseAfterServerRestarts);
@@ -1572,7 +1577,7 @@
       waitForBindings(2, "queues.testaddress", 5, 5, true);
       waitForBindings(3, "queues.testaddress", 6, 6, true);
       waitForBindings(4, "queues.testaddress", 7, 7, true);
-      
+
       System.out.println("### after servers 0 & 3 restarted ###");
       System.out.println(clusterDescription(servers[0]));
       System.out.println(clusterDescription(servers[1]));
@@ -1716,12 +1721,12 @@
       closeSessionFactory(0);
 
       stopServers(0);
-      
+
       waitForBindings(1, "queues.testaddress", 5, 5, true);
       waitForBindings(2, "queues.testaddress", 5, 5, true);
       waitForBindings(3, "queues.testaddress", 6, 6, true);
       waitForBindings(4, "queues.testaddress", 7, 7, true);
-      
+
       waitForBindings(1, "queues.testaddress", 18, 18, false);
       waitForBindings(2, "queues.testaddress", 18, 18, false);
       waitForBindings(3, "queues.testaddress", 17, 17, false);
@@ -1737,11 +1742,11 @@
       closeSessionFactory(1);
 
       stopServers(1);
-      
+
       waitForBindings(2, "queues.testaddress", 5, 5, true);
       waitForBindings(3, "queues.testaddress", 6, 6, true);
       waitForBindings(4, "queues.testaddress", 7, 7, true);
-      
+
       waitForBindings(2, "queues.testaddress", 13, 13, false);
       waitForBindings(3, "queues.testaddress", 12, 12, false);
       waitForBindings(4, "queues.testaddress", 11, 11, false);
@@ -1756,10 +1761,10 @@
       closeSessionFactory(2);
 
       stopServers(2);
-      
+
       waitForBindings(3, "queues.testaddress", 6, 6, true);
       waitForBindings(4, "queues.testaddress", 7, 7, true);
-      
+
       waitForBindings(3, "queues.testaddress", 7, 7, false);
       waitForBindings(4, "queues.testaddress", 6, 6, false);
 
@@ -1774,9 +1779,9 @@
       closeSessionFactory(3);
 
       stopServers(3);
-      
+
       waitForBindings(4, "queues.testaddress", 7, 7, true);
-      
+
       waitForBindings(4, "queues.testaddress", 0, 0, false);
    }
 
@@ -1822,12 +1827,11 @@
 
       stopServers(0, 1, 2, 3, 4);
    }
-   
 
+
+   @Override
    protected boolean isFileStorage()
    {
       return false;
    }
-
-
 }

Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java	2011-11-08 15:17:39 UTC (rev 11667)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java	2011-11-08 15:17:56 UTC (rev 11668)
@@ -27,17 +27,13 @@
 
 /**
  * A SymmetricClusterWithBackupTest
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * 
- * Created 13 Mar 2009 11:00:31
- *
- *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a> Created 13 Mar 2009 11:00:31
  */
 public class SymmetricClusterWithBackupTest extends SymmetricClusterTest
 {
    private static final Logger log = Logger.getLogger(SymmetricClusterWithBackupTest.class);
 
+   @Override
    public void testStopAllStartAll() throws Throwable
    {
       try
@@ -129,12 +125,6 @@
          verifyReceiveRoundRobinInSomeOrder(10, 0, 1, 2, 3, 4);
 
          verifyNotReceive(0, 1, 2, 3, 4);
-
-         closeAllConsumers();
-
-         closeAllSessionFactories();
-
-         closeAllServerLocatorsFactories();
       }
       catch (Throwable e)
       {
@@ -256,12 +246,6 @@
       verifyReceiveRoundRobinInSomeOrder(10, 23, 24, 25);
 
       verifyReceiveRoundRobinInSomeOrder(10, 26, 27);
-
-      closeAllConsumers();
-
-      closeAllSessionFactories();
-
-      closeAllServerLocatorsFactories();
    }
 
    //@Override
@@ -460,12 +444,6 @@
       verifyReceiveRoundRobinInSomeOrder(10, 23, 24, 25);
 
       verifyReceiveRoundRobinInSomeOrder(10, 26, 27);
-
-      closeAllConsumers();
-
-      closeAllSessionFactories();
-
-      closeAllServerLocatorsFactories();
    }
 
    @Override



More information about the hornetq-commits mailing list