Code example for LoginException

Methods: getCause, getMessage

0
    /** 
     * javax.security.auth.login.LoginException#LoginException() 
     * Assertion: constructs LoginException with no detail message 
     */ 
    public void testLoginException01() { 
        LoginException lE = new LoginException();
        assertNull("getMessage() must return null.", lE.getMessage());
        assertNull("getCause() must return null", lE.getCause());
    } 
 
    /** 
     * javax.security.auth.login.LoginException#LoginException(String msg) 
     * Assertion: constructs with not null parameter. 
     */ 
    public void testLoginException02() { 
        LoginException lE;
        for (int i = 0; i < msgs.length; i++) {
            lE = new LoginException(msgs[i]);
            assertEquals("getMessage() must return: ".concat(msgs[i]), lE.getMessage(), msgs[i]);
            assertNull("getCause() must return null", lE.getCause());
        }