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;h=09d6f96a604787da0d987c6824a4c69079dd8366;hp=b48d40bac81a2e629911ca3aee1b26f8969c0a9f;hb=c9aab0231686bc6aa06dcfef51fca8c272fb9382;hpb=fafb6cc1d45f0ef060cec7fe5bad2f6acbca94c4 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 b48d40bac8..09d6f96a60 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.JavaTestKit; import akka.testkit.TestActorRef; +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 JavaTestKit invoker = new JavaTestKit(system); final JavaTestKit registrar = new JavaTestKit(system); final JavaTestKit supervisor = new JavaTestKit(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 @@ -159,4 +162,4 @@ public class RemoteRpcRegistryMXBeanImplTest { Assert.assertTrue(bucketVersions.contains(testActor.provider().getDefaultAddress().toString())); } -} \ No newline at end of file +}