Main Page Packages Class Hierarchy Compound List File List Compound Members

# characterdataindexsizeerrdeletedatacountnegative Class Reference

Inherits DOMTestCase.

List of all members.

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

## Detailed Description

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

Retrieve the character data of the last child of the first employee and invoke its "deleteData(offset,count)" method with offset=10 and count=-3. It should raise the desired exception since the count 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-6531BCCF , http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR'])

Definition at line 48 of file characterdataindexsizeerrdeletedatacountnegative.java.

## Constructor & Destructor Documentation

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

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

## Member Function Documentation

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

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

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

| Definition at line 88 of file characterdataindexsizeerrdeletedatacountnegative.java. References DOMTestCase::doMain().
    00088                                           {
    00089         DOMTestCase.doMain(characterdataindexsizeerrdeletedatacountnegative.class,args);
    00090    }

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

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

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

- characterdataindexsizeerrdeletedatacountnegative.java