Search in sources :

Example 1 with MCGetClusterMetadataCodec

use of com.hazelcast.client.impl.protocol.codec.MCGetClusterMetadataCodec in project hazelcast by hazelcast.

the class MCMessageTasksTest method testGetClusterMetadataMessageTask.

@Test
public void testGetClusterMetadataMessageTask() throws Exception {
    ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCGetClusterMetadataCodec.encodeRequest(), null);
    ClientDelegatingFuture<MCGetClusterMetadataCodec.ResponseParameters> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), MCGetClusterMetadataCodec::decodeResponse);
    MCGetClusterMetadataCodec.ResponseParameters response = future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
    assertTrue(response.clusterTime > 0);
    assertEquals(0, response.currentState);
    assertEquals(BuildInfoProvider.getBuildInfo().getVersion(), response.memberVersion);
    assertNull(response.jetVersion);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) MCGetClusterMetadataCodec(com.hazelcast.client.impl.protocol.codec.MCGetClusterMetadataCodec) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

ClientDelegatingFuture (com.hazelcast.client.impl.ClientDelegatingFuture)1 MCGetClusterMetadataCodec (com.hazelcast.client.impl.protocol.codec.MCGetClusterMetadataCodec)1 ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1