use of com.hazelcast.nio.serialization.MorphingPortable in project hazelcast by hazelcast.
the class MorphingPortableReaderTest method before.
@Before
public void before() throws Exception {
service1 = (SerializationServiceV1) new DefaultSerializationServiceBuilder().addPortableFactory(TestSerializationConstants.PORTABLE_FACTORY_ID, new PortableFactory() {
public Portable create(int classId) {
return new MorphingBasePortable();
}
}).build();
service2 = (SerializationServiceV1) new DefaultSerializationServiceBuilder().addPortableFactory(TestSerializationConstants.PORTABLE_FACTORY_ID, new PortableFactory() {
public Portable create(int classId) {
return new MorphingPortable();
}
}).build();
Data data = service1.toData(new MorphingBasePortable((byte) 1, true, (char) 2, (short) 3, 4, 5, 1f, 2d, "test"));
BufferObjectDataInput in = service2.createObjectDataInput(data);
PortableSerializer portableSerializer = service2.getPortableSerializer();
reader = portableSerializer.createMorphingReader(in);
}
Aggregations