Code example for Principal

Methods: getName

0
        } 
    } 
     
    public void testCreateUserPrincipal() throws IOException 
    { 
        _database.createPrincipal(PRINCIPAL, PASSWORD.toCharArray());
        Principal newPrincipal = _database.getUser(PRINCIPAL_USERNAME);
        assertNotNull(newPrincipal);
        assertEquals(PRINCIPAL.getName(), newPrincipal.getName());
    } 
     
    public void testVerifyPassword() throws IOException, AccountNotFoundException 
    { 
        testCreateUserPrincipal(); 
        //assertFalse(_pwdDB.verifyPassword(_username, null)); 
        assertFalse(_database.verifyPassword(PRINCIPAL_USERNAME, new char[]{}));
        assertFalse(_database.verifyPassword(PRINCIPAL_USERNAME, (PASSWORD+"z").toCharArray()));
        assertTrue(_database.verifyPassword(PRINCIPAL_USERNAME, PASSWORD.toCharArray()));
         
        try 
        {