nodechildnodesemptypublic final class nodechildnodesempty extends org.w3c.domts.DOMTestCase The "getChildNodes()" method returns a NodeList
that contains all children of this node. If there
are not any children, this is a NodeList that does not
contain any nodes.
Retrieve the Text node from the second child of the second
employee and invoke the "getChildNodes()" method. The
NodeList returned should not have any nodes. |
Constructors Summary |
---|
public nodechildnodesempty(org.w3c.domts.DOMTestDocumentBuilderFactory factory)Constructor.
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "staff", false);
|
Methods Summary |
---|
public java.lang.String | getTargetURI()Gets URI that identifies the test.
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodechildnodesempty";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(nodechildnodesempty.class, args);
| public void | runTest()Runs the test case.
Document doc;
NodeList elementList;
Node employeeNode;
NodeList childList;
Node secondCNode;
Node textNode;
NodeList childNodesList;
doc = (Document) load("staff", false);
elementList = doc.getElementsByTagName("employee");
employeeNode = elementList.item(1);
childList = employeeNode.getChildNodes();
secondCNode = childList.item(1);
textNode = secondCNode.getFirstChild();
childNodesList = textNode.getChildNodes();
assertSize("nodeChildNodesEmptyAssert1", 0, childNodesList);
|
|