Search in sources :

Example 1 with RemoteRpcProviderConfig

use of org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig in project controller by opendaylight.

the class RpcRegistryTest method staticSetup.

@BeforeClass
public static void staticSetup() throws InterruptedException {
    AkkaConfigurationReader reader = ConfigFactory::load;
    RemoteRpcProviderConfig config1 = new RemoteRpcProviderConfig.Builder("memberA").gossipTickInterval("200ms").withConfigReader(reader).build();
    RemoteRpcProviderConfig config2 = new RemoteRpcProviderConfig.Builder("memberB").gossipTickInterval("200ms").withConfigReader(reader).build();
    RemoteRpcProviderConfig config3 = new RemoteRpcProviderConfig.Builder("memberC").gossipTickInterval("200ms").withConfigReader(reader).build();
    node1 = ActorSystem.create("opendaylight-rpc", config1.get());
    node2 = ActorSystem.create("opendaylight-rpc", config2.get());
    node3 = ActorSystem.create("opendaylight-rpc", config3.get());
    waitForMembersUp(node1, Cluster.get(node2).selfUniqueAddress(), Cluster.get(node3).selfUniqueAddress());
    waitForMembersUp(node2, Cluster.get(node1).selfUniqueAddress(), Cluster.get(node3).selfUniqueAddress());
}
Also used : AkkaConfigurationReader(org.opendaylight.controller.cluster.common.actor.AkkaConfigurationReader) RemoteRpcProviderConfig(org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig) BeforeClass(org.junit.BeforeClass)

Example 2 with RemoteRpcProviderConfig

use of org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig 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)

Example 3 with RemoteRpcProviderConfig

use of org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig in project controller by opendaylight.

the class GossiperTest method createGossiper.

/**
 * Create Gossiper actor and return the underlying instance of Gossiper class.
 *
 * @return instance of Gossiper class
 */
private static Gossiper createGossiper() {
    final RemoteRpcProviderConfig config = new RemoteRpcProviderConfig.Builder("unit-test").withConfigReader(ConfigFactory::load).build();
    final Props props = Gossiper.testProps(config);
    final TestActorRef<Gossiper> testRef = TestActorRef.create(system, props, "testGossiper");
    return testRef.underlyingActor();
}
Also used : RemoteRpcProviderConfig(org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig) Props(akka.actor.Props)

Aggregations

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