activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gaohow...@apache.org
Subject activemq-artemis git commit: Fixed more test failures
Date Thu, 17 Mar 2016 13:30:27 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/refactor-openwire 7cfdf6b83 -> 190cfc271


Fixed more test failures


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

Branch: refs/heads/refactor-openwire
Commit: 190cfc271e313b6850ce8b5256ae04bb366e1ba6
Parents: 7cfdf6b
Author: Howard Gao <howard.gao@gmail.com>
Authored: Thu Mar 17 20:45:09 2016 +0800
Committer: Howard Gao <howard.gao@gmail.com>
Committed: Thu Mar 17 20:45:09 2016 +0800

----------------------------------------------------------------------
 .../openwire/OpenWireProtocolManager.java       |  4 ++++
 .../failover/ConnectionHangOnStartupTest.java   |  7 ++-----
 .../transport/failover/FailoverRandomTest.java  | 20 ++++++++++++++------
 3 files changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/190cfc27/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
index 3cb1215..804ab1a 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
@@ -568,6 +568,10 @@ public class OpenWireProtocolManager implements ProtocolManager<Interceptor>,
Cl
       return this.updateClusterClientsOnRemove;
    }
 
+   public void setBrokerName(String name) {
+      this.brokerName = name;
+   }
+
    public static XAException newXAException(String s, int errorCode) {
       XAException xaException = new XAException(s + " " + "xaErrorCode:" + errorCode);
       xaException.errorCode = errorCode;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/190cfc27/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java
index 756337e..99e22b4 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java
@@ -76,8 +76,6 @@ public class ConnectionHangOnStartupTest extends OpenwireArtemisBaseTest
{
 
    @Test(timeout = 60000)
    public void testInitialWireFormatNegotiationTimeout() throws Exception {
-      Assert.fail("this test pass but it'll leave a thread running all the time, fix it before
adding the test to the testsuite!");
-      /*
       final AtomicReference<Connection> conn = new AtomicReference<>();
       final CountDownLatch connStarted = new CountDownLatch(1);
 
@@ -96,11 +94,10 @@ public class ConnectionHangOnStartupTest extends OpenwireArtemisBaseTest
{
       };
       t.start();
       createMaster();
+
       // slave will never start unless the master dies!
       //createSlave();
 
-      conn.get().stop();
-      */
+      conn.get().close();
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/190cfc27/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java
index 80f83db..d11bae5 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java
@@ -28,6 +28,8 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 public class FailoverRandomTest extends OpenwireArtemisBaseTest {
@@ -36,8 +38,17 @@ public class FailoverRandomTest extends OpenwireArtemisBaseTest {
 
    @Before
    public void setUp() throws Exception {
-      Configuration config0 = createConfig(0);
-      Configuration config1 = createConfig(1);
+      Map<String, String> params = new HashMap<String, String>();
+
+      params.put("rebalanceClusterClients", "true");
+      params.put("updateClusterClients", "true");
+      params.put("updateClusterClientsOnRemove", "true");
+      params.put("brokerName", "A");
+
+      Configuration config0 = createConfig("127.0.0.1", 0, params);
+
+      params.put("brokerName", "B");
+      Configuration config1 = createConfig("127.0.0.2", 1, params);
 
       deployClusterConfiguration(config0, 1);
       deployClusterConfiguration(config1, 0);
@@ -48,9 +59,6 @@ public class FailoverRandomTest extends OpenwireArtemisBaseTest {
       server0.start();
       server1.start();
 
-      server0.getActiveMQServer().setIdentity("BrokerA");
-      server1.getActiveMQServer().setIdentity("BrokerB");
-
       Assert.assertTrue(server0.waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
       Assert.assertTrue(server1.waitClusterForming(100, TimeUnit.MILLISECONDS, 20, 2));
    }
@@ -68,7 +76,7 @@ public class FailoverRandomTest extends OpenwireArtemisBaseTest {
 
       ActiveMQConnection connection = (ActiveMQConnection) cf.createConnection();
       connection.start();
-      String brokerName1 = connection.getBrokerName();
+      final String brokerName1 = connection.getBrokerName();
       Assert.assertNotNull(brokerName1);
       connection.close();
 


Mime
View raw message