LoginContext loginContext = null;
// Test that the user can log in.
try
{
PassiveCallbackHandler pch = new PassiveCallbackHandler("anon", "password");
loginContext = new LoginContext("Jetspeed", pch);
loginContext.login();
loginContext.logout();
}
catch (LoginException le)
{
le.printStackTrace();
assertTrue("failed to login user with new password.", false);
}
pwc = ums.getPasswordCredential(user);
pwc.setPassword("password", "newpassword");
ums.storePasswordCredential(pwc);
// Test that the user can log in with the new password.
try
{
PassiveCallbackHandler pch = new PassiveCallbackHandler("anon", "newpassword");
loginContext = new LoginContext("Jetspeed", pch);
loginContext.login();
loginContext.logout();
}
catch (LoginException le)