Public Methods | |
| nodeinsertbeforenodeancestor (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
Retrieve the second employee and attempt to insert a node that is one of its ancestors(root node). An attempt to insert such a node should raise the desired exception.
Definition at line 49 of file nodeinsertbeforenodeancestor.java.
|
|
Definition at line 51 of file nodeinsertbeforenodeancestor.java.
00052 {
00053 super(factory);
00054
00055 }
|
|
|
Reimplemented from DOMTest. Definition at line 85 of file nodeinsertbeforenodeancestor.java.
00085 {
00086 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforenodeancestor";
00087 }
|
|
|
Definition at line 88 of file nodeinsertbeforenodeancestor.java. References DOMTestCase::doMain().
00088 {
00089 DOMTestCase.doMain(nodeinsertbeforenodeancestor.class,args);
00090 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 57 of file nodeinsertbeforenodeancestor.java. References DOMTestCase::assertTrue(), and DOMTest::load().
00057 {
00058 Document doc;
00059 Node newChild;
00060 NodeList elementList;
00061 Node employeeNode;
00062 NodeList childList;
00063 Node refChild;
00064 Node insertedNode;
00065 doc = load("staff");
00066 newChild = doc.getDocumentElement();
00067 elementList = doc.getElementsByTagName("employee");
00068 employeeNode = elementList.item(1);
00069 childList = employeeNode.getChildNodes();
00070 refChild = childList.item(0);
00071
00072 {
00073 boolean success = false;
00074 try {
00075 insertedNode = employeeNode.insertBefore(newChild,refChild);
00076
00077 }
00078 catch(DOMException ex) {
00079 success = (ex.code == DOMException.HIERARCHY_REQUEST_ERR);
00080 }
00081 assertTrue("nodeInsertBeforeNodeAncestorAssert1",success);
00082 }
00083
00084 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001