activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [1/3] activemq git commit: add some more logging if tests fails
Date Tue, 12 May 2015 21:24:47 GMT
Repository: activemq
Updated Branches:
  refs/heads/master e19293de5 -> c89bb7a31


add some more logging if tests fails


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

Branch: refs/heads/master
Commit: d46722008591a575815471ff3c3a50e92a20e681
Parents: e19293d
Author: gtully <gary.tully@gmail.com>
Authored: Mon May 11 16:45:59 2015 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Tue May 12 22:10:56 2015 +0100

----------------------------------------------------------------------
 .../activemq/network/FailoverStaticNetworkTest.java   | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/d4672200/activemq-unit-tests/src/test/java/org/apache/activemq/network/FailoverStaticNetworkTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/network/FailoverStaticNetworkTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/network/FailoverStaticNetworkTest.java
index 4113f14..fe1cddc 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/network/FailoverStaticNetworkTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/network/FailoverStaticNetworkTest.java
@@ -41,6 +41,7 @@ import javax.net.ssl.KeyManager;
 import javax.net.ssl.TrustManager;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.AutoFailTestSupport;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.SslContext;
 import org.apache.activemq.broker.TransportConnector;
@@ -346,7 +347,7 @@ public class FailoverStaticNetworkTest {
                     while (!done.get()) {
                         brokerA = createBroker("tcp", "61610", null);
                         brokerA.setBrokerName("Pair");
-                        brokerA.setBrokerObjectName(new ObjectName(brokerA.getManagementContext().getJmxDomainName()
+ ":" + "BrokerName="
+                        brokerA.setBrokerObjectName(new ObjectName(brokerA.getManagementContext().getJmxDomainName()
+ ":" + "brokerName="
                                 + JMXSupport.encodeObjectNamePart("A") + "," + "Type=Broker"));
                         ((KahaDBPersistenceAdapter)brokerA.getPersistenceAdapter()).getLocker().setLockAcquireSleepInterval(1000);
                         brokerA.start();
@@ -377,7 +378,7 @@ public class FailoverStaticNetworkTest {
                         brokerA1 = createBroker("tcp", "61611", null);
                         brokerA1.setBrokerName("Pair");
                         // so they can coexist in local jmx we set the object name b/c the
brokername identifies the shared store
-                        brokerA1.setBrokerObjectName(new ObjectName(brokerA.getManagementContext().getJmxDomainName()
+ ":" + "BrokerName="
+                        brokerA1.setBrokerObjectName(new ObjectName(brokerA.getManagementContext().getJmxDomainName()
+ ":" + "brokerName="
                             + JMXSupport.encodeObjectNamePart("A1") + "," + "Type=Broker"));
                         ((KahaDBPersistenceAdapter)brokerA1.getPersistenceAdapter()).getLocker().setLockAcquireSleepInterval(1000);
                         brokerA1.start();
@@ -394,12 +395,12 @@ public class FailoverStaticNetworkTest {
 
         for (int i=0; i<4; i++) {
             BrokerService currentMaster =  (i%2 == 0 ? brokerA : brokerA1);
-            LOG.info("iteration: " + i + ", using: " + currentMaster.getBrokerObjectName().getKeyProperty("BrokerName"));
+            LOG.info("iteration: " + i + ", using: " + currentMaster.getBrokerObjectName().getKeyProperty("brokerName"));
             currentMaster.waitUntilStarted();
 
             doTestNetworkSendReceive(brokerB, currentMaster);
 
-            LOG.info("Stopping " + currentMaster.getBrokerObjectName().getKeyProperty("BrokerName"));
+            LOG.info("Stopping " + currentMaster.getBrokerObjectName().getKeyProperty("brokerName"));
             currentMaster.stop();
             currentMaster.waitUntilStopped();
         }
@@ -434,10 +435,13 @@ public class FailoverStaticNetworkTest {
             @Override
             public boolean isSatisified() throws Exception {
                 Message message = consumer.receive(5000);
-                LOG.info("from:  " + from.getBrokerObjectName().getKeyProperty("BrokerName")
+  ", received: " + message);
+                LOG.info("from:  " + from.getBrokerObjectName().getKeyProperty("brokerName")
+  ", received: " + message);
                 return message != null;
             }
         });
+        if (!gotMessage) {
+            AutoFailTestSupport.dumpAllThreads("noMessage");
+        }
         try {
             consConn.close();
         } catch (JMSException ignored) {


Mime
View raw message