* @throws Exception if an error occurs while running the test.
*/
public void testCompletePolicyCreation() throws Exception
{
// check the bean constructed by the metadata factory has the parent policy name set.
ApplicationPolicyBean bean = (ApplicationPolicyBean) super.getBean("TestPolicy2");
assertNotNull("ApplicationPolicyBean not found", bean);
assertNotNull("Parent policy name has not been set", bean.getParentPolicy());
assertEquals("Unexpected parent policy name", "TestPolicy1", bean.getParentPolicy());
// validate the real application policy has been created with the expected contents.
ApplicationPolicy policy = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy2");
assertNotNull("Application policy not found", policy);
// validate the constructed authentication policy.
PolicyValidator.validateAuthenticationPolicy("TestPolicy2", (AuthenticationInfo) policy.getAuthenticationInfo());
// validate the constructed authorization policy.
PolicyValidator.validateAuthorizationPolicy("TestPolicy2", policy.getAuthorizationInfo());
// validate the constructed acl policy.
PolicyValidator.validateACLPolicy("TestPolicy2", policy.getAclInfo());
// validate the constructed role-mapping policy, whose configuration comes exclusively from the parent policy.
PolicyValidator.validateRoleMappingPolicy("TestPolicy1", policy.getMappingInfo("role"));
// validate the constructed audit policy.
PolicyValidator.validateAuditPolicy("TestPolicy2", policy.getAuditInfo());
// validate the constructed identity-trust policy.
PolicyValidator.validateIdentityTrustPolicy("TestPolicy2", policy.getIdentityTrustInfo());
// now validate the jaspi authentication extension.
bean = (ApplicationPolicyBean) super.getBean("TestPolicy4");
assertNotNull("ApplicationPolicyBean not found", bean);
assertNotNull("Parent policy name has not been set", bean.getParentPolicy());
assertEquals("Unexpected parent policy name", "TestPolicy3", bean.getParentPolicy());
// validate the real application policy has been created with the expected contents.
policy = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy4");
assertNotNull("Application policy not found", policy);
// validate the constructed jaspi authentication policy.
PolicyValidator.validateJaspiAuthenticationPolicy("TestPolicy4", (JASPIAuthenticationInfo) policy