use of org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModule in project controller by opendaylight.
the class DynamicWritableWrapperTest method testObjectNameSetterWithONContainingTransaction_shouldBeTranslatedToReadOnlyON.
/*
* Try to call setter with ObjectName containing transaction name. Verify that
* ObjectName without transaction name was actually passed on the config bean.
*/
@Test
public void testObjectNameSetterWithONContainingTransaction_shouldBeTranslatedToReadOnlyON() throws Exception {
TestingParallelAPSPModuleFactory testingParallelAPSPConfigBeanFactory = new TestingParallelAPSPModuleFactory();
TestingParallelAPSPModule apspConfigBean = testingParallelAPSPConfigBeanFactory.createModule("", null, null);
ModuleIdentifier moduleIdentifier2 = new ModuleIdentifier("apsp", "parallel");
ObjectName dynON2 = ObjectNameUtil.createReadOnlyModuleON(moduleIdentifier2);
AbstractDynamicWrapper dyn = getDynamicWrapper(apspConfigBean, moduleIdentifier2);
platformMBeanServer.registerMBean(dyn, dynON2);
try {
TestingParallelAPSPConfigMXBean proxy = JMX.newMBeanProxy(platformMBeanServer, dynON2, TestingParallelAPSPConfigMXBean.class);
ObjectName withTransactionName = ObjectNameUtil.createTransactionModuleON("transaction1", "moduleName", "instanceName");
proxy.setThreadPool(withTransactionName);
ObjectName withoutTransactionName = ObjectNameUtil.withoutTransactionName(withTransactionName);
assertEquals(withoutTransactionName, proxy.getThreadPool());
} finally {
platformMBeanServer.unregisterMBean(dynON2);
}
}
Aggregations