use of org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory 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);
}
}
use of org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory in project controller by opendaylight.
the class AbstractScheduledTest method setUp.
@Before
public final void setUp() {
assertEquals(0, TestingScheduledThreadPoolImpl.getNumberOfCloseMethodCalls());
super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(mockedContext, new TestingScheduledThreadPoolModuleFactory(), new TestingFixedThreadPoolModuleFactory(), new TestingParallelAPSPModuleFactory()));
}
use of org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory in project controller by opendaylight.
the class MockedDependenciesTest method setUp.
@Before
public void setUp() {
ClassBasedModuleFactory mockedThreadPoolConfigFactory = new ClassBasedModuleFactory(threadPoolImplementationName, MockedThreadPoolModule.class);
super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(mockedContext, new TestingParallelAPSPModuleFactory(), mockedThreadPoolConfigFactory));
}
Aggregations