public void testBar() throws Exception
    {
        Schema<Bar> schema = RuntimeSchema.getSchema(Bar.class);

        for (Bar barCompare : new Bar[] { bar, negativeBar })
        {
            Bar dbar = new Bar();

            int expectedSize = ComputedSizeOutput.getSize(barCompare, schema);

            byte[] deferred = toByteArray(barCompare, schema);
            assertTrue(deferred.length == expectedSize);
            ProtostuffIOUtil.mergeFrom(deferred, dbar, schema);
            SerializableObjects.assertEquals(barCompare, dbar);
            // System.err.println(dbar.getSomeInt());
            // System.err.println(dbar.getSomeLong());
            // System.err.println(dbar.getSomeFloat());
            // System.err.println(dbar.getSomeDouble());
            // System.err.println(dbar.getSomeBytes());
            // System.err.println(dbar.getSomeString());
            // System.err.println(dbar.getSomeEnum());
            // System.err.println(dbar.getSomeBoolean());
        }
    }
Serialization and deserialization test cases.

@author David Yu
@created Nov 18, 2009
protostuff-runtime/src/test/java/io/protostuff/runtime/SerDeserTest.java