Allow for broker stats to be viewed in tests by enabling JMX but
disabling the creation of a management connector.
This commit is contained in:
Timothy Bish 2017-03-15 10:09:05 -04:00
parent dea1accb98
commit c4f8361d52
1 changed files with 3 additions and 2 deletions

View File

@ -46,13 +46,14 @@ public class EmbeddedActiveMQBroker extends ExternalResource {
* *
* The defaults are: * The defaults are:
* - the broker name is 'embedded-broker' * - the broker name is 'embedded-broker'
* - JMX is disabled * - JMX is enabled but no management connector will be created.
* - Persistence is disabled * - Persistence is disabled
* *
*/ */
public EmbeddedActiveMQBroker() { public EmbeddedActiveMQBroker() {
brokerService = new BrokerService(); brokerService = new BrokerService();
brokerService.setUseJmx(false); brokerService.setUseJmx(true);
brokerService.getManagementContext().setCreateConnector(false);
brokerService.setUseShutdownHook(false); brokerService.setUseShutdownHook(false);
brokerService.setPersistent(false); brokerService.setPersistent(false);
brokerService.setBrokerName("embedded-broker"); brokerService.setBrokerName("embedded-broker");