Search in sources :

Example 6 with LongInitializedTestService

use of org.apache.ignite.internal.processors.service.inner.LongInitializedTestService in project ignite by apache.

the class ServiceDeploymentProcessingOnNodesLeftTest method testDeploymentProcessingOnServersLeaveTopology.

/**
 * @throws Exception In case of an error.
 */
@Test
public void testDeploymentProcessingOnServersLeaveTopology() throws Exception {
    try {
        startGrids(4);
        IgniteEx client = startClientGrid(getConfiguration("client"));
        IgniteEx ignite1 = grid(1);
        IgniteEx ignite2 = grid(2);
        ((BlockingTcpCommunicationSpi) ignite1.configuration().getCommunicationSpi()).block();
        ((BlockingTcpCommunicationSpi) ignite2.configuration().getCommunicationSpi()).block();
        IgniteFuture fut = client.services().deployNodeSingletonAsync("testService", new LongInitializedTestService(5000L));
        IgniteFuture fut2 = client.services().deployNodeSingletonAsync("testService2", new LongInitializedTestService(5000L));
        stopNode(ignite1);
        stopNode(ignite2);
        fut.get(TEST_FUTURE_WAIT_TIMEOUT);
        fut2.get(TEST_FUTURE_WAIT_TIMEOUT);
        IgniteEx ignite3 = grid(3);
        assertNotNull(ignite3.services().service("testService"));
        assertNotNull(ignite3.services().service("testService2"));
    } finally {
        stopAllGrids();
    }
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) IgniteFuture(org.apache.ignite.lang.IgniteFuture) LongInitializedTestService(org.apache.ignite.internal.processors.service.inner.LongInitializedTestService) Test(org.junit.Test)

Aggregations

LongInitializedTestService (org.apache.ignite.internal.processors.service.inner.LongInitializedTestService)6 IgniteFuture (org.apache.ignite.lang.IgniteFuture)6 Test (org.junit.Test)6 IgniteEx (org.apache.ignite.internal.IgniteEx)5 Ignite (org.apache.ignite.Ignite)2 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)2 IgniteClientDisconnectedException (org.apache.ignite.IgniteClientDisconnectedException)1 MyService (org.apache.ignite.internal.processors.service.inner.MyService)1 ServiceConfiguration (org.apache.ignite.services.ServiceConfiguration)1