X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fparallelapsp%2Ftest%2FMockedDependenciesTest.java;h=1e0bebbf06b512508aefdbd86e37081a07c88248;hp=29e91fd924b5739af4b155e7e84b90a0c043a336;hb=f43b01b81319959b1907e3e04537f5169e7f33d8;hpb=2c6fd09ad16f5c2968390a674865efbbe5f1fcec diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java index 29e91fd924..1e0bebbf06 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java @@ -10,9 +10,7 @@ package org.opendaylight.controller.config.manager.testingservices.parallelapsp. import java.io.Closeable; import java.io.IOException; import java.util.concurrent.Executor; - import javax.management.ObjectName; - import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; @@ -36,14 +34,14 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest { ClassBasedModuleFactory mockedThreadPoolConfigFactory = new ClassBasedModuleFactory( threadPoolImplementationName, MockedThreadPoolModule.class); - super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver( + super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(mockedContext, new TestingParallelAPSPModuleFactory(), mockedThreadPoolConfigFactory)); } - public static interface MockedTestingThreadPoolConfigMXBean extends + public interface MockedTestingThreadPoolConfigMXBean extends TestingThreadPoolConfigMXBean { - public void setThreadCount(int threadCount); + void setThreadCount(int threadCount); } public static class MockedThreadPoolModule implements Module, @@ -55,23 +53,18 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest { int threadCount; public MockedThreadPoolModule( - DynamicMBeanWithInstance dynamicMBeanWithInstance, ModuleIdentifier moduleIdentifier) { + final DynamicMBeanWithInstance dynamicMBeanWithInstance, final ModuleIdentifier moduleIdentifier) { // no reconfiguration / reuse is supported this.moduleIdentifier = moduleIdentifier; } - @Override - public ModuleIdentifier getName() { - return moduleIdentifier; - } - @Override public int getThreadCount() { return threadCount; } @Override - public void setThreadCount(int threadCount) { + public void setThreadCount(final int threadCount) { this.threadCount = threadCount; } @@ -80,17 +73,27 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest { } + @Override + public boolean canReuse(final Module oldModule) { + return false; + } + @Override public Closeable getInstance() { return new MockedThreadPool(threadCount); } + + @Override + public ModuleIdentifier getIdentifier() { + return moduleIdentifier; + } } public static class MockedThreadPool implements TestingThreadPoolIfc, Closeable { private final int threadCount; - public MockedThreadPool(int threadCount) { + public MockedThreadPool(final int threadCount) { this.threadCount = threadCount; } @@ -111,7 +114,7 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest { } @Override - String getThreadPoolImplementationName() { + protected String getThreadPoolImplementationName() { return threadPoolImplementationName; }