/** * Test that trying to add an annotation with a negative range throws * an IndexOutOfBoundsException. */ public void testNegativeRangeSetAnnotationThrowsException() throws Exception { init("<p>abcdef</p>"); try { doc.setAnnotation(4, 1, "style/color", "slarken"); // Doh - no exception thrown. Fail the test fail(); } catch (IndexOutOfBoundsException iae) { // expected } }
/** * Test that trying to add an annotation with a negative range throws * an IndexOutOfBoundsException. */ public void testNegativeRangeSetAnnotationThrowsException() throws Exception { init("<p>abcdef</p>"); try { doc.setAnnotation(4, 1, "style/color", "slarken"); // Doh - no exception thrown. Fail the test fail(); } catch (IndexOutOfBoundsException iae) { // expected } }
/** * Test that trying to add an annotation with an end past the size throws * an IndexOutOfBoundsException. */ public void testSetAnnotationPastDocEndThrowsException() throws Exception { init("<p>abcdef</p>"); try { doc.setAnnotation(1, doc.size() + 1, "style/color", "frub"); // Doh - no exception thrown. Fail the test fail(); } catch (IndexOutOfBoundsException iae) { // expected } }
/** * Test that trying to add an annotation with an end past the size throws * an IndexOutOfBoundsException. */ public void testSetAnnotationPastDocEndThrowsException() throws Exception { init("<p>abcdef</p>"); try { doc.setAnnotation(1, doc.size() + 1, "style/color", "frub"); // Doh - no exception thrown. Fail the test fail(); } catch (IndexOutOfBoundsException iae) { // expected } }
"<?a \"style/color\"=\"tallulah\"?>e<?a \"style/color\"?>f</p>"); fail();
"<?a \"style/color\"=\"tallulah\"?>e<?a \"style/color\"?>f</p>"); fail();
"</p>"); fail();
"</p>"); fail();
"</p>"); fail();
"</p>"); fail();
"</p></blip>"); fail();
"</p></blip>"); fail();