/** * HasHasBar wraps an object without a schema. That object will have to be serialized via the default java * serialization and it will be delimited. * <p> * HasBar wraps a message {@link Bar}. */ public void testJavaSerializable() throws Exception { Schema<HasHasBar> schema = RuntimeSchema.getSchema(HasHasBar.class); HasHasBar hhbCompare = new HasHasBar("hhb", new HasBar(12345, "hb", SerializableObjects.bar)); HasHasBar dhhb = new HasHasBar(); int expectedSize = ComputedSizeOutput.getSize(hhbCompare, schema); byte[] deferred = toByteArray(hhbCompare, schema); assertTrue(deferred.length == expectedSize); ProtostuffIOUtil.mergeFrom(deferred, dhhb, schema); assertEquals(hhbCompare, dhhb); }