Code example for InvalidKeySpecException

Methods: getCause, getMessage

0
     * Assertion: constructs InvalidKeySpecException when <code>cause</code> 
     * is null 
     */ 
    public void testInvalidKeySpecException04() { 
        Throwable cause = null;
        InvalidKeySpecException tE = new InvalidKeySpecException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>InvalidKeySpecException(Throwable)</code> constructor 
     * Assertion: constructs InvalidKeySpecException when <code>cause</code> 
     * is not null 
     */ 
    public void testInvalidKeySpecException05() { 
        InvalidKeySpecException tE = new InvalidKeySpecException(tCause);
        if (tE.getMessage() != null) {
            String toS = tCause.toString();
            String getM = tE.getMessage();
            assertTrue("getMessage() should contain ".concat(toS), (getM