/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elemList; Element varElem; EntityReference entRef; Element entElement; doc = (Document) load("hc_staff", false); elemList = doc.getElementsByTagNameNS("*", "var"); varElem = (Element) elemList.item(2); entRef = (EntityReference) varElem.getFirstChild(); entElement = (Element) entRef.getFirstChild(); { boolean success = false; try { entElement.setIdAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", true); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); } } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList genderList; Node gender; EntityReference entRef; Element entElement; Node appendedChild; doc = (Document) load("staff", true); genderList = doc.getElementsByTagName("gender"); gender = genderList.item(2); entRef = doc.createEntityReference("ent4"); appendedChild = gender.appendChild(entRef); entElement = (Element) entRef.getFirstChild(); assertNotNull("entElementNotNull", entElement); { boolean success = false; try { entElement.setAttribute("newAttr", "newValue"); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); } } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList genderList; Node gender; EntityReference entRef; Element entElement; doc = (Document) load("staff", true); genderList = doc.getElementsByTagName("gender"); gender = genderList.item(2); entRef = (EntityReference) gender.getFirstChild(); assertNotNull("entRefNotNull", entRef); entElement = (Element) entRef.getFirstChild(); assertNotNull("entElementNotNull", entElement); { boolean success = false; try { entElement.setAttribute("newAttr", "newValue"); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); } } /**
assertNotNull("createdEntRefNotNull", entRef); appendedChild = gender.appendChild(entRef); entElement = (Element) entRef.getFirstChild(); assertNotNull("entElementNotNull", entElement); newAttr = doc.createAttribute("newAttr");
elem = (Element) childList.item(2); ent4Ref = (EntityReference) elem.getFirstChild(); span = (Element) ent4Ref.getFirstChild(); assertNotNull("spanNotNull", span); spanText = (Text) span.getFirstChild();
assertNotNull("createdEntRefNotNull", entRef); appendedChild = gender.appendChild(entRef); entElement = (Element) entRef.getFirstChild(); assertNotNull("entElementNotNull", entElement);
varElem = (Element) elemList.item(2); entRef = (EntityReference) varElem.getFirstChild(); entElement = (Element) entRef.getFirstChild(); attributesMap = entElement.getAttributes(); attr = (Attr) attributesMap.getNamedItem("xmlns");
assertNotNull("createdEntRefNotNull", entReference); appendedChild = genderNode.appendChild(entReference); entText = entReference.getFirstChild(); assertNotNull("entTextNotNull", entText);
assertNotNull("createdEntRefNotNull", entReference); appendedNode = genderNode.appendChild(entReference); entText = (CharacterData) entReference.getFirstChild(); assertNotNull("entTextNotNull", entText);
entRef = doc.createEntityReference("ent4"); assertNotNull("createdEntRefNotNull", entRef); entElement = (Element) entRef.getFirstChild(); assertNotNull("entElementNotNull", entElement); attrNode = entElement.getAttributeNode("domestic");
assertNotNull("createdEntRefNotNull", entReference); appendedChild = genderNode.appendChild(entReference); entText = entReference.getFirstChild(); assertNotNull("entTextNotNull", entText);
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList genderList; Node genderNode; CharacterData entText; EntityReference entReference; doc = (Document) load("staff", true); genderList = doc.getElementsByTagName("gender"); genderNode = genderList.item(2); entReference = doc.createEntityReference("ent3"); assertNotNull("createdEntRefNotNull", entReference); entText = (CharacterData) entReference.getFirstChild(); assertNotNull("entTextNotNull", entText); { boolean success = false; try { entText.insertData(1, "newArg"); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); } } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList genderList; Node genderNode; Node entText; EntityReference entReference; doc = (Document) load("staff", true); genderList = doc.getElementsByTagName("gender"); genderNode = genderList.item(4); entReference = doc.createEntityReference("ent3"); assertNotNull("createdEntRefNotNull", entReference); entText = entReference.getFirstChild(); assertNotNull("entTextNotNull", entText); { boolean success = false; try { ((CharacterData) /*Node */entText).setData("newData"); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); } } /**
betaRef = (EntityReference) acronym.getFirstChild(); assertNotNull("betaRefNotNull", betaRef); betaText = betaRef.getFirstChild(); assertNotNull("betaTextNotNull", betaText); dallas = (Text) betaRef.getNextSibling();
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; EntityReference newEntRefNode; NodeList newEntRefList; Node child; String name; String value; doc = (Document) load("staff", true); newEntRefNode = doc.createEntityReference("ent3"); assertNotNull("createdEntRefNotNull", newEntRefNode); newEntRefList = newEntRefNode.getChildNodes(); assertSize("size", 1, newEntRefList); child = newEntRefNode.getFirstChild(); name = child.getNodeName(); assertEquals("name", "#text", name); value = child.getNodeValue(); assertEquals("value", "Texas", value); } /**
entRef = (EntityReference) pElem.getLastChild(); assertNotNull("entRefNotNull", entRef); textNode = (Text) entRef.getFirstChild(); assertNotNull("entRefTextNotNull", textNode);
entRefChild1 = (Element) entRef.getFirstChild(); assertNotNull("entRefChild1NotNull", entRefChild1); entRefPosition = (int) entRef.compareDocumentPosition(entRefChild1);
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Text txt; EntityReference eRef; Node removed; doc = (Document) load("hc_staff", true); eRef = doc.createEntityReference("alpha"); txt = (Text) eRef.getFirstChild(); assertNotNull("txtNotNull", txt); { boolean success = false; try { removed = eRef.removeChild(txt); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); } } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; EntityReference eRef; Element elem; String entName; Node removed; doc = (Document) load("hc_staff", true); eRef = doc.createEntityReference("ent4"); elem = (Element) eRef.getFirstChild(); assertNotNull("elemNotNull", elem); { boolean success = false; try { removed = eRef.removeChild(elem); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); } } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; EntityReference entRef; CharacterData entText; doc = (Document) load("staff", true); entRef = doc.createEntityReference("ent3"); assertNotNull("createdEntRefNotNull", entRef); entText = (CharacterData) entRef.getFirstChild(); assertNotNull("entTextNotNull", entText); { boolean success = false; try { entText.setNodeValue("newValue"); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); } } /**