Main Page Packages Class Hierarchy Compound List File List Compound Members

# nodeinsertbeforerefchildnull Class Reference

Inherits DOMTestCase.

List of all members.

## Public Methods
| nodeinsertbeforerefchildnull (DOMTestDocumentBuilderFactory factory)
void | runTest () throws java.lang.Throwable
String | getTargetURI ()
## Static Public Methods
void | main (String[] args)

## Detailed Description

If the "refChild" is null then the "insertBefore(newChild,refChild)" method inserts the node "newChild" at the end of the list of children.

Retrieve the second employee and invoke the "insertBefore(newChild,refChild)" method with refChild=null. Since "refChild" is null the "newChild" should be added to the end of the list. The last item in the list is checked after insertion. The last Element node of the list should be "newChild".

Author:
  NIST , Mary Brady

See also:
  http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727

Definition at line 48 of file nodeinsertbeforerefchildnull.java.

## Constructor & Destructor Documentation

nodeinsertbeforerefchildnull::nodeinsertbeforerefchildnull | ( | DOMTestDocumentBuilderFactory | factory | ) | `[inline]`

| Definition at line 50 of file nodeinsertbeforerefchildnull.java.
    00051  {
    00052       super(factory);
    00053
    00054    }

## Member Function Documentation

String nodeinsertbeforerefchildnull::getTargetURI | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTest. Definition at line 78 of file nodeinsertbeforerefchildnull.java.
    00078                                 {
    00079       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforerefchildnull";
    00080    }

void nodeinsertbeforerefchildnull::main | ( | String | args[] | ) | `[inline, static]`

| Definition at line 81 of file nodeinsertbeforerefchildnull.java. References DOMTestCase::doMain().
    00081                                           {
    00082         DOMTestCase.doMain(nodeinsertbeforerefchildnull.class,args);
    00083    }

void nodeinsertbeforerefchildnull::runTest | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestCase. Definition at line 56 of file nodeinsertbeforerefchildnull.java. References DOMTestCase::assertEquals(), and DOMTest::load().
    00056                                                     {
    00057       Document doc;
    00058       NodeList elementList;
    00059       Node employeeNode;
    00060       NodeList childList;
    00061       Node refChild = null;
    00062
    00063       Node newChild;
    00064       Node child;
    00065       String childName;
    00066       Node insertedNode;
    00067       doc = load("staff");
    00068       elementList = doc.getElementsByTagName("employee");
    00069       employeeNode = elementList.item(1);
    00070       childList = employeeNode.getChildNodes();
    00071       newChild = doc.createElement("newChild");
    00072       insertedNode = employeeNode.insertBefore(newChild,refChild);
    00073       child = employeeNode.getLastChild();
    00074       childName = child.getNodeName();
    00075       assertEquals("nodeInsertBeforeRefChildNullAssert1","newChild",childName);
    00076
    00077    }

The documentation for this class was generated from the following file:

- nodeinsertbeforerefchildnull.java