Index: trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC5ParameterSpecTest.java =================================================================== --- trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC5ParameterSpecTest.java (revision 429230) +++ trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC5ParameterSpecTest.java (working copy) @@ -123,12 +123,19 @@ assertFalse("The change of iv specified in the constructor " + "should not cause the change of internal array.", iv[offset] == ps.getIV()[0]); + // regression test for HARMONY-1077 + try { + new RC5ParameterSpec(0, 9, 77, new byte[] { 2 }, -100); + fail("ArrayIndexOutOfBoundsException expected"); + } catch (ArrayIndexOutOfBoundsException e) { + //expected + } } /** - * getVersion() method testing. Tests that returned value is - * equal to the value specified in the constructor. - */ + * getVersion() method testing. Tests that returned value is equal to the + * value specified in the constructor. + */ public void testGetVersion() { int version = 1; int rounds = 5; Index: trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/SecretKeySpecTest.java =================================================================== --- trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/SecretKeySpecTest.java (revision 429230) +++ trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/SecretKeySpecTest.java (working copy) @@ -133,6 +133,13 @@ assertFalse("The change of key specified in the constructor " + "should not cause the change of internal array.", key[offset] == ks.getEncoded()[0]); + // regression test for HARMONY-1077 + try { + new SecretKeySpec(new byte[] {2}, 4, -100, "CCC"); + fail("ArrayIndexOutOfBoundsException expected"); + } catch (ArrayIndexOutOfBoundsException e) { + //expected + } } /**