use of com.hazelcast.nio.serialization.SampleIdentifiedDataSerializable in project hazelcast by hazelcast.
the class ArrayDataSerializableFactoryTest method testCreate.
@Test
public void testCreate() throws Exception {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructorFunctions = new ConstructorFunction[1];
constructorFunctions[0] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new SampleIdentifiedDataSerializable();
}
};
ArrayDataSerializableFactory factory = new ArrayDataSerializableFactory(constructorFunctions);
assertNull(factory.create(-1));
assertNull(factory.create(1));
assertThat(factory.create(0), instanceOf(SampleIdentifiedDataSerializable.class));
}
Aggregations