protected void runTest() throws Throwable { Document document = dbf.newDocumentBuilder().newDocument(); EntityReference entref = document.createEntityReference("myentity"); assertEquals(Node.ENTITY_REFERENCE_NODE, entref.getNodeType()); assertEquals("myentity", entref.getNodeName()); assertNull(entref.getNodeValue()); assertSame(document, entref.getOwnerDocument()); } }
secondChild = (EntityReference) firstChild.getNextSibling(); assertNotNull("secondChildNotNull", secondChild); secondChildType = (int) secondChild.getNodeType(); assertEquals("secondChildIsEntityReference", 5, secondChildType); secondChildName = secondChild.getNodeName();
entRef = (EntityReference) genderNode.getFirstChild(); assertNotNull("entRefNotNull", entRef); nodeType = (int) entRef.getNodeType();
secondChild = (EntityReference) firstChild.getNextSibling(); assertNotNull("secondChildNotNull", secondChild); secondChildType = (int) secondChild.getNodeType(); assertEquals("secondChildIsEntityReference", 5, secondChildType); secondChildName = secondChild.getNodeName();
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; EntityReference newEntRefNode; String entRefValue; String entRefName; int entRefType; doc = (Document) load("staff", true); newEntRefNode = doc.createEntityReference("ent1"); assertNotNull("createdEntRefNotNull", newEntRefNode); entRefValue = newEntRefNode.getNodeValue(); assertNull("value", entRefValue); entRefName = newEntRefNode.getNodeName(); assertEquals("name", "ent1", entRefName); entRefType = (int) newEntRefNode.getNodeType(); assertEquals("type", 5, entRefType); } /**