Public Methods | |
| namednodemapsetnameditemthatexists (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 and whose node name already exists in the map. The "setNamedItem(arg)" method should replace the already existing node with the new one. This node is then retrieved using the "getNamedItem(name)" method. This test uses the "createAttribute(name)" method from the document interface
Definition at line 55 of file namednodemapsetnameditemthatexists.java.
|
|
Definition at line 57 of file namednodemapsetnameditemthatexists.java.
00058 {
00059 super(factory);
00060
00061 }
|
|
|
Reimplemented from DOMTest. Definition at line 83 of file namednodemapsetnameditemthatexists.java.
00083 {
00084 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemthatexists";
00085 }
|
|
|
Definition at line 86 of file namednodemapsetnameditemthatexists.java. References DOMTestCase::doMain().
00086 {
00087 DOMTestCase.doMain(namednodemapsetnameditemthatexists.class,args);
00088 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 63 of file namednodemapsetnameditemthatexists.java. References DOMTestCase::assertEquals(), and DOMTest::load().
00063 {
00064 Document doc;
00065 NodeList elementList;
00066 Attr newAttribute;
00067 Node testAddress;
00068 NamedNodeMap attributes;
00069 Attr districtNode;
00070 String attrValue;
00071 Node setNode;
00072 doc = load("staff");
00073 elementList = doc.getElementsByTagName("address");
00074 testAddress = elementList.item(1);
00075 newAttribute = doc.createAttribute("street");
00076 attributes = testAddress.getAttributes();
00077 setNode = attributes.setNamedItem(newAttribute);
00078 districtNode = (Attr)attributes.getNamedItem("street");
00079 attrValue = districtNode.getNodeValue();
00080 assertEquals("namednodemapSetNamedItemThatExistsAssert","",attrValue);
00081
00082 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001