use of org.apache.geode.internal.HeapDataOutputStream in project geode by apache.
the class AutoSerializableJUnitTest method testReadNullPrimitives.
/*
* Test the versioning of basic primitives where no fields are written at first, but then all
* fields need to be read back.
*/
@Test
public void testReadNullPrimitives() throws Exception {
setupSerializer(stdSerializableClasses);
// Don't want to write any fields
manager.addExcludePattern(".*DomainObjectPdxAuto", "a(Char|Boolean|Byte|Short|Int|Long|Float|Double)");
DomainObject objOut = new DomainObjectPdxAuto(4);
objOut.set("aString", "aString has a value");
HeapDataOutputStream out = new HeapDataOutputStream(Version.CURRENT);
DataSerializer.writeObject(objOut, out);
// Now we want to read all fields.
manager.resetCaches();
PdxInstance pdxIn = DataSerializer.readObject(new DataInputStream(new ByteArrayInputStream(out.toByteArray())));
// Force the object to be de-serialized without any exceptions being thrown
DomainObjectPdxAuto result = (DomainObjectPdxAuto) pdxIn.getObject();
assertEquals('