use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class ClusterDataSerializationTest method testSerializationOf_clusterStateChange_fromVersion.
@Test
public void testSerializationOf_clusterStateChange_fromVersion() {
Data serialized = SERIALIZATION_SERVICE.toData(VERSION_CLUSTER_STATE_CHANGE);
ClusterStateChange deserialized = SERIALIZATION_SERVICE.toObject(serialized);
assertEquals(VERSION_CLUSTER_STATE_CHANGE, deserialized);
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class SerializationServiceV1Test method testExtractOperationCallId_withIdentifiedOperation.
@Test
public void testExtractOperationCallId_withIdentifiedOperation() throws Exception {
IdentifiedIoUtilTestOperation operation = new IdentifiedIoUtilTestOperation(1);
OperationAccessor.setCallId(operation, 4223);
Data data = serializationService.toData(operation);
long callId = serializationService.initDataSerializableInputAndSkipTheHeader(data).readLong();
assertEquals(4223, callId);
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class BufferPoolTest method takeInputBuffer_whenPooledInstance.
// ======================= in ==========================================
@Test
public void takeInputBuffer_whenPooledInstance() {
Data data = new HeapData(new byte[] {});
BufferObjectDataInput found1 = bufferPool.takeInputBuffer(data);
bufferPool.returnInputBuffer(found1);
BufferObjectDataInput found2 = bufferPool.takeInputBuffer(data);
assertSame(found1, found2);
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class SerializationServiceV1Test method test_callid_on_correct_stream_position.
@Test
public void test_callid_on_correct_stream_position() throws Exception {
CancellationOperation operation = new CancellationOperation(UuidUtil.newUnsecureUuidString(), true);
operation.setCallerUuid(UuidUtil.newUnsecureUuidString());
OperationAccessor.setCallId(operation, 12345);
Data data = serializationService.toData(operation);
long callId = serializationService.initDataSerializableInputAndSkipTheHeader(data).readLong();
assertEquals(12345, callId);
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class SerializationServiceV1Test method testExtractOperationCallId.
@Test
public void testExtractOperationCallId() throws Exception {
IoUtilTestOperation operation = new IoUtilTestOperation(1);
OperationAccessor.setCallId(operation, 2342);
Data data = serializationService.toData(operation);
long callId = serializationService.initDataSerializableInputAndSkipTheHeader(data).readLong();
assertEquals(2342, callId);
}
Aggregations