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

        Foo fooCompare = foo;
        Foo dfoo = new Foo();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        LinkedBuffer buffer = buf();
        try
        {
            JsonXIOUtil.writeTo(out, fooCompare, schema, true, buffer);
        }
        finally
        {
            buffer.clear();
        }
        byte[] data = out.toByteArray();

        JsonIOUtil.mergeFrom(data, dfoo, schema, true);
        SerializableObjects.assertEquals(fooCompare, dfoo);
    }
Test for JsonXOutput on runtime pojos (polymorphic too).

@author David Yu
@created Jan 16, 2011
protostuff-json/src/test/java/io/protostuff/JsonXNumericRuntimeTest.java