Main Page Packages Class Hierarchy Compound List File List Compound Members

# nodeinsertbeforerefchildnonexistent Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

The "insertBefore(newChild,refChild)" method raises a NOT_FOUND_ERR DOMException if the reference child is not a child of this node.

Retrieve the second employee and attempt to insert a new node before a reference node that is not a child of this node. An attempt to insert before a non child node should raise the desired exception.

Author:
  NIST , Mary Brady

See also:
  http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727

Definition at line 49 of file nodeinsertbeforerefchildnonexistent.java.

## Constructor & Destructor Documentation

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

| Definition at line 51 of file nodeinsertbeforerefchildnonexistent.java.
    00052  {
    00053       super(factory);
    00054
    00055    }

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 83 of file nodeinsertbeforerefchildnonexistent.java.
    00083                                 {
    00084       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeinsertbeforerefchildnonexistent";
    00085    }

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

| Definition at line 86 of file nodeinsertbeforerefchildnonexistent.java. References DOMTestCase::doMain().
    00086                                           {
    00087         DOMTestCase.doMain(nodeinsertbeforerefchildnonexistent.class,args);
    00088    }

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

| Reimplemented from DOMTestCase. Definition at line 57 of file nodeinsertbeforerefchildnonexistent.java. References DOMTestCase::assertTrue(), and DOMTest::load().
    00057                                                     {
    00058       Document doc;
    00059       Node refChild;
    00060       Node newChild;
    00061       NodeList elementList;
    00062       Node elementNode;
    00063       Node insertedNode;
    00064       doc = load("staff");
    00065       newChild = doc.createElement("newChild");
    00066       refChild = doc.createElement("refChild");
    00067       elementList = doc.getElementsByTagName("employee");
    00068       elementNode = elementList.item(1);
    00069
    00070         {
    00071                 boolean success = false;
    00072                 try {
    00073                         insertedNode = elementNode.insertBefore(newChild,refChild);
    00074
    00075                 }
    00076                 catch(DOMException ex) {
    00077                         success = (ex.code == DOMException.NOT_FOUND_ERR);
    00078                 }
    00079                 assertTrue("nodeInsertBeforeRefChildNonexistentAssert1",success);
    00080         }
    00081
    00082    }

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

- nodeinsertbeforerefchildnonexistent.java