Search in sources :

Example 1 with RemoteLaunchClient

use of io.aeron.test.launcher.RemoteLaunchClient in project Aeron by real-logic.

the class ClusterNetworkTopologyTest method shouldGetEchoFromCluster.

@ParameterizedTest
@MethodSource("provideTopologyConfigurations")
@InterruptAfter(60)
void shouldGetEchoFromCluster(final List<String> hostnames, final List<String> internalHostnames, final String ingressChannel, final String logChannel) throws Exception {
    assertNotNull(hostnames);
    assertEquals(3, hostnames.size());
    setupDataCollection(3);
    final String ingressEndpoints = ingressChannel.contains("endpoint") ? null : BasicAuctionClusterClient.ingressEndpoints(hostnames);
    try (RemoteLaunchClient remote0 = RemoteLaunchClient.connect(hostnames.get(0), REMOTE_LAUNCH_PORT);
        RemoteLaunchClient remote1 = RemoteLaunchClient.connect(hostnames.get(1), REMOTE_LAUNCH_PORT);
        RemoteLaunchClient remote2 = RemoteLaunchClient.connect(hostnames.get(2), REMOTE_LAUNCH_PORT)) {
        final Selector selector = Selector.open();
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote0, selector, 0);
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote1, selector, 1);
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote2, selector, 2);
        connectAndSendMessages(ingressChannel, ingressEndpoints, selector, 1);
    }
}
Also used : RemoteLaunchClient(io.aeron.test.launcher.RemoteLaunchClient) Selector(java.nio.channels.Selector) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 2 with RemoteLaunchClient

use of io.aeron.test.launcher.RemoteLaunchClient in project aeron by real-logic.

the class ClusterNetworkTopologyTest method shouldLogReplicate.

@ParameterizedTest
@MethodSource("singleTopologyConfigurations")
@InterruptAfter(60)
void shouldLogReplicate(final List<String> hostnames, final List<String> internalHostnames, final String ingressChannel, final String logChannel) throws Exception {
    assertNotNull(hostnames);
    assertEquals(3, hostnames.size());
    setupDataCollection(3);
    final String ingressEndpoints = ingressChannel.contains("endpoint") ? null : BasicAuctionClusterClient.ingressEndpoints(hostnames);
    try (RemoteLaunchClient remote0 = RemoteLaunchClient.connect(hostnames.get(0), REMOTE_LAUNCH_PORT);
        RemoteLaunchClient remote1 = RemoteLaunchClient.connect(hostnames.get(1), REMOTE_LAUNCH_PORT)) {
        final Selector selector = Selector.open();
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote0, selector, 0);
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote1, selector, 1);
        connectAndSendMessages(ingressChannel, ingressEndpoints, selector, 10);
    }
    Thread.sleep(5_000);
    try (RemoteLaunchClient remote0 = RemoteLaunchClient.connect(hostnames.get(0), REMOTE_LAUNCH_PORT);
        RemoteLaunchClient remote2 = RemoteLaunchClient.connect(hostnames.get(2), REMOTE_LAUNCH_PORT)) {
        final Selector selector = Selector.open();
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote0, selector, 0);
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote2, selector, 2);
        connectAndSendMessages(ingressChannel, ingressEndpoints, selector, 10);
    }
}
Also used : RemoteLaunchClient(io.aeron.test.launcher.RemoteLaunchClient) Selector(java.nio.channels.Selector) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 3 with RemoteLaunchClient

use of io.aeron.test.launcher.RemoteLaunchClient in project aeron by real-logic.

the class ClusterNetworkTopologyTest method shouldGetEchoFromCluster.

@ParameterizedTest
@MethodSource("provideTopologyConfigurations")
@InterruptAfter(60)
void shouldGetEchoFromCluster(final List<String> hostnames, final List<String> internalHostnames, final String ingressChannel, final String logChannel) throws Exception {
    assertNotNull(hostnames);
    assertEquals(3, hostnames.size());
    setupDataCollection(3);
    final String ingressEndpoints = ingressChannel.contains("endpoint") ? null : BasicAuctionClusterClient.ingressEndpoints(hostnames);
    try (RemoteLaunchClient remote0 = RemoteLaunchClient.connect(hostnames.get(0), REMOTE_LAUNCH_PORT);
        RemoteLaunchClient remote1 = RemoteLaunchClient.connect(hostnames.get(1), REMOTE_LAUNCH_PORT);
        RemoteLaunchClient remote2 = RemoteLaunchClient.connect(hostnames.get(2), REMOTE_LAUNCH_PORT)) {
        final Selector selector = Selector.open();
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote0, selector, 0);
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote1, selector, 1);
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote2, selector, 2);
        connectAndSendMessages(ingressChannel, ingressEndpoints, selector, 1);
    }
}
Also used : RemoteLaunchClient(io.aeron.test.launcher.RemoteLaunchClient) Selector(java.nio.channels.Selector) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 4 with RemoteLaunchClient

use of io.aeron.test.launcher.RemoteLaunchClient in project Aeron by real-logic.

the class ClusterNetworkTopologyTest method shouldLogReplicate.

@ParameterizedTest
@MethodSource("singleTopologyConfigurations")
@InterruptAfter(60)
void shouldLogReplicate(final List<String> hostnames, final List<String> internalHostnames, final String ingressChannel, final String logChannel) throws Exception {
    assertNotNull(hostnames);
    assertEquals(3, hostnames.size());
    setupDataCollection(3);
    final String ingressEndpoints = ingressChannel.contains("endpoint") ? null : BasicAuctionClusterClient.ingressEndpoints(hostnames);
    try (RemoteLaunchClient remote0 = RemoteLaunchClient.connect(hostnames.get(0), REMOTE_LAUNCH_PORT);
        RemoteLaunchClient remote1 = RemoteLaunchClient.connect(hostnames.get(1), REMOTE_LAUNCH_PORT)) {
        final Selector selector = Selector.open();
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote0, selector, 0);
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote1, selector, 1);
        connectAndSendMessages(ingressChannel, ingressEndpoints, selector, 10);
    }
    Thread.sleep(5_000);
    try (RemoteLaunchClient remote0 = RemoteLaunchClient.connect(hostnames.get(0), REMOTE_LAUNCH_PORT);
        RemoteLaunchClient remote2 = RemoteLaunchClient.connect(hostnames.get(2), REMOTE_LAUNCH_PORT)) {
        final Selector selector = Selector.open();
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote0, selector, 0);
        launchNode(hostnames, internalHostnames, ingressChannel, logChannel, remote2, selector, 2);
        connectAndSendMessages(ingressChannel, ingressEndpoints, selector, 10);
    }
}
Also used : RemoteLaunchClient(io.aeron.test.launcher.RemoteLaunchClient) Selector(java.nio.channels.Selector) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

RemoteLaunchClient (io.aeron.test.launcher.RemoteLaunchClient)4 Selector (java.nio.channels.Selector)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 MethodSource (org.junit.jupiter.params.provider.MethodSource)4