Public Methods | |
| nodereplacechildoldchildnonexistent (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
Retrieve the second employee and attempt to replace a node that is not one of its children. An attempt to replace such a node should raise the desired exception.
Definition at line 48 of file nodereplacechildoldchildnonexistent.java.
|
|
Definition at line 50 of file nodereplacechildoldchildnonexistent.java.
00051 {
00052 super(factory);
00053
00054 }
|
|
|
Reimplemented from DOMTest. Definition at line 82 of file nodereplacechildoldchildnonexistent.java.
00082 {
00083 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildoldchildnonexistent";
00084 }
|
|
|
Definition at line 85 of file nodereplacechildoldchildnonexistent.java. References DOMTestCase::doMain().
00085 {
00086 DOMTestCase.doMain(nodereplacechildoldchildnonexistent.class,args);
00087 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 56 of file nodereplacechildoldchildnonexistent.java. References DOMTestCase::assertTrue(), and DOMTest::load().
00056 {
00057 Document doc;
00058 Node oldChild;
00059 Node newChild;
00060 NodeList elementList;
00061 Node elementNode;
00062 Node replacedNode;
00063 doc = load("staff");
00064 newChild = doc.createElement("newChild");
00065 oldChild = doc.createElement("oldChild");
00066 elementList = doc.getElementsByTagName("employee");
00067 elementNode = elementList.item(1);
00068
00069 {
00070 boolean success = false;
00071 try {
00072 replacedNode = elementNode.replaceChild(newChild,oldChild);
00073
00074 }
00075 catch(DOMException ex) {
00076 success = (ex.code == DOMException.NOT_FOUND_ERR);
00077 }
00078 assertTrue("nodeReplaceChildOldChildNonexistentAssert1",success);
00079 }
00080
00081 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001