Main Page Packages Class Hierarchy Compound List File List Compound Members

# characterdataindexsizeerrreplacedataoffsetnegative Class Reference

Inherits DOMTestCase.

List of all members.

## Public Methods
| characterdataindexsizeerrreplacedataoffsetnegative (DOMTestDocumentBuilderFactory factory) throws DOMTestIncompatibleException
void | runTest () throws java.lang.Throwable
String | getTargetURI ()
## Static Public Methods
void | main (String[] args)

## Detailed Description

The "replaceData(offset,count,arg)" method raises an INDEX_SIZE_ERR DOMException if the specified offset is negative.

Retrieve the character data of the last child of the first employee and invoke its "replaceData(offset,count,arg) method with offset=-5 and count=3 and arg="ABC". It should raise the desired exception since the offset is negative.

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='INDEX_SIZE_ERR']) , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB

Definition at line 50 of file characterdataindexsizeerrreplacedataoffsetnegative.java.

## Constructor & Destructor Documentation

characterdataindexsizeerrreplacedataoffsetnegative::characterdataindexsizeerrreplacedataoffsetnegative | ( | DOMTestDocumentBuilderFactory | factory | ) | `[inline]`

| Definition at line 52 of file characterdataindexsizeerrreplacedataoffsetnegative.java. References DOMTest::setFactory(), and DocumentBuilderSetting::signed.
    00053                                      {
    00054
    00055       DocumentBuilderSetting[] settings = new DocumentBuilderSetting[] {
    00056 DocumentBuilderSetting.signed
    00057         };
    00058         DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
    00059         setFactory(testFactory);
    00060
    00061    }

## Member Function Documentation

String characterdataindexsizeerrreplacedataoffsetnegative::getTargetURI | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTest. Definition at line 86 of file characterdataindexsizeerrreplacedataoffsetnegative.java.
    00086                                 {
    00087       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrreplacedataoffsetnegative";
    00088    }

void characterdataindexsizeerrreplacedataoffsetnegative::main | ( | String | args[] | ) | `[inline, static]`

| Definition at line 89 of file characterdataindexsizeerrreplacedataoffsetnegative.java. References DOMTestCase::doMain().
    00089                                           {
    00090         DOMTestCase.doMain(characterdataindexsizeerrreplacedataoffsetnegative.class,args);
    00091    }

void characterdataindexsizeerrreplacedataoffsetnegative::runTest | ( |  | ) | `[inline, virtual]`

| Reimplemented from DOMTestCase. Definition at line 63 of file characterdataindexsizeerrreplacedataoffsetnegative.java. References DOMTestCase::assertTrue(), and DOMTest::load().
    00063                                                     {
    00064       Document doc;
    00065       NodeList elementList;
    00066       Node nameNode;
    00067       CharacterData child;
    00068       doc = load("staff");
    00069       elementList = doc.getElementsByTagName("address");
    00070       nameNode = elementList.item(0);
    00071       child = (CharacterData)nameNode.getFirstChild();
    00072
    00073         {
    00074                 boolean success = false;
    00075                 try {
    00076                         child.replaceData(-5,3,"ABC");
    00077
    00078                 }
    00079                 catch(DOMException ex) {
    00080                         success = (ex.code == DOMException.INDEX_SIZE_ERR);
    00081                 }
    00082                 assertTrue("throws_INDEX_SIZE_ERR",success);
    00083         }
    00084
    00085    }

The documentation for this class was generated from the following file:

- characterdataindexsizeerrreplacedataoffsetnegative.java