Public Methods | |
| nodelisttraverselist (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 traverse the list from index=0 thru length -1.
Definition at line 44 of file nodelisttraverselist.java.
|
|
Definition at line 46 of file nodelisttraverselist.java.
00047 {
00048 super(factory);
00049
00050 }
|
|
|
Reimplemented from DOMTest. Definition at line 108 of file nodelisttraverselist.java.
00108 {
00109 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodelisttraverselist";
00110 }
|
|
|
Definition at line 111 of file nodelisttraverselist.java. References DOMTestCase::doMain().
00111 {
00112 DOMTestCase.doMain(nodelisttraverselist.class,args);
00113 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 52 of file nodelisttraverselist.java. References DOMTestCase::assertEquals(), DOMTest::isIgnoringElementContentWhitespace(), and DOMTest::load().
00052 {
00053 Document doc;
00054 NodeList elementList;
00055 Node employeeNode;
00056 NodeList employeeList;
00057 Node child;
00058 String childName;
00059 List result = new ArrayList();
00060
00061 List expectedWhitespace = new ArrayList();
00062 expectedWhitespace.add("#text");
00063 expectedWhitespace.add("employeeId");
00064 expectedWhitespace.add("#text");
00065 expectedWhitespace.add("name");
00066 expectedWhitespace.add("#text");
00067 expectedWhitespace.add("position");
00068 expectedWhitespace.add("#text");
00069 expectedWhitespace.add("salary");
00070 expectedWhitespace.add("#text");
00071 expectedWhitespace.add("gender");
00072 expectedWhitespace.add("#text");
00073 expectedWhitespace.add("address");
00074 expectedWhitespace.add("#text");
00075
00076 List expectedNoWhitespace = new ArrayList();
00077 expectedNoWhitespace.add("employeeId");
00078 expectedNoWhitespace.add("name");
00079 expectedNoWhitespace.add("position");
00080 expectedNoWhitespace.add("salary");
00081 expectedNoWhitespace.add("gender");
00082 expectedNoWhitespace.add("address");
00083
00084 doc = load("staff");
00085 elementList = doc.getElementsByTagName("employee");
00086 employeeNode = elementList.item(2);
00087 employeeList = employeeNode.getChildNodes();
00088 for(int _index = 0; _index < employeeList.getLength();_index++) {
00089 child = ( Node ) employeeList.item(_index);
00090 childName = child.getNodeName();
00091 result.add(childName);
00092
00093 }
00094
00095 if(
00096 isIgnoringElementContentWhitespace()
00097 ) {
00098 assertEquals("nowhitespace",expectedNoWhitespace,result);
00099
00100 }
00101
00102 else {
00103 assertEquals("whitespace",expectedWhitespace,result);
00104
00105 }
00106
00107 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001