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);
  }
}

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 ) ; } }
runs the test case .
