Main Page Packages Class Hierarchy Compound List File List Compound Members

# namednodemapsetnameditemwithnewvalue Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

If the "setNamedItem(arg)" method does not replace an existing node with the same name then it returns null.

Retrieve the third employee and create a NamedNodeMap object from the attributes of the last child. Once the list is created the "setNamedItem(arg)" method is invoked with arg=newAttr, where newAttr is a newly created Attr Node and whose node name already exists in the map. The "setNamedItem(arg)" method should add the new node and return null. 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 51 of file namednodemapsetnameditemwithnewvalue.java.

## Constructor & Destructor Documentation

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

| Definition at line 53 of file namednodemapsetnameditemwithnewvalue.java.
    00054  {
    00055       super(factory);
    00056
    00057    }

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 75 of file namednodemapsetnameditemwithnewvalue.java.
    00075                                 {
    00076       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapsetnameditemwithnewvalue";
    00077    }

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

| Definition at line 78 of file namednodemapsetnameditemwithnewvalue.java. References DOMTestCase::doMain().
    00078                                           {
    00079         DOMTestCase.doMain(namednodemapsetnameditemwithnewvalue.class,args);
    00080    }

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

| Reimplemented from DOMTestCase. Definition at line 59 of file namednodemapsetnameditemwithnewvalue.java. References DOMTestCase::assertNull(), and DOMTest::load().
    00059                                                     {
    00060       Document doc;
    00061       NodeList elementList;
    00062       Attr newAttribute;
    00063       Node testAddress;
    00064       NamedNodeMap attributes;
    00065       Node newNode;
    00066       doc = load("staff");
    00067       elementList = doc.getElementsByTagName("address");
    00068       testAddress = elementList.item(2);
    00069       newAttribute = doc.createAttribute("district");
    00070       attributes = testAddress.getAttributes();
    00071       newNode = attributes.setNamedItem(newAttribute);
    00072       assertNull("namednodemapSetNamedItemWithNewValueAssert",newNode);
    00073
    00074    }

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

- namednodemapsetnameditemwithnewvalue.java