Public Methods | |
| characterdataindexsizeerrreplacedatacountnegative (DOMTestDocumentBuilderFactory factory) throws DOMTestIncompatibleException | |
| void | runTest () throws java.lang.Throwable |
| String | getTargetURI () |
Static Public Methods | |
| void | main (String[] args) |
Retrieve the character data of the last child of the first employee and invoke its "replaceData(offset,count,arg) method with offset=10 and count=-3 and arg="ABC". It should raise the desired exception since the count is negative.
Definition at line 49 of file characterdataindexsizeerrreplacedatacountnegative.java.
|
|
Definition at line 51 of file characterdataindexsizeerrreplacedatacountnegative.java. References DOMTest::setFactory(), and DocumentBuilderSetting::signed.
00052 {
00053
00054 DocumentBuilderSetting[] settings = new DocumentBuilderSetting[] {
00055 DocumentBuilderSetting.signed
00056 };
00057 DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
00058 setFactory(testFactory);
00059
00060 }
|
|
|
Reimplemented from DOMTest. Definition at line 86 of file characterdataindexsizeerrreplacedatacountnegative.java.
00086 {
00087 return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdataindexsizeerrreplacedatacountnegative";
00088 }
|
|
|
Definition at line 89 of file characterdataindexsizeerrreplacedatacountnegative.java. References DOMTestCase::doMain().
00089 {
00090 DOMTestCase.doMain(characterdataindexsizeerrreplacedatacountnegative.class,args);
00091 }
|
|
|
Reimplemented from DOMTestCase. Definition at line 62 of file characterdataindexsizeerrreplacedatacountnegative.java. References DOMTestCase::assertTrue(), and DOMTest::load().
00062 {
00063 Document doc;
00064 NodeList elementList;
00065 Node nameNode;
00066 CharacterData child;
00067 String badString;
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 badString = child.substringData(10,-3);
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 }
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001