Main Page Packages Class Hierarchy Compound List File List Compound Members

# nodereplacechildoldchildnonexistent Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

The "replaceChild(newChild,oldChild)" method raises a NOT_FOUND_ERR DOMException if the old child is not a child of this node.

Retrieve the second employee and attempt to replace a node that is not one of its children. An attempt to replace such a 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-785887307 , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/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-785887307

Definition at line 48 of file nodereplacechildoldchildnonexistent.java.

## Constructor & Destructor Documentation

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

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

## Member Function Documentation

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

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

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

| Definition at line 85 of file nodereplacechildoldchildnonexistent.java. References DOMTestCase::doMain().
    00085                                           {
    00086         DOMTestCase.doMain(nodereplacechildoldchildnonexistent.class,args);
    00087    }

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

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

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

- nodereplacechildoldchildnonexistent.java