Main Page Packages Class Hierarchy Compound List File List Compound Members

# textindexsizeerroffsetoutofbounds Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

The "splitText(offset)" method raises an INDEX_SIZE_ERR DOMException if the specified offset is greater than the number of characters in the Text node.

Retrieve the textual data from the second child of the third employee and invoke the "splitText(offset)" method. The desired exception should be raised since the offset is a greater than the number of characters in the Text node.

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

Definition at line 49 of file textindexsizeerroffsetoutofbounds.java.

## Constructor & Destructor Documentation

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

| Definition at line 51 of file textindexsizeerroffsetoutofbounds.java.
    00052  {
    00053       super(factory);
    00054
    00055    }

## Member Function Documentation

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

| Reimplemented from DOMTest. Definition at line 81 of file textindexsizeerroffsetoutofbounds.java.
    00081                                 {
    00082       return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textindexsizeerroffsetoutofbounds";
    00083    }

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

| Definition at line 84 of file textindexsizeerroffsetoutofbounds.java. References DOMTestCase::doMain().
    00084                                           {
    00085         DOMTestCase.doMain(textindexsizeerroffsetoutofbounds.class,args);
    00086    }

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

| Reimplemented from DOMTestCase. Definition at line 57 of file textindexsizeerroffsetoutofbounds.java. References DOMTestCase::assertTrue(), and DOMTest::load().
    00057                                                     {
    00058       Document doc;
    00059       NodeList elementList;
    00060       Node nameNode;
    00061       Text textNode;
    00062       Text splitNode;
    00063       doc = load("staff");
    00064       elementList = doc.getElementsByTagName("name");
    00065       nameNode = elementList.item(2);
    00066       textNode = (Text)nameNode.getFirstChild();
    00067
    00068         {
    00069                 boolean success = false;
    00070                 try {
    00071                         splitNode = textNode.splitText(300);
    00072
    00073                 }
    00074                 catch(DOMException ex) {
    00075                         success = (ex.code == DOMException.INDEX_SIZE_ERR);
    00076                 }
    00077                 assertTrue("textIndexSizeErrOffsetOutOfBoundsAssert",success);
    00078         }
    00079
    00080    }

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

- textindexsizeerroffsetoutofbounds.java