You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2015/08/12 03:51:52 UTC

[1/2] activemq-artemis git commit: Fix HAClientTopologyWithDiscoveryTest

Repository: activemq-artemis
Updated Branches:
  refs/heads/master da74f2ac5 -> e8ff58149


Fix HAClientTopologyWithDiscoveryTest


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/4fa701ea
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/4fa701ea
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/4fa701ea

Branch: refs/heads/master
Commit: 4fa701eaff4df0596e53796e253350a2783b4259
Parents: da74f2a
Author: jbertram <jb...@apache.org>
Authored: Tue Aug 11 15:22:52 2015 -0500
Committer: jbertram <jb...@apache.org>
Committed: Tue Aug 11 15:23:06 2015 -0500

----------------------------------------------------------------------
 .../topology/TopologyClusterTestBase.java        | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4fa701ea/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
index ba9eb2a..07b75d4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
@@ -27,7 +27,6 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.core.client.TopologyMember;
-import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
@@ -41,6 +40,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
@@ -55,6 +55,10 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase {
       private final List<String> nodes;
       private final CountDownLatch downLatch;
 
+      // we need a separate list of the nodes we've seen go up that we don't remove IDs from
+      // because stale UDP messages can mess up tests once nodes start going down
+      private final List<String> seenUp = new ArrayList<>();
+
       /**
        * @param upLatch
        * @param nodes
@@ -70,8 +74,9 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase {
       public synchronized void nodeUP(TopologyMember topologyMember, boolean last) {
          final String nodeID = topologyMember.getNodeId();
 
-         if (!nodes.contains(nodeID)) {
+         if (!seenUp.contains(nodeID)) {
             nodes.add(nodeID);
+            seenUp.add(nodeID);
             upLatch.countDown();
          }
       }
@@ -198,9 +203,9 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase {
 
       ServerLocator locator = createHAServerLocator();
 
-      ((ServerLocatorImpl) locator).getTopology().setOwner("testReceive");
+      locator.getTopology().setOwner("testReceive");
 
-      final List<String> nodes = new ArrayList<String>();
+      final List<String> nodes = Collections.synchronizedList(new ArrayList<String>());
       final CountDownLatch upLatch = new CountDownLatch(5);
       final CountDownLatch downLatch = new CountDownLatch(4);
 
@@ -246,7 +251,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase {
       waitForClusterConnections(3, 4);
       waitForClusterConnections(4, 4);
 
-      final List<String> nodes = new ArrayList<String>();
+      final List<String> nodes = Collections.synchronizedList(new ArrayList<String>());
       final CountDownLatch upLatch = new CountDownLatch(5);
       final CountDownLatch downLatch = new CountDownLatch(4);
 
@@ -296,7 +301,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase {
       waitForClusterConnections(3, 4);
       waitForClusterConnections(4, 4);
 
-      final List<String> nodes = new ArrayList<String>();
+      final List<String> nodes = Collections.synchronizedList(new ArrayList<String>());
       final CountDownLatch upLatch = new CountDownLatch(5);
 
       locator.addClusterTopologyListener(new LatchListener(upLatch, nodes, new CountDownLatch(0)));
@@ -384,7 +389,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase {
       waitForClusterConnections(3, 4);
       waitForClusterConnections(4, 4);
 
-      final List<String> nodes = new ArrayList<String>();
+      final List<String> nodes = Collections.synchronizedList(new ArrayList<String>());
       final CountDownLatch upLatch = new CountDownLatch(5);
       final CountDownLatch downLatch = new CountDownLatch(4);
 


[2/2] activemq-artemis git commit: This closes #119 test fix

Posted by cl...@apache.org.
This closes #119 test fix


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/e8ff5814
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/e8ff5814
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/e8ff5814

Branch: refs/heads/master
Commit: e8ff5814968b7057db86446fad7a4badbca7d450
Parents: da74f2a 4fa701e
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Aug 11 21:51:36 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Aug 11 21:51:36 2015 -0400

----------------------------------------------------------------------
 .../topology/TopologyClusterTestBase.java        | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------