use of com.hazelcast.internal.nio.Packet in project hazelcast by hazelcast.
the class PacketDispatcherTest method whenUrgentOperationResponsePacket.
@Test
public void whenUrgentOperationResponsePacket() {
Packet packet = new Packet().setPacketType(Packet.Type.OPERATION).raiseFlags(FLAG_OP_RESPONSE | FLAG_URGENT);
dispatcher.accept(packet);
verify(responseHandler).accept(packet);
verifyZeroInteractions(operationExecutor, eventService, invocationMonitor, jetService);
}
use of com.hazelcast.internal.nio.Packet in project hazelcast by hazelcast.
the class PacketDispatcherTest method whenJetPacket.
@Test
public void whenJetPacket() {
Packet packet = new Packet().setPacketType(Packet.Type.JET);
dispatcher.accept(packet);
verify(jetService).accept(packet);
verifyZeroInteractions(responseHandler, operationExecutor, eventService, invocationMonitor);
}
use of com.hazelcast.internal.nio.Packet in project hazelcast by hazelcast.
the class PacketDispatcherTest method whenProblemHandlingPacket_thenSwallowed.
// when one of the handlers throws an exception, the exception is logged but not rethrown
@Test
public void whenProblemHandlingPacket_thenSwallowed() {
Packet packet = new Packet().setPacketType(Packet.Type.OPERATION);
Mockito.doThrow(new ExpectedRuntimeException()).when(operationExecutor).accept(packet);
dispatcher.accept(packet);
}
use of com.hazelcast.internal.nio.Packet in project hazelcast by hazelcast.
the class PacketDispatcherTest method whenUrgentOperationPacket.
@Test
public void whenUrgentOperationPacket() {
Packet packet = new Packet().setPacketType(Packet.Type.OPERATION).raiseFlags(FLAG_URGENT);
dispatcher.accept(packet);
verify(operationExecutor).accept(packet);
verifyZeroInteractions(responseHandler, eventService, invocationMonitor, jetService);
}
use of com.hazelcast.internal.nio.Packet in project hazelcast by hazelcast.
the class HazelcastTestSupport method toPacket.
// ###########################################
// ########## implementation getter ##########
// ###########################################
public static Packet toPacket(HazelcastInstance local, HazelcastInstance remote, Operation operation) {
InternalSerializationService serializationService = Accessors.getSerializationService(local);
ServerConnectionManager connectionManager = Accessors.getConnectionManager(local);
return new Packet(serializationService.toBytes(operation), operation.getPartitionId()).setPacketType(Packet.Type.OPERATION).setConn(connectionManager.get(Accessors.getAddress(remote)));
}
Aggregations