Code example for IvParameterSpec

Methods: getIV

0
     * NullPointerException is thrown in the case of null input 
     * array and that input array is copied during initialization. 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "IvParameterSpec", 
        args = {byte[].class} 
    ) 
    public void testIvParameterSpec1() { 
        try { 
            new IvParameterSpec(null);
            fail("Should raise an NullPointerException "
                    + "in the case of null byte array."); 
        } catch(NullPointerException e) {
        } 
 
        byte[] iv = new byte[] {1, 2, 3, 4, 5};
        IvParameterSpec ivps = new IvParameterSpec(iv);
        iv[0] ++;
        assertFalse("The change of input array's content should not cause "