00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 package org.w3c.domts.level1.core;
00021
00022 import org.w3c.dom.*;
00023 import org.w3c.dom.html.*;
00024 import org.w3c.dom.events.*;
00025 import org.w3c.domts.*;
00026 import javax.xml.parsers.*;
00027 import java.util.*;
00028
00029
00030
00049 public class processinginstructionsetdatanomodificationallowederrEE extends DOMTestCase {
00050
00051 public processinginstructionsetdatanomodificationallowederrEE(DOMTestDocumentBuilderFactory factory)
00052 {
00053 super(factory);
00054
00055 }
00056
00057 public void runTest() throws java.lang.Throwable {
00058 Document doc;
00059 NodeList genderList;
00060 Node gender;
00061 Node entRef;
00062 ProcessingInstruction piNode;
00063 String data;
00064 Node appendedChild;
00065 doc = load("staff");
00066 genderList = doc.getElementsByTagName("gender");
00067 gender = genderList.item(2);
00068 entRef = doc.createEntityReference("ent4");
00069 appendedChild = gender.appendChild(entRef);
00070 entRef = gender.getFirstChild();
00071 piNode = (ProcessingInstruction)entRef.getLastChild();
00072
00073 {
00074 boolean success = false;
00075 try {
00076 piNode.setData("newData");
00077
00078 }
00079 catch(DOMException ex) {
00080 success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
00081 }
00082 assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR",success);
00083 }
00084
00085 }
00086 public String getTargetURI() {
00087 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/processinginstructionsetdatanomodificationallowederrEE";
00088 }
00089 public static void main(String[] args) {
00090 DOMTestCase.doMain(processinginstructionsetdatanomodificationallowederrEE.class,args);
00091 }
00092 }