Search in sources :

Example 16 with ClientDelegatingFuture

use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.

the class MCMessageTasksTest method testHotRestartInterruptBackupMessageTask.

@Test
public void testHotRestartInterruptBackupMessageTask() throws Exception {
    ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCInterruptHotRestartBackupCodec.encodeRequest(), null);
    ClientDelegatingFuture<Void> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), clientMessage -> null);
    future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 17 with ClientDelegatingFuture

use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.

the class MCMessageTasksTest method testMatchMCConfigMessageTask.

@Test
public void testMatchMCConfigMessageTask() throws Exception {
    ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCMatchMCConfigCodec.encodeRequest(randomString()), null);
    ClientDelegatingFuture<Boolean> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), MCMatchMCConfigCodec::decodeResponse);
    assertFalse(future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS));
}
Also used : MCMatchMCConfigCodec(com.hazelcast.client.impl.protocol.codec.MCMatchMCConfigCodec) ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 18 with ClientDelegatingFuture

use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.

the class MCMessageTasksTest method testUpdateMapConfigMessageTask.

@Test
public void testUpdateMapConfigMessageTask() throws Exception {
    ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCUpdateMapConfigCodec.encodeRequest(randomString(), 100, 200, 0, false, 100, 0), null);
    ClientDelegatingFuture<Void> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), clientMessage -> null);
    future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 19 with ClientDelegatingFuture

use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.

the class MCMessageTasksTest method testRunGCMessageTask.

@Test
public void testRunGCMessageTask() throws Exception {
    ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCRunGcCodec.encodeRequest(), null);
    ClientDelegatingFuture<Void> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), clientMessage -> null);
    future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 20 with ClientDelegatingFuture

use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.

the class MCMessageTasksTest method testPollMCEventsMessageTask.

@Test
public void testPollMCEventsMessageTask() throws Exception {
    ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCPollMCEventsCodec.encodeRequest(), null);
    ClientDelegatingFuture<List<MCEventDTO>> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), MCPollMCEventsCodec::decodeResponse);
    assertTrue(future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS).isEmpty());
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) List(java.util.List) ArrayList(java.util.ArrayList) MCPollMCEventsCodec(com.hazelcast.client.impl.protocol.codec.MCPollMCEventsCodec) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

ClientDelegatingFuture (com.hazelcast.client.impl.ClientDelegatingFuture)54 ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)46 ClientInvocationFuture (com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)32 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)31 Test (org.junit.Test)17 Data (com.hazelcast.internal.serialization.Data)16 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)15 QuickTest (com.hazelcast.test.annotation.QuickTest)15 SerializationService (com.hazelcast.internal.serialization.SerializationService)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 ClientConfig (com.hazelcast.client.config.ClientConfig)3 StaleSequenceException (com.hazelcast.ringbuffer.StaleSequenceException)3 Nonnull (javax.annotation.Nonnull)3 AtomicLongAlterCodec (com.hazelcast.client.impl.protocol.codec.AtomicLongAlterCodec)2 AtomicRefSetCodec (com.hazelcast.client.impl.protocol.codec.AtomicRefSetCodec)2 MapGetCodec (com.hazelcast.client.impl.protocol.codec.MapGetCodec)2 SqlMappingDdlCodec (com.hazelcast.client.impl.protocol.codec.SqlMappingDdlCodec)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 IExecutorService (com.hazelcast.core.IExecutorService)2