Search in sources :

Example 1 with TestSuiteEnvironment

use of org.jboss.as.test.shared.TestSuiteEnvironment in project eap-additional-testsuite by jboss-set.

the class AuthenticationTestCase method deployment.

/*I469
     * Authentication Scenarios
     *
     * Client -> Bean
     * Client -> Bean -> Bean
     * Client -> Bean (Re-auth) -> Bean
     * Client -> Servlet -> Bean
     * Client -> Servlet (Re-auth) -> Bean
     * Client -> Servlet -> Bean -> Bean
     * Client -> Servlet -> Bean (Re Auth) -> Bean
     */
@Deployment
public static Archive<?> deployment() {
    final Package currentPackage = AuthenticationTestCase.class.getPackage();
    // using JavaArchive doesn't work, because of a bug in Arquillian, it only deploys wars properly
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "ejb3security.war").addPackage(WhoAmIBean.class.getPackage()).addPackage(EntryBean.class.getPackage()).addClass(WhoAmI.class).addClass(Util.class).addClass(Entry.class).addClasses(WhoAmIServlet.class, AuthenticationTestCase.class).addClasses(AbstractSecurityDomainSetup.class, EjbElytronDomainSetup.class, ElytronDomainSetup.class).addClass(TestSuiteEnvironment.class).addAsResource(currentPackage, "users.properties", "users.properties").addAsResource(currentPackage, "roles.properties", "roles.properties").addAsWebInfResource(currentPackage, "web.xml", "web.xml").addAsWebInfResource(currentPackage, "jboss-web.xml", "jboss-web.xml").addAsWebInfResource(currentPackage, "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF").addAsManifestResource(createPermissionsXmlAsset(// login module needs to modify principal to commit logging in
    new AuthPermission("modifyPrincipals"), // AuthenticationTestCase#testAuthenticatedCall calls org.jboss.security.client.JBossSecurityClient#performSimpleLogin
    new RuntimePermission("org.jboss.security.getSecurityContext"), new RuntimePermission("org.jboss.security.SecurityContextFactory.createSecurityContext"), new RuntimePermission("org.jboss.security.SecurityContextFactory.createUtil"), new RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.setSubjectInfo"), new RuntimePermission("org.jboss.security.setSecurityContext"), // AuthenticationTestCase#execute calls ExecutorService#shutdownNow
    new RuntimePermission("modifyThread"), // AuthenticationTestCase#execute calls sun.net.www.http.HttpClient#openServer under the hood
    new SocketPermission(SERVER_HOST_PORT, "connect,resolve"), // TestSuiteEnvironment reads system properties
    new PropertyPermission("management.address", "read"), new PropertyPermission("node0", "read"), new PropertyPermission("jboss.http.port", "read")), "permissions.xml");
    war.addPackage(CommonCriteria.class.getPackage());
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) AuthPermission(javax.security.auth.AuthPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) SocketPermission(java.net.SocketPermission) Util(org.jboss.as.test.shared.integration.ejb.security.Util) WhoAmIBean(org.jboss.additional.testsuite.jdkall.present.elytron.ejb.base.WhoAmIBean) TestSuiteEnvironment(org.jboss.as.test.shared.TestSuiteEnvironment) CommonCriteria(org.jboss.as.test.categories.CommonCriteria) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

SocketPermission (java.net.SocketPermission)1 PropertyPermission (java.util.PropertyPermission)1 AuthPermission (javax.security.auth.AuthPermission)1 WhoAmIBean (org.jboss.additional.testsuite.jdkall.present.elytron.ejb.base.WhoAmIBean)1 Deployment (org.jboss.arquillian.container.test.api.Deployment)1 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)1 TestSuiteEnvironment (org.jboss.as.test.shared.TestSuiteEnvironment)1 Util (org.jboss.as.test.shared.integration.ejb.security.Util)1 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)1 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)1