/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; DocumentType docType; int documentPositionDoc; int documentPositionDocType; doc = (Document) load("hc_staff", false); docType = doc.getDoctype(); documentPositionDoc = (int) doc.compareDocumentPosition(docType); assertEquals("nodecomparedocumentpositionIsContainedFollowing01", 20, documentPositionDoc); documentPositionDocType = (int) docType.compareDocumentPosition(doc); assertEquals("nodecomparetreepositionContainsPRECEDING01", 10, documentPositionDocType); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; DOMImplementation domImpl; DocumentType newDocType; DocumentType docType; int documentPositionDoc; int documentPositionDocType; String nullPubId = null; String nullSysId = null; Node replaced; String rootName; doc = (Document) load("hc_staff", true); docType = doc.getDoctype(); rootName = docType.getName(); domImpl = doc.getImplementation(); newDocType = domImpl.createDocumentType(rootName, nullPubId, nullSysId); replaced = doc.replaceChild(newDocType, docType); documentPositionDoc = (int) doc.compareDocumentPosition(newDocType); assertEquals("nodecomparedocumentpositionIsContainedFollowing02", 20, documentPositionDoc); documentPositionDocType = (int) newDocType.compareDocumentPosition(doc); assertEquals("nodecomparedocumentpositionContainsPRECEDING02", 10, documentPositionDocType); } /**