Main Page Packages Class Hierarchy Compound List File List Compound Members

# elementsetattributenodenull Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

The "setAttributeNode(newAttr)" method returns the null value if no previously existing Attr node with the same name was replaced.

Retrieve the last child of the third employee and add a new attribute to it. The new attribute node added is "district", which is not part of this Element. The method should return the null value. 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-887236154

Definition at line 48 of file elementsetattributenodenull.java.

## Constructor & Destructor Documentation

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

| Definition at line 50 of file elementsetattributenodenull.java.
    00051  {
    00052       super(factory);
    00053
    00054    }

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 70 of file elementsetattributenodenull.java.
    00070                                 {
    00071       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementsetattributenodenull";
    00072    }

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

| Definition at line 73 of file elementsetattributenodenull.java. References DOMTestCase::doMain().
    00073                                           {
    00074         DOMTestCase.doMain(elementsetattributenodenull.class,args);
    00075    }

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

| Reimplemented from DOMTestCase. Definition at line 56 of file elementsetattributenodenull.java. References DOMTestCase::assertNull(), and DOMTest::load().
    00056                                                     {
    00057       Document doc;
    00058       NodeList elementList;
    00059       Element testEmployee;
    00060       Attr newAttribute;
    00061       Attr districtAttr;
    00062       doc = load("staff");
    00063       elementList = doc.getElementsByTagName("address");
    00064       testEmployee = (Element)elementList.item(2);
    00065       newAttribute = doc.createAttribute("district");
    00066       districtAttr = testEmployee.setAttributeNode(newAttribute);
    00067       assertNull("elementSetAttributeNodeNullAssert",districtAttr);
    00068
    00069    }

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

- elementsetattributenodenull.java