use of org.onosproject.store.serializers.custom.MastershipBasedTimestampSerializer in project onos by opennetworkinglab.
the class MastershipBasedTimestampTest method testKryoSerializableWithHandcraftedSerializer.
@Test
public final void testKryoSerializableWithHandcraftedSerializer() {
final ByteBuffer buffer = ByteBuffer.allocate(1 * 1024 * 1024);
final KryoNamespace kryos = KryoNamespace.newBuilder().register(new MastershipBasedTimestampSerializer(), MastershipBasedTimestamp.class).build();
kryos.serialize(TS_1_2, buffer);
buffer.flip();
Timestamp copy = kryos.deserialize(buffer);
new EqualsTester().addEqualityGroup(TS_1_2, copy).testEquals();
}
Aggregations