Index: C:/harmony/trunk_0427/modules/crypto/src/test/api/java.injected/javax/crypto/CipherOutputStreamTest.java =================================================================== --- C:/harmony/trunk_0427/modules/crypto/src/test/api/java.injected/javax/crypto/CipherOutputStreamTest.java (revision 419136) +++ C:/harmony/trunk_0427/modules/crypto/src/test/api/java.injected/javax/crypto/CipherOutputStreamTest.java (working copy) @@ -21,7 +21,9 @@ package javax.crypto; +import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; +import java.io.OutputStream; import java.util.Arrays; import javax.crypto.NullCipher; @@ -113,6 +115,30 @@ } /** + * write(byte[] b, int off, int len) method testing. + */ + public void testWrite4() throws Exception { + try { + new CipherOutputStream(new BufferedOutputStream((OutputStream) null), new NullCipher()).write(new byte[] {0}, 1, Integer.MAX_VALUE); + } catch (IllegalArgumentException e) { + //expected + } + } + + /** + * write(byte[] b, int off, int len) method testing. + */ + public void testWrite5() throws Exception { + Cipher cf = Cipher.getInstance("DES/CBC/PKCS5Padding"); + NullCipher nc = new NullCipher(); + CipherOutputStream stream1 = new CipherOutputStream(new BufferedOutputStream((OutputStream) null), nc); + CipherOutputStream stream2 = new CipherOutputStream(stream1, cf); + CipherOutputStream stream3 = new CipherOutputStream(stream2, nc); + stream3.write(new byte[] {0}, 0, 0); + //no exception expected + } + + /** * flush() method testing. Tests that method flushes the data to the * underlying output stream. */