// apply via jmx
ObjectName objectName =
new ObjectName(brokerService.getBrokerObjectName().toString() +
RuntimeConfigurationBroker.objectNamePropsAppendage);
RuntimeConfigurationViewMBean runtimeConfigurationView =
(RuntimeConfigurationViewMBean) brokerService.getManagementContext().newProxyInstance(objectName,
RuntimeConfigurationViewMBean.class, false);
HashMap<String, String> props = new HashMap<String, String>();
IntrospectionSupport.getProperties(runtimeConfigurationView, props, null);
LOG.info("mbean attributes before: " + props);
String result = runtimeConfigurationView.updateNow();
LOG.info("Result from failed update: " + result);
assertTrue("got sensible result: " + result, result.contains("dudElement"));
HashMap<String, String> propsAfter = new HashMap<String, String>();
IntrospectionSupport.getProperties(runtimeConfigurationView, propsAfter, null);
LOG.info("mbean attributes after: " + propsAfter);
String propOfInterest = "modified";
assertEquals("modified is same", props.get(propOfInterest), propsAfter.get(propOfInterest));
// apply good change now
applyNewConfig(brokerConfig, "networkConnectorTest-one-nc", SLEEP);
result = runtimeConfigurationView.updateNow();
LOG.info("Result from update: " + result);
assertTrue("got sensible result: " + result, result.contains("started"));
assertEquals("one new network connectors", 1, brokerService.getNetworkConnectors().size());