private ITEMTREE itemTree() { ITEMTREE tree = ITEMTREE.Factory.newInstance(); tree.setName(dvText("data")); ELEMENT element = null; element = element("Total Cholesterol", 6.1, "mmol/l"); tree.insertNewItems(0); tree.setItemsArray(0, element); element = element("Triglycerides", 2.3, "mmol/l"); tree.insertNewItems(1); tree.setItemsArray(1, element); return tree; }
public void testCreateItemTree() throws Exception { ITEMTREE tree = ITEMTREE.Factory.newInstance(); tree.setName(dvText("item tree")); ELEMENT element = element("element", 6.1, "mmol/l"); tree.insertNewItems(0); tree.setItemsArray(0, element); assertNotNull(tree.getItemsArray(0)); assertEquals("element", ((ELEMENT) tree.getItemsArray(0)).getName().getValue()); }