@Test
    public void testListIOEmpty() throws Exception
    {
        ArrayList<Bar> bars = new ArrayList<Bar>();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        XmlIOUtil.writeListTo(out, bars,
                SerializableObjects.bar.cachedSchema());
        byte[] data = out.toByteArray();
        /*
         * assertEquals(new String(data, "UTF-8"), "<?xml version='1.0' encoding='UTF-8'?>" + "<list/>");
         */

        ByteArrayInputStream in = new ByteArrayInputStream(data);
        List<Bar> parsedBars = XmlIOUtil.parseListFrom(in,
                SerializableObjects.bar.cachedSchema());

        assertTrue(parsedBars.size() == bars.size());
        int i = 0;
        for (Bar b : parsedBars)
            SerializableObjects.assertEquals(bars.get(i++), b);
    }
Testing for xml ser/deser against messages.

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