String result = xstream.toXML(product);
assertEquals(SIMPLE, result);
}
public void testWriteHierarchy() {
Category category = new Category("fruit", "111");
ArrayList products = new ArrayList();
Product banana = new Product("Banana", "123", 23.01);
ArrayList bananaTags = new ArrayList();
bananaTags.add("yellow");
bananaTags.add("fresh");
bananaTags.add("tasty");
banana.setTags(bananaTags);
products.add(banana);
Product mango = new Product("Mango", "124", 34.01);
products.add(mango);
category.setProducts(products);
String result = xstream.toXML(category);
assertEquals(HIERARCHY, result);
}