Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

nodereplacechildnodename Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

 nodereplacechildnodename (DOMTestDocumentBuilderFactory factory)
void runTest () throws java.lang.Throwable
String getTargetURI ()

Static Public Methods

void main (String[] args)


Detailed Description

The "replaceChild(newChild,oldChild)" method returns the node being replaced.

Replace the second Element of the second employee with a newly created node Element and check the NodeName returned by the "replaceChild(newChild,oldChild)" method. The returned node should have a NodeName equal to "employeeId".

Author:
NIST , Mary Brady
See also:
http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307

Definition at line 47 of file nodereplacechildnodename.java.


Constructor & Destructor Documentation

nodereplacechildnodename::nodereplacechildnodename DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 49 of file nodereplacechildnodename.java.

00050  {
00051       super(factory);
00052 
00053    }


Member Function Documentation

String nodereplacechildnodename::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 86 of file nodereplacechildnodename.java.

00086                                 {
00087       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodereplacechildnodename";
00088    }

void nodereplacechildnodename::main String    args[] [inline, static]
 

Definition at line 89 of file nodereplacechildnodename.java.

References DOMTestCase::doMain().

00089                                           {
00090         DOMTestCase.doMain(nodereplacechildnodename.class,args);
00091    }

void nodereplacechildnodename::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 55 of file nodereplacechildnodename.java.

References DOMTestCase::assertEquals(), DOMTest::isIgnoringElementContentWhitespace(), and DOMTest::load().

00055                                                     {
00056       Document doc;
00057       NodeList elementList;
00058       Node employeeNode;
00059       NodeList childList;
00060       Node oldChild;
00061       Node newChild;
00062       Node replacedNode;
00063       String childName;
00064       doc = load("staff");
00065       elementList = doc.getElementsByTagName("employee");
00066       employeeNode = elementList.item(1);
00067       childList = employeeNode.getChildNodes();
00068       oldChild = childList.item(1);
00069       newChild = doc.createElement("newChild");
00070       replacedNode = employeeNode.replaceChild(newChild,oldChild);
00071       childName = replacedNode.getNodeName();
00072       
00073         if(
00074         isIgnoringElementContentWhitespace()
00075         ) {
00076         assertEquals("nowhitespace","name",childName);
00077       
00078         }
00079         
00080                 else {
00081                         assertEquals("whitespace","employeeId",childName);
00082       
00083                 }
00084         
00085    }


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 19:47:09 2002 for DOM Level 1 Core Test Suite by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001