Runs the test case.
Document doc;
NodeList genderList;
Node genderNode;
Node entRef;
Node entElement;
Node createdNode;
Node insertedNode;
Node refChild = null;
int nodeType;
doc = (Document) load("staff", true);
genderList = doc.getElementsByTagName("gender");
genderNode = genderList.item(2);
entRef = genderNode.getFirstChild();
assertNotNull("entRefNotNull", entRef);
nodeType = (int) entRef.getNodeType();
if (equals(1, nodeType)) {
entRef = doc.createEntityReference("ent4");
assertNotNull("createdEntRefNotNull", entRef);
}
entElement = entRef.getFirstChild();
assertNotNull("entElementNotNull", entElement);
createdNode = doc.createElement("text3");
{
boolean success = false;
try {
insertedNode = entElement.insertBefore(createdNode, refChild);
} catch (DOMException ex) {
success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
assertTrue("throw_NOT_MODIFICATION_ALLOWED_ERR", success);
}