public void testEntityReferenceSetTextContent() throws TransformerException {
  document=builder.newDocument();
  Element root=document.createElement("menu");
  document.appendChild(root);
  EntityReference entityReference=document.createEntityReference("sp");
  root.appendChild(entityReference);
  try {
    entityReference.setTextContent("Lite Syrup");
    fail();
  }
 catch (  DOMException e) {
  }
}

public void testEntityReferenceSetTextContent ( ) throws TransformerException { document = builder . newDocument ( ) ; Element root = document . createElement ( "menu" ) ; document . appendChild ( root ) ; EntityReference entityReference = document . createEntityReference ( "sp" ) ; root . appendChild ( entityReference ) ; try { entityReference . setTextContent ( "Lite Syrup" ) ; fail ( ) ; } catch ( DOMException e ) { } }
tests settextcontent on entity references . although the other tests can act on a parsed dom , this needs to use a programmatically constructed dom because the parser may have replaced the entity reference with the corresponding text .
