Package org.jboss.security.microcontainer.beans

Examples of org.jboss.security.microcontainer.beans.ApplicationPolicyBean


   public void testApplicationPoliciesCreation() throws Exception
   {
      super.testApplicationPoliciesCreation();

      // validate the mapping policy beans have been properly created.
      ApplicationPolicyBean policyBean1 = (ApplicationPolicyBean) super.getBean("TestPolicy1");
      assertNotNull("Unexpected null mapping policy found", policyBean1.getMappingPolicy());

      ApplicationPolicyBean policyBean2 = (ApplicationPolicyBean) super.getBean("TestPolicy2");
      assertNotNull("Unexpected null mapping policy found", policyBean2.getMappingPolicy());

      MappingPolicyBean mappingBean = (MappingPolicyBean) super.getBean("TestPolicy1$MappingPolicy");
      // assert the bean retrieved from the microcontainer is the same that has been injected into the app policy.
      assertEquals(policyBean1.getMappingPolicy(), mappingBean);
      BeanValidator.validateMappingBean(mappingBean);

      mappingBean = (MappingPolicyBean) super.getBean("TestPolicy2$MappingPolicy");
      assertEquals(policyBean2.getMappingPolicy(), mappingBean);
      BeanValidator.validateMappingBean(mappingBean);

      // verify the contents of the mapping policies.
      ApplicationPolicy policy = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy1");
      PolicyValidator.validateMappingPolicy("TestPolicy1", policy.getMappingInfo("role"), "role");
View Full Code Here


   public void testApplicationPoliciesCreation() throws Exception
   {
      super.testApplicationPoliciesCreation();

      // validate the authorization-policy beans have been properly created.
      ApplicationPolicyBean policyBean1 = (ApplicationPolicyBean) super.getBean("TestPolicy1");
      assertNotNull("Unexpected null authorization policy found", policyBean1.getAuthorizationPolicy());

      ApplicationPolicyBean policyBean2 = (ApplicationPolicyBean) super.getBean("TestPolicy2");
      assertNotNull("Unexpected null authorization policy found", policyBean2.getAuthorizationPolicy());

      AuthorizationPolicyBean authzBean = (AuthorizationPolicyBean) super.getBean("TestPolicy1$AuthorizationPolicy");
      // assert the bean retrieved from the microcontainer is the same that has been injected into the app policy.
      assertEquals(policyBean1.getAuthorizationPolicy(), authzBean);
      BeanValidator.validateAuthorizationBean(authzBean);

      authzBean = (AuthorizationPolicyBean) super.getBean("TestPolicy2$AuthorizationPolicy");
      assertEquals(policyBean2.getAuthorizationPolicy(), authzBean);
      BeanValidator.validateAuthorizationBean(authzBean);

      // verify the contents of the authorization policies.
      ApplicationPolicy policy = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy1");
      PolicyValidator.validateAuthorizationPolicy("TestPolicy1", policy.getAuthorizationInfo());
View Full Code Here

   public void testApplicationPoliciesCreation() throws Exception
   {
      super.testApplicationPoliciesCreation();

      // validate the identity-trust policy beans have been properly created.
      ApplicationPolicyBean policyBean1 = (ApplicationPolicyBean) super.getBean("TestPolicy1");
      assertNotNull("Unexpected null identity-trust policy found", policyBean1.getIdentityTrustPolicy());

      ApplicationPolicyBean policyBean2 = (ApplicationPolicyBean) super.getBean("TestPolicy2");
      assertNotNull("Unexpected null identity-trust policy found", policyBean2.getIdentityTrustPolicy());

      IdentityTrustPolicyBean trustBean = (IdentityTrustPolicyBean) super.getBean("TestPolicy1$IdentityTrustPolicy");
      // assert the bean retrieved from the microcontainer is the same that has been injected into the app policy.
      assertEquals(policyBean1.getIdentityTrustPolicy(), trustBean);
      BeanValidator.validateIdentityTrustBean(trustBean);

      trustBean = (IdentityTrustPolicyBean) super.getBean("TestPolicy2$IdentityTrustPolicy");
      assertEquals(policyBean2.getIdentityTrustPolicy(), trustBean);
      BeanValidator.validateIdentityTrustBean(trustBean);

      // verify the contents of the identity-trust policies.
      ApplicationPolicy policy = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy1");
      PolicyValidator.validateIdentityTrustPolicy("TestPolicy1", policy.getIdentityTrustInfo());
View Full Code Here

    * @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
View Full Code Here

    * @throws Exception if an error occurs while running the test.
    */
   public void testApplicationPoliciesCreation() throws Exception
   {
      // validate the application policy beans have been properly created by the metadata factory.
      ApplicationPolicyBean policyBean1 = (ApplicationPolicyBean) super.getBean("TestPolicy1");
      assertNotNull("ApplicationPolicyBean TestPolicy1 not found", policyBean1);
      assertNotNull("Unexpected null authentication policy found", policyBean1.getAuthenticationPolicy());

      ApplicationPolicyBean policyBean2 = (ApplicationPolicyBean) super.getBean("TestPolicy2");
      assertNotNull("ApplicationPolicyBean TestPolicy2 not found", policyBean2);
      assertNotNull("Unexpected null jaspi authentication policy found", policyBean2.getAuthenticationPolicy());

      AuthenticationPolicyBean authBean = (AuthenticationPolicyBean) super.getBean("TestPolicy1$AuthenticationPolicy");
      // assert the bean retrieved from the microcontainer is the same that has been injected into the app policy.
      assertEquals(policyBean1.getAuthenticationPolicy(), authBean);
      BeanValidator.validateAuthenticationBean(authBean);

      JASPIAuthenticationPolicyBean jaspiAuthBean = (JASPIAuthenticationPolicyBean) super
            .getBean("TestPolicy2$JASPIAuthenticationPolicy");
      assertEquals(policyBean2.getAuthenticationPolicy(), jaspiAuthBean);
      BeanValidator.validateJaspiAuthenticationBean(jaspiAuthBean);

      // verify that the application policies have been created in the security layer and validate their contents.
      ApplicationPolicy policy1 = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy1");
      assertNotNull("Application policy TestPolicy1 not found", policy1);
View Full Code Here

   public void testApplicationPoliciesCreation() throws Exception
   {
      super.testApplicationPoliciesCreation();

      // validate the audit policy beans have been properly created.
      ApplicationPolicyBean policyBean1 = (ApplicationPolicyBean) super.getBean("TestPolicy1");
      assertNotNull("Unexpected null audit policy found", policyBean1.getAuditPolicy());

      ApplicationPolicyBean policyBean2 = (ApplicationPolicyBean) super.getBean("TestPolicy2");
      assertNotNull("Unexpected null audit policy found", policyBean2.getAuditPolicy());

      AuditPolicyBean auditBean = (AuditPolicyBean) super.getBean("TestPolicy1$AuditPolicy");
      // assert the bean retrieved from the microcontainer is the same that has been injected into the app policy.
      assertEquals(policyBean1.getAuditPolicy(), auditBean);
      BeanValidator.validateAuditBean(auditBean);

      auditBean = (AuditPolicyBean) super.getBean("TestPolicy2$AuditPolicy");
      assertEquals(policyBean2.getAuditPolicy(), auditBean);
      BeanValidator.validateAuditBean(auditBean);

      // verify the contents of the audit policies.
      ApplicationPolicy policy = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy1");
      PolicyValidator.validateAuditPolicy("TestPolicy1", policy.getAuditInfo());
View Full Code Here

      // check the regular beans have been instantiated.
      AuthenticationPolicyBean authBean = (AuthenticationPolicyBean) super.getBean("RegularBean$AuthenticationPolicy");
      assertNotNull("Authentication policy bean not found", authBean);

      ApplicationPolicyBean appPolicyBean = (ApplicationPolicyBean) super.getBean("RegularBean");
      assertNotNull("Application policy bean not found", appPolicyBean);
      assertEquals("Incorrect policy name", "RegularBean", appPolicyBean.getName());
      assertEquals("Unexpected authentication policy bean found", authBean, appPolicyBean.getAuthenticationPolicy());
   }
View Full Code Here

   public void testApplicationPoliciesCreation() throws Exception
   {
      super.testApplicationPoliciesCreation();

      // validate the acl-policy beans have been properly created.
      ApplicationPolicyBean policyBean1 = (ApplicationPolicyBean) super.getBean("TestPolicy1");
      assertNotNull("Unexpected null acl policy found", policyBean1.getAclPolicy());

      ApplicationPolicyBean policyBean2 = (ApplicationPolicyBean) super.getBean("TestPolicy2");
      assertNotNull("Unexpected null acl policy found", policyBean2.getAclPolicy());

      ACLPolicyBean aclBean = (ACLPolicyBean) super.getBean("TestPolicy1$ACLPolicy");
      // assert the bean retrieved from the microcontainer is the same that has been injected into the app policy.
      assertEquals(policyBean1.getAclPolicy(), aclBean);
      BeanValidator.validateACLBean(aclBean);

      aclBean = (ACLPolicyBean) super.getBean("TestPolicy2$ACLPolicy");
      assertEquals(policyBean2.getAclPolicy(), aclBean);
      BeanValidator.validateACLBean(aclBean);

      // verify the contents of the acl policies.
      ApplicationPolicy policy = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy1");
      PolicyValidator.validateACLPolicy("TestPolicy1", policy.getAclInfo());
View Full Code Here

   public void testApplicationPoliciesCreation() throws Exception
   {
      super.testApplicationPoliciesCreation();

      // validate the role-mapping policy beans have been properly created.
      ApplicationPolicyBean policyBean1 = (ApplicationPolicyBean) super.getBean("TestPolicy1");
      assertNotNull("Unexpected null role-mapping policy found", policyBean1.getRoleMappingPolicy());

      ApplicationPolicyBean policyBean2 = (ApplicationPolicyBean) super.getBean("TestPolicy2");
      assertNotNull("Unexpected null role-mapping policy found", policyBean2.getRoleMappingPolicy());

      MappingPolicyBean mappingBean = (MappingPolicyBean) super.getBean("TestPolicy1$RoleMappingPolicy");
      // assert the bean retrieved from the microcontainer is the same that has been injected into the app policy.
      assertEquals(policyBean1.getRoleMappingPolicy(), mappingBean);
      BeanValidator.validateRoleMappingBean(mappingBean);

      mappingBean = (MappingPolicyBean) super.getBean("TestPolicy2$RoleMappingPolicy");
      assertEquals(policyBean2.getRoleMappingPolicy(), mappingBean);
      BeanValidator.validateRoleMappingBean(mappingBean);

      // verify the contents of the role-mapping policies.
      ApplicationPolicy policy = XMLLoginConfigImpl.getInstance().getApplicationPolicy("TestPolicy1");
      PolicyValidator.validateRoleMappingPolicy("TestPolicy1", policy.getMappingInfo("role"));
View Full Code Here

TOP

Related Classes of org.jboss.security.microcontainer.beans.ApplicationPolicyBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.