Index: trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/DigestOutputStreamTest.java =================================================================== --- trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/DigestOutputStreamTest.java (revision 429584) +++ trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/DigestOutputStreamTest.java (working copy) @@ -397,10 +397,25 @@ } /** - * Test for getMessageDigest() method
- * - * Assertion: reutns associated message digest
+ * Test #5 for write(byte[],int,int) method
*/ + public final void testWritebyteArrayintint05() throws IOException { + try { + new DigestOutputStream(new ByteArrayOutputStream(), MessageDigest + .getInstance("SHA")).write(new byte[] { 1, 1 }, -1, 0); + fail("IndexOutOfBoundsException expected"); + } catch (IndexOutOfBoundsException e) { + //expected + } catch (NoSuchAlgorithmException e) { + // allowed failure + } + } + + /** + * Test for getMessageDigest() method
+ * + * Assertion: reutns associated message digest
+ */ public final void testGetMessageDigest() { for (int k=0; k