use of com.hazelcast.internal.serialization.impl.portable.portablereader.DefaultPortableReaderTestStructure.TestPortableFactory in project hazelcast by hazelcast.
the class DefaultPortableReaderSpecTest method reader.
//
// Hazelcast init Utilities
//
public GenericRecordQueryReader reader(Portable portable) throws IOException {
SerializationConfig serializationConfig = new SerializationConfig();
serializationConfig.addPortableFactory(TestPortableFactory.ID, new TestPortableFactory());
InternalSerializationService ss = new DefaultSerializationServiceBuilder().setConfig(serializationConfig).build();
// put fully initialised object to a map
// avoid the case where there's no class definition
ss.toData(P_NON_EMPTY);
ss.toData(G_NON_EMPTY);
ss.toData(N_NON_EMPTY);
Data data = ss.toData(portable);
return new GenericRecordQueryReader(ss.readAsInternalGenericRecord(data));
}
Aggregations