private static final String APP_NAME = LoginModuleTest.class.getName();
public void testMultipleModules() throws Exception {
CallbackHandler ch = new CallbackHandlerImpl(new SimpleCredentials("user", "pass".toCharArray()),
superuser, new ProviderRegistryImpl(new FallbackPrincipalProvider()),
"admin", "anonymous");
LoginContext context = new LoginContext(
APP_NAME, new Subject(), ch, new TestConfiguration());
context.login();
assertFalse("no principal set", context.getSubject().getPrincipals().isEmpty());