Public Methods | |
| elementcreatenewattribute (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
Retrieve first address element and add a new attribute node to it by invoking its "setAttributeNode(newAttr)" method. This test makes use of the "createAttribute(name)" method from the Document interface.
Definition at line 46 of file elementcreatenewattribute.java.
|
|
Definition at line 48 of file elementcreatenewattribute.java.
00049 {
00050 super(factory);
00051
00052 }
|
|
|
Reimplemented from DOMTest. Definition at line 74 of file elementcreatenewattribute.java.
00074 {
00075 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementcreatenewattribute";
00076 }
|
|
|
Definition at line 77 of file elementcreatenewattribute.java. References DOMTestCase::doMain().
00077 {
00078 DOMTestCase.doMain(elementcreatenewattribute.class,args);
00079 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 54 of file elementcreatenewattribute.java. References DOMTestCase::assertEquals(), DOMTestCase::assertNotNull(), DOMTestCase::assertNull(), and DOMTest::load().
00054 {
00055 Document doc;
00056 NodeList elementList;
00057 Element testAddress;
00058 Attr newAttribute;
00059 Attr oldAttr;
00060 Attr districtAttr;
00061 String attrVal;
00062 doc = load("staff");
00063 elementList = doc.getElementsByTagName("address");
00064 testAddress = (Element)elementList.item(0);
00065 newAttribute = doc.createAttribute("district");
00066 oldAttr = testAddress.setAttributeNode(newAttribute);
00067 assertNull("old_attr_doesnt_exist",oldAttr);
00068 districtAttr = testAddress.getAttributeNode("district");
00069 assertNotNull("new_district_accessible",districtAttr);
00070 attrVal = testAddress.getAttribute("district");
00071 assertEquals("attr_value","",attrVal);
00072
00073 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001