[hornetq-commits] JBoss hornetq SVN: r11103 - in branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster: restart and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Aug 3 16:06:42 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-08-03 16:06:41 -0400 (Wed, 03 Aug 2011)
New Revision: 11103

Modified:
   branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
   branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
   branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterTest.java
   branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
   branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java
   branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java
Log:
tweaks on tests

Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java	2011-08-03 19:53:17 UTC (rev 11102)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java	2011-08-03 20:06:41 UTC (rev 11103)
@@ -265,8 +265,6 @@
       {
          if (nodes == topology.getMembers().size())
          {
-            
-           log.info("ZZZ III look up for topology on " + topology + " size = " + topology.getMembers().size());
            return;
          }
 
@@ -274,7 +272,7 @@
       }
       while (System.currentTimeMillis() - start < timeout);
       
-      String msg = "ZZZ Timed out waiting for cluster topology of " + nodes + " (received " + topology.getMembers().size() + ") topology = " + topology + ")\n Current topology:" + topology.describe();
+      String msg = "Timed out waiting for cluster topology of " + nodes + " (received " + topology.getMembers().size() + ") topology = " + topology + ")\n Current topology:" + topology.describe();
 
       ClusterTestBase.log.error(msg);
       
@@ -2052,6 +2050,8 @@
          {
             try
             {
+               // We need to wait a 
+               Thread.sleep(500);
                ClusterTestBase.log.info("stopping server " + node);
                servers[node].stop();
                ClusterTestBase.log.info("server " + node + " stopped");

Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java	2011-08-03 19:53:17 UTC (rev 11102)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java	2011-08-03 20:06:41 UTC (rev 11103)
@@ -137,11 +137,6 @@
       
 
       
-//      setupSessionFactory(0, isNetty());
-//      setupSessionFactory(1, isNetty());
-//      setupSessionFactory(2, isNetty());
-      // System.exit(-1);
-      
       stopServers(0, 1, 2, 3, 4, 5);
 
    }
@@ -294,7 +289,9 @@
       setupSessionFactory(1, isNetty());
       setupSessionFactory(2, isNetty());
 
-      // Thread.sleep(1500);
+      // Need to wait some time so the bridges and 
+      // connectors had time to connect properly between the nodes
+      Thread.sleep(1000);
 
       createQueue(0, "queues.testaddress", "queue0", null, true);
       // Thread.sleep(1500);
@@ -321,7 +318,7 @@
       send(0, "queues.testaddress", 33, true, null);
 
       verifyReceiveRoundRobin(33, 0, 1, 2);
-
+      
       stopServers(2);
 
 

Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterTest.java	2011-08-03 19:53:17 UTC (rev 11102)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterTest.java	2011-08-03 20:06:41 UTC (rev 11103)
@@ -59,6 +59,9 @@
          setupCluster();
 
          startServers();
+         
+         // Waiting some time to the servers to get connected
+         Thread.sleep(1000);
 
          setupSessionFactory(0, isNetty());
          setupSessionFactory(1, isNetty());
@@ -115,6 +118,9 @@
          stopServers(0, 1, 2, 3, 4);
 
          startServers();
+         
+         // Wait some time so the servers are connected to each other
+         Thread.sleep(2000);
 
          setupSessionFactory(0, isNetty());
          setupSessionFactory(1, isNetty());

Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java	2011-08-03 19:53:17 UTC (rev 11102)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java	2011-08-03 20:06:41 UTC (rev 11103)
@@ -270,6 +270,8 @@
       setupCluster();
 
       startServers();
+      
+      Thread.sleep(1000);
 
       SymmetricClusterWithBackupTest.log.info("setup session factories: ");
 

Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java	2011-08-03 19:53:17 UTC (rev 11102)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java	2011-08-03 20:06:41 UTC (rev 11103)
@@ -130,23 +130,30 @@
 
    public void testRestartTest() throws Throwable
    {
-      startServers(0, 1);
-      waitForTopology(servers[0], 2);
-      
-      log.info("ZZZ Server 0 " + servers[0].describe());
+      String name = Thread.currentThread().getName();
+      try
+      {
+         Thread.currentThread().setName("ThreadOnTestRestartTest");
+         startServers(0, 1);
+         waitForTopology(servers[0], 2);
+         waitForTopology(servers[1], 2);
 
-      for (int i = 0; i < 5; i++)
+         for (int i = 0; i < 5; i++)
+         {
+            log.info("Sleep #test " + i);
+            Thread.sleep(500);
+            log.info("#stop #test #" + i);
+            stopServers(1);
+            waitForTopology(servers[0], 1, 2000);
+            log.info("#start #test #" + i);
+            startServers(1);
+            waitForTopology(servers[0], 2, 2000);
+            waitForTopology(servers[1], 2, 2000);
+         }
+      }
+      finally
       {
-         log.info("#stop #test #" + i);
-         Thread.sleep(500);
-         stopServers(1);
-         waitForTopology(servers[0], 1, 2000);
-         log.info("#start #test #" + i);
-         Thread.sleep(500);
-         startServers(1);
-         Thread.sleep(500);
-         waitForTopology(servers[0], 2, 2000);
-         waitForTopology(servers[1], 2, 2000);
+         Thread.currentThread().setName(name);
       }
 
    }

Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java	2011-08-03 19:53:17 UTC (rev 11102)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java	2011-08-03 20:06:41 UTC (rev 11103)
@@ -37,7 +37,11 @@
       setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0);
 
       startServers(0, 1);
+      
+      // Waiting some time to the servers to connect to each other
+      Thread.sleep(1000);
 
+
       System.out.println("server 0 = " + getServer(0).getNodeID());
       System.out.println("server 1 = " + getServer(1).getNodeID());
 
@@ -76,8 +80,8 @@
 
          log.info("stopping******************************************************");
          stopServers(0);
-         log.info("stopped, waiting 2 seconds************************************");
-         Thread.sleep(2000);
+         // Waiting some time after stopped
+         Thread.sleep(1000);
          startServers(0);
          
          waitForBindings(0, "queues.testaddress", 1, 1, true);
@@ -115,6 +119,10 @@
       setupClusterConnection("cluster1", "queues", false, 1, isNetty(), 1, 0);
 
       startServers(0, 1);
+      
+      
+      // Waiting some time to the servers to connect to each other
+      Thread.sleep(1000);
 
       System.out.println("server 0 = " + getServer(0).getNodeID());
       System.out.println("server 1 = " + getServer(1).getNodeID());



More information about the hornetq-commits mailing list