Add the ability to toggle the default value of the ManagementContext
createConnector variable and set it to false for the surefire runs of
the unit tests, this should resolve failures of tests for no other
reason than a previous test failed to shutdown its broker.  Also speeds
up tests as they don't need to create this resource in order to use the
MBeans.
This commit is contained in:
Timothy Bish 2015-02-27 14:59:31 -05:00
parent 7af7c0143f
commit 84c1419c3d
2 changed files with 14 additions and 1 deletions

View File

@ -60,13 +60,25 @@ public class ManagementContext implements Service {
*/
public static final String DEFAULT_DOMAIN = "org.apache.activemq";
static {
String option = Boolean.TRUE.toString();
try {
option = System.getProperty("org.apache.activemq.broker.jmx.createConnector", "true");
} catch (Exception ex) {
}
DEFAULT_CREATE_CONNECTOR = Boolean.valueOf(option);
}
public static final boolean DEFAULT_CREATE_CONNECTOR;
private static final Logger LOG = LoggerFactory.getLogger(ManagementContext.class);
private MBeanServer beanServer;
private String jmxDomainName = DEFAULT_DOMAIN;
private boolean useMBeanServer = true;
private boolean createMBeanServer = true;
private boolean locallyCreateMBeanServer;
private boolean createConnector = true;
private boolean createConnector = DEFAULT_CREATE_CONNECTOR;
private boolean findTigerMbeanServer = true;
private String connectorHost = "localhost";
private int connectorPort = 1099;

View File

@ -445,6 +445,7 @@
<java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
<org.apache.activemq.default.directory.prefix>target/</org.apache.activemq.default.directory.prefix>
<org.apache.activemq.AutoFailTestSupport.disableSystemExit>true</org.apache.activemq.AutoFailTestSupport.disableSystemExit>
<org.apache.activemq.broker.jmx.createConnector>false</org.apache.activemq.broker.jmx.createConnector>
</systemPropertyVariables>
<includes>
<include>**/*Test.*</include>