new HashMap<String, Object>() );
module.login();
module.commit();
Set principals = m_subject.getPrincipals();
assertEquals( 1, principals.size() );
assertTrue( principals.contains( new WikiPrincipal( "user", WikiPrincipal.LOGIN_NAME ) ) );
assertFalse( principals.contains( Role.AUTHENTICATED ) );
assertFalse( principals.contains( Role.ALL ) );
// Login with a user that IS in the database
m_subject = new Subject();
handler = new WikiCallbackHandler( m_engine, null, "janne", "myP@5sw0rd" );
module = new UserDatabaseLoginModule();
module.initialize( m_subject, handler,
new HashMap<String, Object>(),
new HashMap<String, Object>() );
module.login();
module.commit();
principals = m_subject.getPrincipals();
assertEquals( 1, principals.size() );
assertTrue( principals.contains( new WikiPrincipal( "janne", WikiPrincipal.LOGIN_NAME ) ) );
assertFalse( principals.contains( Role.AUTHENTICATED ) );
assertFalse( principals.contains( Role.ALL ) );
}
catch( LoginException e )
{