public void testFooEmpty() throws Exception
    {
        Foo fooCompare = new Foo();

        byte[] data = toByteArray(fooCompare, fooCompare.cachedSchema());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int total = writeTo(out, fooCompare, fooCompare.cachedSchema());

        assertTrue(data.length == total);

        byte[] data2 = out.toByteArray();

        assertTrue(data.length == data2.length);

        String text = STRING.deser(data);
        String text2 = STRING.deser(data2);

        assertEquals(text, text2);
        print(text);
    }
Serialization tests for yaml.

@author David Yu
@created Jun 28, 2010
protostuff-yaml/src/test/java/io/protostuff/YamlSerTest.java