Package org.jboss.test.security.microcontainer.metadata.support

Examples of org.jboss.test.security.microcontainer.metadata.support.TestBean


    * @throws Exception if an error occurs while running the tests.
    */
   public void testManagersInjection() throws Exception
   {
      // get the test bean and validate all mock managers have been injected.
      TestBean testBean = (TestBean) super.getBean("TestBean");
      assertNotNull("TestBean could not be found", testBean);

      // check the authentication manager injection.
      AuthenticationManager authenticationManager = testBean.getAuthenticationManager();
      assertNotNull("Invalid null AuthenticationManager found", authenticationManager);
      assertEquals("Invalid AuthenticationManager implementation found", MockAuthenticationManager.class,
            authenticationManager.getClass());
      assertEquals("TestPolicy1", authenticationManager.getSecurityDomain());

      // check the authorization manager injection.
      AuthorizationManager authorizationManager = testBean.getAuthorizationManager();
      assertNotNull("Invalid null AuthorizationManager found", authorizationManager);
      assertEquals("Invalid AuthorizationManager implementation found", MockAuthorizationManager.class,
            authorizationManager.getClass());
      assertEquals("TestPolicy1", authorizationManager.getSecurityDomain());

      // check the mapping manager injection.
      MappingManager mappingManager = testBean.getMappingManager();
      assertNotNull("Invalid null MappingManager found", mappingManager);
      assertEquals("Invalid MappingManager implementation found", MockMappingManager.class, mappingManager.getClass());
      assertEquals("TestPolicy1", mappingManager.getSecurityDomain());

      // check the audit manager injection.
      AuditManager auditManager = testBean.getAuditManager();
      assertNotNull("Invalid null AuditManager found", auditManager);
      assertEquals("Invalid AuditManager implementation found", MockAuditManager.class, auditManager.getClass());
      assertEquals("TestPolicy1", auditManager.getSecurityDomain());

      // check the identity-trust injection.
      IdentityTrustManager trustManager = testBean.getIdentityTrustManager();
      assertNotNull("Invalid null IdentityTrustManager found", trustManager);
      assertEquals("Invalid IdentityTrustManager implementation found", MockIdentityTrustManager.class, trustManager
            .getClass());
      assertEquals("TestPolicy1", trustManager.getSecurityDomain());

View Full Code Here

TOP

Related Classes of org.jboss.test.security.microcontainer.metadata.support.TestBean

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.