Code example for InvalidKeySpecException

Methods: getCause, getMessage

0
     * Test for <code>InvalidKeySpecException(String, Throwable)</code> 
     * constructor Assertion: constructs InvalidKeySpecException when 
     * <code>cause</code> is null <code>msg</code> is null 
     */ 
    public void testInvalidKeySpecException06() { 
        InvalidKeySpecException tE = new InvalidKeySpecException(null, null);
        assertNull("getMessage() must return null", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>InvalidKeySpecException(String, Throwable)</code> 
     * constructor Assertion: constructs InvalidKeySpecException when 
     * <code>cause</code> is null <code>msg</code> is not null 
     */ 
    public void testInvalidKeySpecException07() { 
        InvalidKeySpecException tE;
        for (int i = 0; i < msgs.length; i++) {
            tE = new InvalidKeySpecException(msgs[i], null);
            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                    .getMessage(), msgs[i]);