Code example for KeyException

Methods: getCause, getMessage

0
 
    /** 
     * Test for <code>KeyException(Throwable)</code> constructor Assertion: 
     * constructs KeyException when <code>cause</code> is null 
     */ 
    @TestTargetNew( 
        level = TestLevel.PARTIAL_COMPLETE, 
        notes = "", 
        method = "KeyException", 
        args = {java.lang.Throwable.class}
    ) 
    public void testKeyException04() { 
        Throwable cause = null;
        KeyException tE = new KeyException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>KeyException(Throwable)</code> constructor Assertion: 
     * constructs KeyException when <code>cause</code> is not null