Public Methods | |
| namednodemapwrongdocumenterr (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 another Attr node to it that was created from a different DOM document. This should raise the desired exception. This method uses the "createAttribute(name)" method from the Document interface.
Definition at line 51 of file namednodemapwrongdocumenterr.java.
|
|
Definition at line 53 of file namednodemapwrongdocumenterr.java.
00054 {
00055 super(factory);
00056
00057 }
|
|
|
Reimplemented from DOMTest. Definition at line 88 of file namednodemapwrongdocumenterr.java.
00088 {
00089 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/namednodemapwrongdocumenterr";
00090 }
|
|
|
Definition at line 91 of file namednodemapwrongdocumenterr.java. References DOMTestCase::doMain().
00091 {
00092 DOMTestCase.doMain(namednodemapwrongdocumenterr.class,args);
00093 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 59 of file namednodemapwrongdocumenterr.java. References DOMTestCase::assertTrue(), and DOMTest::load().
00059 {
00060 Document doc1;
00061 Document doc2;
00062 NodeList elementList;
00063 Node testAddress;
00064 NamedNodeMap attributes;
00065 Node newAttribute;
00066 String name;
00067 Node setNode;
00068 doc1 = load("staff");
00069 doc2 = load("staff");
00070 elementList = doc1.getElementsByTagName("address");
00071 testAddress = elementList.item(2);
00072 newAttribute = doc2.createAttribute("newAttribute");
00073 attributes = testAddress.getAttributes();
00074
00075 {
00076 boolean success = false;
00077 try {
00078 setNode = attributes.setNamedItem(newAttribute);
00079
00080 }
00081 catch(DOMException ex) {
00082 success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
00083 }
00084 assertTrue("namednodemapWrongDocumentErrAssert",success);
00085 }
00086
00087 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001