Public Methods | |
| namednodemapsetnameditem (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
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.
Definition at line 53 of file namednodemapsetnameditem.java.
|
|
Definition at line 55 of file namednodemapsetnameditem.java.
00056 {
00057 super(factory);
00058
00059 }
|
|
|
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 }
|
|
|
Definition at line 84 of file namednodemapsetnameditem.java. References DOMTestCase::doMain().
00084 {
00085 DOMTestCase.doMain(namednodemapsetnameditem.class,args);
00086 }
|
|
|
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 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001