Public Methods | |
| nodereplacechild (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
Replace the first element of the second employee with a newly created Element node. Check the first position after the replacement operation is completed. The new Element should be "newChild".
Definition at line 45 of file nodereplacechild.java.
|
|
Definition at line 47 of file nodereplacechild.java.
00048 {
00049 super(factory);
00050
00051 }
|
|
|
Reimplemented from DOMTest. Definition at line 75 of file nodereplacechild.java.
00075 {
00076 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechild";
00077 }
|
|
|
Definition at line 78 of file nodereplacechild.java. References DOMTestCase::doMain().
00078 {
00079 DOMTestCase.doMain(nodereplacechild.class,args);
00080 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 53 of file nodereplacechild.java. References DOMTestCase::assertEquals(), and DOMTest::load().
00053 {
00054 Document doc;
00055 NodeList elementList;
00056 Node employeeNode;
00057 NodeList childList;
00058 Node oldChild;
00059 Node newChild;
00060 Node child;
00061 String childName;
00062 Node replacedNode;
00063 doc = load("staff");
00064 elementList = doc.getElementsByTagName("employee");
00065 employeeNode = elementList.item(1);
00066 childList = employeeNode.getChildNodes();
00067 oldChild = childList.item(0);
00068 newChild = doc.createElement("newChild");
00069 replacedNode = employeeNode.replaceChild(newChild,oldChild);
00070 child = childList.item(0);
00071 childName = child.getNodeName();
00072 assertEquals("nodeReplaceChildAssert1","newChild",childName);
00073
00074 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001