From 814c49f058f315efd82a5e1bcfcdf509dadbb788 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Fri, 6 Nov 2009 15:14:05 +0000 Subject: [PATCH] resolve intermittent failure of DiscoveryNetworkReconnectTest due to network timing issues git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@833435 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/broker/jmx/ManagementContext.java | 5 ++--- .../transport/discovery/DiscoveryNetworkReconnectTest.java | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java index 9a6827125f..a170f6d012 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java @@ -47,7 +47,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** - * A Flow provides different dispatch policies within the NMR + * An abstraction over JMX mbean registration * * @org.apache.xbean.XBean * @version $Revision$ @@ -91,14 +91,13 @@ public class ManagementContext implements Service { try { getMBeanServer().invoke(namingServiceObjectName, "start", null, null); } catch (Throwable ignore) { - LOG.debug("ignored error on start invocation", ignore); } Thread t = new Thread("JMX connector") { public void run() { try { JMXConnectorServer server = connectorServer; if (started.get() && server != null) { - LOG.debug("Starting JMX JMXConnectorServer..."); + LOG.debug("Starting JMXConnectorServer..."); server.start(); LOG.info("JMX consoles can connect to " + server.getAddress()); } diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryNetworkReconnectTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryNetworkReconnectTest.java index 863a7e72f6..7ca0b37949 100755 --- a/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryNetworkReconnectTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryNetworkReconnectTest.java @@ -195,8 +195,11 @@ public class DiscoveryNetworkReconnectTest { // wait for the inactivity timeout and network shutdown assertTrue("network connector mbean unregistered within 1 minute", mbeanUnregistered.tryAcquire(60, TimeUnit.SECONDS)); + // whack all connections + proxy.close(); + // let a reconnect succeed - proxy.goOn(); + proxy.reopen(); } } }