use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class DisabledOperationsTest method assertFailure.
private void assertFailure(ClientMessage clientMessage, String expectedExceptionMsg) throws Exception {
ClientInvocation invocation = new ClientInvocation(client, clientMessage, null);
ClientInvocationFuture future = invocation.invoke();
assertThatThrownBy(() -> future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS)).hasCauseInstanceOf(AccessControlException.class).hasRootCauseMessage(expectedExceptionMsg);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class MCTrustedInterfacesTest method assertFailureOnUntrustedInterface.
private void assertFailureOnUntrustedInterface(ClientMessage clientMessage) throws Exception {
ClientInvocation invocation = new ClientInvocation(((HazelcastClientProxy) client).client, clientMessage, null);
ClientInvocationFuture future = invocation.invoke();
try {
future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
fail("AccessControlException was expected.");
} catch (ExecutionException e) {
assertThat(e.getCause(), is(instanceOf(AccessControlException.class)));
}
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class MCTrustedInterfacesTest method testGetSystemPropertiesMessageTask_passing.
@Test
public void testGetSystemPropertiesMessageTask_passing() throws Exception {
HazelcastInstance client = factory.newHazelcastClient(new ClientConfig(), "222.222.222.222");
HazelcastClientInstanceImpl clientImpl = ((HazelcastClientProxy) client).client;
ClientInvocation invocation = new ClientInvocation(clientImpl, MCGetSystemPropertiesCodec.encodeRequest(), null);
ClientDelegatingFuture<List<Map.Entry<String, String>>> future = new ClientDelegatingFuture<>(invocation.invoke(), clientImpl.getSerializationService(), MCGetSystemPropertiesCodec::decodeResponse);
assertFalse(future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS).isEmpty());
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation 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);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation 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));
}
Aggregations