validate(otherCBH);
}
private void validate(JBossCallbackHandler cbh) throws Exception
{
SecurityAssociationCallback sacb = new SecurityAssociationCallback();
NameCallback ncb = new NameCallback("Enter Name");
ObjectCallback ocb = new ObjectCallback("Enter pass");
PasswordCallback passcb = new PasswordCallback("Enter pass", false);
Callback[] callbacks = new Callback[] {sacb, ncb, ocb, passcb};
cbh.handle(callbacks);
assertEquals("anil", sacb.getPrincipal().getName());
assertEquals("testpass", sacb.getCredential());
assertEquals("anil", ncb.getName());
assertEquals("testpass", ocb.getCredential());
assertEquals("testpass", new String(passcb.getPassword()));
}