Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

namednodemapsetnameditem Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

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

Static Public Methods

void main (String[] args)


Detailed Description

The "setNamedItem(arg)" method adds a node using its nodeName attribute.

Retrieve the second employee and create a NamedNodeMap object from the attributes of the last child by invoking the "getAttributes()" method. Once the list is created an invocation of the "setNamedItem(arg)" method is done with arg=newAttr, where newAttr is a new Attr Node previously created. The "setNamedItem(arg)" method should add then new node to the NamedNodeItem object by using its "nodeName" attribute("district'). This node is then retrieved using the "getNamedItem(name)" method. This test uses the "createAttribute(name)" method from the document interface.

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

Definition at line 53 of file namednodemapsetnameditem.java.


Constructor & Destructor Documentation

namednodemapsetnameditem::namednodemapsetnameditem DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 55 of file namednodemapsetnameditem.java.

00056  {
00057       super(factory);
00058 
00059    }


Member Function Documentation

String namednodemapsetnameditem::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 81 of file namednodemapsetnameditem.java.

00081                                 {
00082       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditem";
00083    }

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

Definition at line 84 of file namednodemapsetnameditem.java.

References DOMTestCase::doMain().

00084                                           {
00085         DOMTestCase.doMain(namednodemapsetnameditem.class,args);
00086    }

void namednodemapsetnameditem::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 61 of file namednodemapsetnameditem.java.

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

00061                                                     {
00062       Document doc;
00063       NodeList elementList;
00064       Attr newAttribute;
00065       Node testAddress;
00066       NamedNodeMap attributes;
00067       Attr districtNode;
00068       String attrName;
00069       Node setNode;
00070       doc = load("staff");
00071       elementList = doc.getElementsByTagName("address");
00072       testAddress = elementList.item(1);
00073       newAttribute = doc.createAttribute("district");
00074       attributes = testAddress.getAttributes();
00075       setNode = attributes.setNamedItem(newAttribute);
00076       districtNode = (Attr)attributes.getNamedItem("district");
00077       attrName = districtNode.getNodeName();
00078       assertEquals("namednodemapSetNamedItemAssert","district",attrName);
00079       
00080    }


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