String username, String domain, String password)
throws Exception {
AuthenticationResponse response;
response = am.authenticate(
new SimpleAuthenticationIdentity(username));
assertTrue(comment + ": Username, no domain, no password",
response.isValid());
response = am.authenticate(new SimpleAuthenticationIdentity(
username, null));
assertTrue(comment + ": Username, no domain, null password",
response.isValid());
response = am.authenticate(new SimpleAuthenticationIdentity(
username, ""));
assertFalse(comment + ": Username, no domain, empty password",
response.isValid());
response = am.authenticate(
new SimpleAuthenticationIdentity(username, null, domain));
assertTrue(comment + ": Username, domain, null password",
response.isValid());
response = am.authenticate(new SimpleAuthenticationIdentity(
username, "", domain));
assertFalse(comment + ": Username, domain, empty password",
response.isValid());
response = am.authenticate(new SimpleAuthenticationIdentity(
username, password, domain));
assertTrue(comment + ": Username, domain, password",
response.isValid());
response = am.authenticate(new SimpleAuthenticationIdentity(
username, password + "makeinvalid"));
assertFalse(comment + ": Username, no domain, incorrect password",
response.isValid());
response = am.authenticate(new SimpleAuthenticationIdentity(
username, password + "makeinvalid", domain));
assertFalse(comment + ": Username, domain, incorrect password",
response.isValid());
}