[hornetq-commits] JBoss hornetq SVN: r8546 - trunk/tests/src/org/hornetq/tests/integration/cluster/failover.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 4 04:43:37 EST 2009


Author: ataylor
Date: 2009-12-04 04:43:37 -0500 (Fri, 04 Dec 2009)
New Revision: 8546

Modified:
   trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
Log:
test fix

Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java	2009-12-04 00:16:17 UTC (rev 8545)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java	2009-12-04 09:43:37 UTC (rev 8546)
@@ -84,35 +84,19 @@
 
          final CountDownLatch latch = new CountDownLatch(1);
 
-                  class MyListener implements FailureListener
-                  {
-                     public void connectionFailed(HornetQException me)
-                     {
-                        latch.countDown();
-                     }
-                  }
+         class MyListener implements FailureListener
+         {
+            public void connectionFailed(HornetQException me)
+            {
+               latch.countDown();
+            }
+         }
 
-                  final CountDownLatch latch2 = new CountDownLatch(1);
+         Map<String, MessageFlowRecord> records = ((ClusterConnectionImpl)getServer(1).getClusterManager().getClusterConnection(new SimpleString("cluster1"))).getRecords();
+         RemotingConnection rc = records.get("0").getBridge().getForwardingConnection() ;
+         rc.addFailureListener(new MyListener());
+         fail(rc, latch);
 
-                  class MyListener2 implements FailureListener
-                  {
-                     public void connectionFailed(HornetQException me)
-                     {
-                        latch2.countDown();
-                     }
-                  }
-
-                  Map<String, MessageFlowRecord> records = ((ClusterConnectionImpl)getServer(1).getClusterManager().getClusterConnection(new SimpleString("cluster1"))).getRecords();
-                  RemotingConnection rc = records.get("0").getBridge().getForwardingConnection() ;
-                  rc.addFailureListener(new MyListener());
-                  fail(rc, latch);
-
-                  records = ((ClusterConnectionImpl)getServer(0).getClusterManager().getClusterConnection(new SimpleString("cluster0"))).getRecords();
-                  rc = records.get("0").getBridge().getForwardingConnection() ;
-                  rc.addFailureListener(new MyListener2());
-                  fail(rc, latch);
-
-
          waitForServerRestart(2);
 
          setupSessionFactory(2, isNetty());
@@ -121,6 +105,10 @@
 
          waitForBindings(2, "queues.testaddress", 1, 1, true);
 
+         waitForBindings(2, "queues.testaddress", 1, 1, false);
+
+         waitForBindings(1, "queues.testaddress", 1, 1, true);
+
          waitForBindings(1, "queues.testaddress", 1, 1, false);
 
          sendWithProperty(2, "queues.testaddress", 10, false, MessageImpl.HDR_GROUP_ID, new SimpleString("id1"));
@@ -168,10 +156,11 @@
          setupSessionFactory(1, isNetty());
 
          createQueue(0, "queues.testaddress", "queue0", null, true);
-         createQueue(1, "queues.testaddress", "queue0", null, true);
 
-
          waitForBindings(0, "queues.testaddress", 1, 0, true);
+
+         createQueue(1, "queues.testaddress", "queue0", null, true);
+
          waitForBindings(1, "queues.testaddress", 1, 0, true);
 
          addConsumer(0, 0, "queue0", null);
@@ -202,25 +191,11 @@
             }
          }
 
-         final CountDownLatch latch2 = new CountDownLatch(1);
-
-         class MyListener2 implements FailureListener
-         {
-            public void connectionFailed(HornetQException me)
-            {
-               latch2.countDown();
-            }
-         }
-
          Map<String, MessageFlowRecord> records = ((ClusterConnectionImpl)getServer(1).getClusterManager().getClusterConnection(new SimpleString("cluster1"))).getRecords();
          RemotingConnection rc = records.get("0").getBridge().getForwardingConnection() ;
          rc.addFailureListener(new MyListener());
          fail(rc, latch);
 
-         records = ((ClusterConnectionImpl)getServer(0).getClusterManager().getClusterConnection(new SimpleString("cluster0"))).getRecords();
-         rc = records.get("0").getBridge().getForwardingConnection() ;
-         rc.addFailureListener(new MyListener2());
-         fail(rc, latch);
 
          waitForServerRestart(2);
 
@@ -230,6 +205,10 @@
 
          waitForBindings(2, "queues.testaddress", 1, 1, true);
 
+         waitForBindings(2, "queues.testaddress", 1, 1, false);
+
+         waitForBindings(1, "queues.testaddress", 1, 1, true);
+
          waitForBindings(1, "queues.testaddress", 1, 1, false);
 
          sendWithProperty(2, "queues.testaddress", 10, false, MessageImpl.HDR_GROUP_ID, new SimpleString("id1"));



More information about the hornetq-commits mailing list