Index: trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/javax/crypto/spec/RC5ParameterSpecTest.java =================================================================== --- trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/javax/crypto/spec/RC5ParameterSpecTest.java (revision 0) +++ trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/javax/crypto/spec/RC5ParameterSpecTest.java (revision 0) @@ -0,0 +1,42 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.harmony.security.tests.javax.crypto.spec; + +import junit.framework.TestCase; +import javax.crypto.spec.RC5ParameterSpec; + +public class RC5ParameterSpecTest extends TestCase { + + public static void main(String[] args) { + } + + public RC5ParameterSpecTest(String arg0) { + super(arg0); + } + + /** + * Test for RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv, int offset) constructor + */ + public void testRC5ParameterSpecIIIBI() { + try { + new RC5ParameterSpec(0, 9, 77, new byte[] {2}, -100); + fail("ArrayIndexOutOfBoundsException expected"); + } catch (ArrayIndexOutOfBoundsException e) { + //expected + } + } +} Index: trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/javax/crypto/spec/SecretKeySpecTest.java =================================================================== --- trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/javax/crypto/spec/SecretKeySpecTest.java (revision 0) +++ trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/javax/crypto/spec/SecretKeySpecTest.java (revision 0) @@ -0,0 +1,42 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.harmony.security.tests.javax.crypto.spec; + +import junit.framework.TestCase; +import javax.crypto.spec.SecretKeySpec; + +public class SecretKeySpecTest extends TestCase { + + public static void main(String[] args) { + } + + public SecretKeySpecTest(String arg0) { + super(arg0); + } + + /** + * Test for SecretKeySpec(byte[] key, int offset, int len, String algorithm) constructor + */ + public void testSecretKeySpecBIILjava_lang_String() { + try { + new SecretKeySpec(new byte[] {2}, 4, -100, "CCC"); + fail("ArrayIndexOutOfBoundsException expected"); + } catch (ArrayIndexOutOfBoundsException e) { + //expected + } + } +}