X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fparallelapsp%2FTestingParallelAPSPModule.java;h=5c320ae2c159b6bdd132ad6fd1e5a15d4db33bd3;hb=f298b5a67b70daf3face69bf65483de544a6da61;hp=f4ba5ef887e359b9e5a6ab324ac58cc359ae565f;hpb=c541f7868e6e2d654b8080b5426bb12a39bddf11;p=controller.git diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java index f4ba5ef887..5c320ae2c1 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java @@ -10,24 +10,22 @@ package org.opendaylight.controller.config.manager.testingservices.parallelapsp; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; +import com.google.common.base.Strings; import java.io.Closeable; - import javax.annotation.Nullable; import javax.annotation.concurrent.NotThreadSafe; import javax.management.ObjectName; - import org.opendaylight.controller.config.api.DependencyResolver; import org.opendaylight.controller.config.api.JmxAttribute; import org.opendaylight.controller.config.api.ModuleIdentifier; import org.opendaylight.controller.config.api.annotations.RequireInterface; import org.opendaylight.controller.config.manager.testingservices.seviceinterface.TestingThreadPoolServiceInterface; +import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingThreadPoolConfigMXBean; import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingThreadPoolIfc; import org.opendaylight.controller.config.spi.Module; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Strings; - /** * Represents service that has dependency to thread pool. */ @@ -104,6 +102,17 @@ public class TestingParallelAPSPModule implements Module, checkState("Commit was not triggered".equals(e.getMessage()), e.getMessage()); } + + // test retrieving dependent module's attribute + int threadCount; + try { + threadCount = (Integer)dependencyResolver.getAttribute(threadPoolON, "ThreadCount"); + } catch (Exception e) { + throw new IllegalStateException(e); + } + checkState(threadCount > 0); + TestingThreadPoolConfigMXBean proxy = dependencyResolver.newMXBeanProxy(threadPoolON, TestingThreadPoolConfigMXBean.class); + checkState(threadCount == proxy.getThreadCount()); } @Override