Public Methods | |
| namednodemapinuseattributeerr (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
Create a NamedNodeMap object from the attributes of the last child of the third employee and attempt to add an attribute that is already being used by the first employee. This should raise the desired exception.
Definition at line 48 of file namednodemapinuseattributeerr.java.
|
|
Definition at line 50 of file namednodemapinuseattributeerr.java.
00051 {
00052 super(factory);
00053
00054 }
|
|
|
Reimplemented from DOMTest. Definition at line 88 of file namednodemapinuseattributeerr.java.
00088 {
00089 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapinuseattributeerr";
00090 }
|
|
|
Definition at line 91 of file namednodemapinuseattributeerr.java. References DOMTestCase::doMain().
00091 {
00092 DOMTestCase.doMain(namednodemapinuseattributeerr.class,args);
00093 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 56 of file namednodemapinuseattributeerr.java. References DOMTestCase::assertTrue(), and DOMTest::load().
00056 {
00057 Document doc;
00058 NodeList elementList;
00059 Element firstNode;
00060 Node testNode;
00061 NamedNodeMap attributes;
00062 Attr domesticAttr;
00063 Attr setAttr;
00064 Node setNode;
00065 doc = load("staff");
00066 elementList = doc.getElementsByTagName("address");
00067 firstNode = (Element)elementList.item(0);
00068 domesticAttr = doc.createAttribute("domestic");
00069 domesticAttr.setValue("Yes");
00070 setAttr = firstNode.setAttributeNode(domesticAttr);
00071 elementList = doc.getElementsByTagName("address");
00072 testNode = elementList.item(2);
00073 attributes = testNode.getAttributes();
00074
00075 {
00076 boolean success = false;
00077 try {
00078 setNode = attributes.setNamedItem(domesticAttr);
00079
00080 }
00081 catch(DOMException ex) {
00082 success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR);
00083 }
00084 assertTrue("namednodemapInUseAttributeErrAssert",success);
00085 }
00086
00087 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001