Search in sources :

Example 1 with TestingParallelAPSPModuleFactory

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);
    }
}
Also used : TestingParallelAPSPModule(org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModule) TestingParallelAPSPModuleFactory(org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory) ModuleIdentifier(org.opendaylight.controller.config.api.ModuleIdentifier) ObjectName(javax.management.ObjectName) TestingParallelAPSPConfigMXBean(org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPConfigMXBean) Test(org.junit.Test)

Example 2 with TestingParallelAPSPModuleFactory

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()));
}
Also used : TestingFixedThreadPoolModuleFactory(org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolModuleFactory) TestingParallelAPSPModuleFactory(org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory) TestingScheduledThreadPoolModuleFactory(org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.TestingScheduledThreadPoolModuleFactory) HardcodedModuleFactoriesResolver(org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver) Before(org.junit.Before)

Example 3 with 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));
}
Also used : TestingParallelAPSPModuleFactory(org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory) ClassBasedModuleFactory(org.opendaylight.controller.config.manager.impl.ClassBasedModuleFactory) HardcodedModuleFactoriesResolver(org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver) Before(org.junit.Before)

Aggregations

TestingParallelAPSPModuleFactory (org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory)3 Before (org.junit.Before)2 HardcodedModuleFactoriesResolver (org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver)2 ObjectName (javax.management.ObjectName)1 Test (org.junit.Test)1 ModuleIdentifier (org.opendaylight.controller.config.api.ModuleIdentifier)1 ClassBasedModuleFactory (org.opendaylight.controller.config.manager.impl.ClassBasedModuleFactory)1 TestingParallelAPSPConfigMXBean (org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPConfigMXBean)1 TestingParallelAPSPModule (org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModule)1 TestingScheduledThreadPoolModuleFactory (org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.TestingScheduledThreadPoolModuleFactory)1 TestingFixedThreadPoolModuleFactory (org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolModuleFactory)1