*/
public void testCharArrayStringCredential()
{
SimplePrincipal jduke = new SimplePrincipal("jduke");
CallbackHandler handler = new SecurityAssociationHandler(jduke, "theduke".toCharArray());
JaasSecurityManager sm = new JaasSecurityManager("testStringCharArrayCredential", handler);
TimedCachePolicy cache = new TimedCachePolicy(600, true, 10);
cache.create();
cache.start();
sm.setCachePolicy(cache);
// Reset the validation count
CountedLoginModule.validateCount = 0;
// Initial validation to populate the cache
assertTrue(sm.isValid(jduke, "theduke".toCharArray()));
// Validate that the char[] credential form uses the cache
assertTrue(sm.isValid(jduke, "theduke".toCharArray()));
// Validate that the String credential form uses the cache
assertTrue(sm.isValid(jduke, "theduke"));
}