Public Methods | |
| nodelistreturnfirstitem (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
Create a list of all the children elements of the third employee and access its first child by invoking the "item(index)" method with an index=0. This should result in "text" being returned. Further we evaluate its content(by using the "getNodeName()" method) to ensure the proper element was accessed.
Definition at line 48 of file nodelistreturnfirstitem.java.
|
|
Definition at line 50 of file nodelistreturnfirstitem.java.
00051 {
00052 super(factory);
00053
00054 }
|
|
|
Reimplemented from DOMTest. Definition at line 83 of file nodelistreturnfirstitem.java.
00083 {
00084 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelistreturnfirstitem";
00085 }
|
|
|
Definition at line 86 of file nodelistreturnfirstitem.java. References DOMTestCase::doMain().
00086 {
00087 DOMTestCase.doMain(nodelistreturnfirstitem.class,args);
00088 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 56 of file nodelistreturnfirstitem.java. References DOMTestCase::assertEquals(), DOMTest::isIgnoringElementContentWhitespace(), and DOMTest::load().
00056 {
00057 Document doc;
00058 NodeList elementList;
00059 Node employeeNode;
00060 NodeList employeeList;
00061 Node child;
00062 String childName;
00063 doc = load("staff");
00064 elementList = doc.getElementsByTagName("employee");
00065 employeeNode = elementList.item(2);
00066 employeeList = employeeNode.getChildNodes();
00067 child = employeeList.item(0);
00068 childName = child.getNodeName();
00069
00070 if(
00071 isIgnoringElementContentWhitespace()
00072 ) {
00073 assertEquals("item0_NoWhitespace","employeeId",childName);
00074
00075 }
00076
00077 else {
00078 assertEquals("item0_Whitespace","#text",childName);
00079
00080 }
00081
00082 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001