Search in sources :

Example 11 with InvocationBuilder

use of com.hazelcast.spi.impl.operationservice.InvocationBuilder in project hazelcast by hazelcast.

the class Invocation_ServerConnectionManagerTest method testInvocation_whenEndpointManagerIsNoop.

@Test
public void testInvocation_whenEndpointManagerIsNoop() {
    TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory();
    HazelcastInstance hz1 = factory.newHazelcastInstance();
    HazelcastInstance hz2 = factory.newHazelcastInstance();
    String key = generateKeyOwnedBy(hz2);
    Data dataKey = getSerializationService(hz1).toData(key);
    Partition partition = hz1.getPartitionService().getPartition(key);
    Operation op = new GetOperation("test", dataKey);
    InvocationBuilder builder = getNodeEngineImpl(hz1).getOperationService().createInvocationBuilder(MapService.SERVICE_NAME, op, partition.getPartitionId());
    builder.setConnectionManager(new NoopEndpointManager());
    expected.expect(UnsupportedOperationException.class);
    expected.expectMessage(EXPECTED_MSG);
    builder.invoke().join();
}
Also used : Partition(com.hazelcast.partition.Partition) GetOperation(com.hazelcast.map.impl.operation.GetOperation) HazelcastInstance(com.hazelcast.core.HazelcastInstance) Data(com.hazelcast.internal.serialization.Data) Operation(com.hazelcast.spi.impl.operationservice.Operation) GetOperation(com.hazelcast.map.impl.operation.GetOperation) InvocationBuilder(com.hazelcast.spi.impl.operationservice.InvocationBuilder) TestHazelcastInstanceFactory(com.hazelcast.test.TestHazelcastInstanceFactory) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

InvocationBuilder (com.hazelcast.spi.impl.operationservice.InvocationBuilder)11 Operation (com.hazelcast.spi.impl.operationservice.Operation)6 HazelcastInstance (com.hazelcast.core.HazelcastInstance)5 OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)5 Address (com.hazelcast.cluster.Address)4 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)4 QuickTest (com.hazelcast.test.annotation.QuickTest)4 Future (java.util.concurrent.Future)4 Test (org.junit.Test)4 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)3 MemberImpl (com.hazelcast.cluster.impl.MemberImpl)2 FetchPartitionStateOperation (com.hazelcast.internal.partition.operation.FetchPartitionStateOperation)2 MigrationOperation (com.hazelcast.internal.partition.operation.MigrationOperation)2 MigrationRequestOperation (com.hazelcast.internal.partition.operation.MigrationRequestOperation)2 Data (com.hazelcast.internal.serialization.Data)2 AccumulatorInfo (com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo)2 PublisherCreateOperation (com.hazelcast.map.impl.querycache.subscriber.operation.PublisherCreateOperation)2 Predicate (com.hazelcast.query.Predicate)2 InternalCompletableFuture (com.hazelcast.spi.impl.InternalCompletableFuture)2 OperationService (com.hazelcast.spi.impl.operationservice.OperationService)2