X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2Fregistry%2Fmbeans%2FRemoteRpcRegistryMXBeanImplTest.java;fp=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2Fregistry%2Fmbeans%2FRemoteRpcRegistryMXBeanImplTest.java;h=dea930bf85ba145fad440b3ea663e0c1ca27fa3b;hp=8b23154232e59613301ff03eb76393816aa34bbe;hb=10427641dc0a75ec62e78ecfc4a7a0a7d438d462;hpb=4efa7f55f33e5f7fd8cedc6593b2357a38075ec8 diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java index 8b23154232..dea930bf85 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java @@ -10,10 +10,11 @@ package org.opendaylight.controller.remote.rpc.registry.mbeans; import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.Props; +import akka.dispatch.Dispatchers; import akka.testkit.TestActorRef; import akka.testkit.javadsl.TestKit; +import akka.util.Timeout; import com.google.common.collect.Lists; -import com.google.common.util.concurrent.Uninterruptibles; import java.util.Collections; import java.util.List; import java.util.Map; @@ -26,6 +27,7 @@ import org.junit.Test; import org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier; import org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig; import org.opendaylight.controller.remote.rpc.registry.RpcRegistry; +import org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreAccess; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.model.api.SchemaPath; @@ -56,12 +58,13 @@ public class RemoteRpcRegistryMXBeanImplTest { final TestKit invoker = new TestKit(system); final TestKit registrar = new TestKit(system); final TestKit supervisor = new TestKit(system); - final Props props = RpcRegistry.props(config, invoker.getRef(), registrar.getRef()); + final Props props = RpcRegistry.props(config, invoker.getRef(), registrar.getRef()) + .withDispatcher(Dispatchers.DefaultDispatcherId()); testActor = new TestActorRef<>(system, props, supervisor.getRef(), "testActor"); - final RpcRegistry rpcRegistry = testActor.underlyingActor(); - mxBean = new RemoteRpcRegistryMXBeanImpl(rpcRegistry); - Uninterruptibles.sleepUninterruptibly(200, TimeUnit.MILLISECONDS); + final Timeout timeout = Timeout.apply(10, TimeUnit.SECONDS); + mxBean = new RemoteRpcRegistryMXBeanImpl(new BucketStoreAccess(testActor, system.dispatcher(), timeout), + timeout); } @After