Public Methods | |
| elementwrongdocumenterr (DOMTestDocumentBuilderFactory factory) | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
"WRONG_DOCUMENT_ERR DOMException if the "newAttr"
was created from a different document than the one that
created this document.
Retrieve the last employee and attempt to set a new
attribute node for its "employee" element. The new
attribute was created from a document other than the
one that created this element, therefore a
WRONG_DOCUMENT_ERR DOMException should be raised.
This test uses the "createAttribute(newAttr)" method
from the Document interface.
Definition at line 65 of file elementwrongdocumenterr.java.
|
|
Definition at line 67 of file elementwrongdocumenterr.java.
00068 {
00069 super(factory);
00070
00071 }
|
|
|
Reimplemented from DOMTest. Definition at line 99 of file elementwrongdocumenterr.java.
00099 {
00100 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementwrongdocumenterr";
00101 }
|
|
|
Definition at line 102 of file elementwrongdocumenterr.java. References DOMTestCase::doMain().
00102 {
00103 DOMTestCase.doMain(elementwrongdocumenterr.class,args);
00104 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 73 of file elementwrongdocumenterr.java. References DOMTestCase::assertTrue(), and DOMTest::load().
00073 {
00074 Document doc1;
00075 Document doc2;
00076 Attr newAttribute;
00077 NodeList addressElementList;
00078 Element testAddress;
00079 Attr attrAddress;
00080 doc1 = load("staff");
00081 doc2 = load("staff");
00082 newAttribute = doc2.createAttribute("newAttribute");
00083 addressElementList = doc1.getElementsByTagName("address");
00084 testAddress = (Element)addressElementList.item(4);
00085
00086 {
00087 boolean success = false;
00088 try {
00089 attrAddress = testAddress.setAttributeNode(newAttribute);
00090
00091 }
00092 catch(DOMException ex) {
00093 success = (ex.code == DOMException.WRONG_DOCUMENT_ERR);
00094 }
00095 assertTrue("elementWrongDocumentErrAssert",success);
00096 }
00097
00098 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001