public void testDefaultDepth() { assertEquals("Default value should be 1", 1, getLocalWorker().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()); }
public void testSlicing() throws Exception { List<String> list = makeList(1, 3); List result = runSlicer(getLocalWorker(), list, "0", "2"); result = runSlicer(getLocalWorker(), list, "-2", "2"); fail("TaskExecutionException expected"); result = runSlicer(getLocalWorker(), list, "1", "100"); fail("TaskExecutionException expected"); result = runSlicer(getLocalWorker(), list, "1", "0"); fail("TaskExecutionException expected"); result = runSlicer(getLocalWorker(), list, "hello", "2"); fail("TaskExecutionException expected"); result = runSlicer(getLocalWorker(), list, "0", "world"); fail("TaskExecutionException expected");
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 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()); }