@Test
    public void testBarWithEmptyStringAndByteString() throws Exception
    {
        Bar barCompare = new Bar();
        barCompare.setSomeBytes(ByteString.copyFromUtf8(new String("")));
        barCompare.setSomeString(new String(""));

        Bar dbar = new Bar();

        byte[] data = XmlIOUtil.toByteArray(barCompare, barCompare.cachedSchema());
        XmlIOUtil.mergeFrom(data, dbar, dbar.cachedSchema());
        SerializableObjects.assertEquals(barCompare, dbar);

        // test equal serialization on both xml outputs
        byte[] actuals = XmlXIOUtil.toByteArray(barCompare,
                barCompare.cachedSchema(), LinkedBuffer.allocate(256));
        assertArrayEquals(data, actuals);
    }
Testing for xml ser/deser against messages.

@author David Yu
@created May 24, 2010
protostuff-xml/src/test/java/io/protostuff/XmlCoreSerDeserTest.java