Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

elementnotfounderr Class Reference

Inherits DOMTestCase.

List of all members.

Public Methods

 elementnotfounderr (DOMTestDocumentBuilderFactory factory)
void runTest () throws java.lang.Throwable
String getTargetURI ()

Static Public Methods

void main (String[] args)


Detailed Description

The "removeAttributeNode(oldAttr)" method raises a NOT_FOUND_ERR DOMException if the "oldAttr" attribute is not an attribute of the element.

Retrieve the last employee and attempt to remove a non existing attribute node. This should cause the intended exception to be raised. This test makes use of 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#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])

Definition at line 49 of file elementnotfounderr.java.


Constructor & Destructor Documentation

elementnotfounderr::elementnotfounderr DOMTestDocumentBuilderFactory    factory [inline]
 

Definition at line 51 of file elementnotfounderr.java.

00052  {
00053       super(factory);
00054 
00055    }


Member Function Documentation

String elementnotfounderr::getTargetURI   [inline, virtual]
 

Reimplemented from DOMTest.

Definition at line 81 of file elementnotfounderr.java.

00081                                 {
00082       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/elementnotfounderr";
00083    }

void elementnotfounderr::main String    args[] [inline, static]
 

Definition at line 84 of file elementnotfounderr.java.

References DOMTestCase::doMain().

00084                                           {
00085         DOMTestCase.doMain(elementnotfounderr.class,args);
00086    }

void elementnotfounderr::runTest   [inline, virtual]
 

Reimplemented from DOMTestCase.

Definition at line 57 of file elementnotfounderr.java.

References DOMTestCase::assertTrue(), and DOMTest::load().

00057                                                     {
00058       Document doc;
00059       Attr oldAttribute;
00060       NodeList addressElementList;
00061       Element testAddress;
00062       Attr attrAddress;
00063       doc = load("staff");
00064       addressElementList = doc.getElementsByTagName("address");
00065       testAddress = (Element)addressElementList.item(4);
00066       oldAttribute = doc.createAttribute("oldAttribute");
00067       
00068         {
00069                 boolean success = false;
00070                 try {
00071                         attrAddress = testAddress.removeAttributeNode(oldAttribute);
00072       
00073                 }
00074                 catch(DOMException ex) {
00075                         success = (ex.code == DOMException.NOT_FOUND_ERR);
00076                 }
00077                 assertTrue("elementNotFoundErrAssert",success);
00078         }
00079 
00080    }


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 19:46:50 2002 for DOM Level 1 Core Test Suite by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001