Search in sources :

Example 1 with PortableWriter

use of com.hazelcast.nio.serialization.PortableWriter in project hazelcast by hazelcast.

the class ClientPartitionLostListenerTest method test_portableMapPartitionLostEvent_serialization.

@Test
public void test_portableMapPartitionLostEvent_serialization() throws IOException {
    final Address source = new Address();
    final PortablePartitionLostEvent event = new PortablePartitionLostEvent(1, 2, source);
    final PortableWriter writer = mock(PortableWriter.class);
    final ObjectDataOutput output = mock(ObjectDataOutput.class);
    when(writer.getRawDataOutput()).thenReturn(output);
    event.writePortable(writer);
    verify(writer).writeInt("p", 1);
    verify(writer).writeInt("l", 2);
    verify(output).writeObject(source);
}
Also used : PortablePartitionLostEvent(com.hazelcast.spi.impl.PortablePartitionLostEvent) ObjectDataOutput(com.hazelcast.nio.ObjectDataOutput) Address(com.hazelcast.nio.Address) HazelcastTestSupport.getAddress(com.hazelcast.test.HazelcastTestSupport.getAddress) PortableWriter(com.hazelcast.nio.serialization.PortableWriter) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

Address (com.hazelcast.nio.Address)1 ObjectDataOutput (com.hazelcast.nio.ObjectDataOutput)1 PortableWriter (com.hazelcast.nio.serialization.PortableWriter)1 PortablePartitionLostEvent (com.hazelcast.spi.impl.PortablePartitionLostEvent)1 HazelcastTestSupport.getAddress (com.hazelcast.test.HazelcastTestSupport.getAddress)1 ParallelTest (com.hazelcast.test.annotation.ParallelTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1