public void testXMLExport() throws DataConversionException { Element e = getLocalWorker().provideXML(); assertEquals(XScufl.XScuflNS, e.getNamespace()); assertEquals("extensions", e.getName()); Element slicelist = e.getChild("slicelist", XScufl.XScuflNS); assertNotNull("Element <slicelist> not found", slicelist); Attribute depth = slicelist.getAttribute("depth", XScufl.XScuflNS); assertNotNull("Attribute depth='' not found", depth); assertEquals(1, depth.getIntValue()); }
public void testDefaultDepth() { assertEquals("Default value should be 1", 1, getLocalWorker().getDepth()); }
public void testSettingDepth() { SliceList l = getLocalWorker(); l.setDepth(3); assertEquals(3, l.getDepth()); l.setDepth(1337); assertEquals(1337, l.getDepth()); // Below 1 should not work, should limit to 1 l.setDepth(0); assertEquals(1, l.getDepth()); l.setDepth(-1); assertEquals(1, l.getDepth()); l.setDepth(-20); assertEquals(1, l.getDepth()); l.setDepth(3); l.setDepth(2); assertEquals(2, l.getDepth()); }
public void testXMLImport() { SliceList slicer = getLocalWorker(); slicer.setDepth(1337); Element e = slicer.provideXML(); SliceList slicer2 = getLocalWorker(); slicer2.consumeXML(e); assertEquals("Did not consume XML correctly", 1337, slicer2.getDepth()); }
assertEquals("incorrect number of entries in the list", 2, result.size()); for (int i = 1; i <= 2; i++) { String testVal = String.valueOf(i); assertEquals("incorrect value in list", testVal, result.get(i - 1));