assertEquals(999, funnyConstructor.i);
}
public void testHandlesLists() {
WithList original = new WithList();
Y y = new Y();
y.yField = "a";
original.things.add(y);
original.things.add(new X(3));
original.things.add(new X(1));
String xml = xstream.toXML(original);
String expected =
"<with-list>\n" +
" <things>\n" +
" <y>\n" +
" <yField>a</yField>\n" +
" </y>\n" +
" <x>\n" +
" <anInt>3</anInt>\n" +
" </x>\n" +
" <x>\n" +
" <anInt>1</anInt>\n" +
" </x>\n" +
" </things>\n" +
"</with-list>";
assertEquals(expected, xml);
WithList result = (WithList) xstream.fromXML(xml);
assertEquals(original, result);
}