broker.start();
broker.waitUntilStarted();
// now create network connector over JMX
ObjectName brokerObjectName = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + BROKER_NAME);
BrokerViewMBean proxy = (BrokerViewMBean) broker.getManagementContext().newProxyInstance(brokerObjectName,
BrokerViewMBean.class, true);
assertNotNull("We could not retrieve the broker from JMX", proxy);
// let's add the NC
String connectoName = proxy.addNetworkConnector("static:(tcp://localhost:61617)");
assertEquals("NC", connectoName);
// Make sure we can retrieve the NC through JMX
ObjectName networkConnectorObjectName = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + BROKER_NAME +
",connector=networkConnectors,networkConnectorName=" + connectoName);