Search in sources :

Example 1 with BucketStoreAccess

use of org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreAccess in project controller by opendaylight.

the class RemoteRpcRegistryMXBeanImplTest method setUp.

@Before
public void setUp() throws Exception {
    system = ActorSystem.create("test");
    final DOMRpcIdentifier emptyRpcIdentifier = DOMRpcIdentifier.create(EMPTY_SCHEMA_PATH, YangInstanceIdentifier.EMPTY);
    final DOMRpcIdentifier localRpcIdentifier = DOMRpcIdentifier.create(LOCAL_SCHEMA_PATH, YangInstanceIdentifier.of(LOCAL_QNAME));
    buckets = Lists.newArrayList(emptyRpcIdentifier, localRpcIdentifier);
    final RemoteRpcProviderConfig config = new RemoteRpcProviderConfig.Builder("system").build();
    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()).withDispatcher(Dispatchers.DefaultDispatcherId());
    testActor = new TestActorRef<>(system, props, supervisor.getRef(), "testActor");
    final Timeout timeout = Timeout.apply(10, TimeUnit.SECONDS);
    mxBean = new RemoteRpcRegistryMXBeanImpl(new BucketStoreAccess(testActor, system.dispatcher(), timeout), timeout);
}
Also used : Timeout(akka.util.Timeout) DOMRpcIdentifier(org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier) TestKit(akka.testkit.javadsl.TestKit) RemoteRpcProviderConfig(org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig) Props(akka.actor.Props) BucketStoreAccess(org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreAccess) Before(org.junit.Before)

Aggregations

Props (akka.actor.Props)1 TestKit (akka.testkit.javadsl.TestKit)1 Timeout (akka.util.Timeout)1 Before (org.junit.Before)1 DOMRpcIdentifier (org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier)1 RemoteRpcProviderConfig (org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig)1 BucketStoreAccess (org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreAccess)1