Search in sources :

Example 61 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project wildfly by wildfly.

the class WSTrustTestCase method createServerDeployment.

@Deployment(name = SERVER_DEP, testable = false)
public static WebArchive createServerDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class, SERVER_DEP + ".war");
    archive.setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n")).addClass(org.jboss.as.test.integration.ws.wsse.trust.SayHello.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.SayHelloResponse.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.service.ServerCallbackHandler.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.service.ServiceIface.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.service.ServiceImpl.class).addAsWebInfResource(createFilteredAsset("WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl").addAsWebInfResource(createFilteredAsset("WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd").addAsWebInfResource(WSTrustTestCase.class.getPackage(), "WEB-INF/servicestore.jks", "classes/servicestore.jks").addAsWebInfResource(WSTrustTestCase.class.getPackage(), "WEB-INF/serviceKeystore.properties", "classes/serviceKeystore.properties").addAsManifestResource(WSTrustTestCase.class.getPackage(), "WEB-INF/permissions.xml", "permissions.xml");
    return archive;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 62 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project wildfly by wildfly.

the class WSTrustTestCase method createHolderOfKeySTSDeployment.

@Deployment(name = HOLDER_OF_KEY_STS_DEP, testable = false)
public static WebArchive createHolderOfKeySTSDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class, HOLDER_OF_KEY_STS_DEP + ".war");
    archive.setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.jboss.ws.cxf.sts annotations\n")).addClass(org.jboss.as.test.integration.ws.wsse.trust.stsholderofkey.STSHolderOfKeyCallbackHandler.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.stsholderofkey.SampleSTSHolderOfKey.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.shared.WSTrustAppUtils.class).addAsWebInfResource(WSTrustTestCase.class.getPackage(), "WEB-INF/jboss-web.xml", "jboss-web.xml").addAsWebInfResource(createFilteredAsset("WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl"), "wsdl/holderofkey-ws-trust-1.4-service.wsdl").addAsWebInfResource(WSTrustTestCase.class.getPackage(), "WEB-INF/stsstore.jks", "classes/stsstore.jks").addAsWebInfResource(WSTrustTestCase.class.getPackage(), "WEB-INF/stsKeystore.properties", "classes/stsKeystore.properties").addAsManifestResource(WSTrustTestCase.class.getPackage(), "WEB-INF/permissions.xml", "permissions.xml").setWebXML(WSTrustTestCase.class.getPackage(), "WEB-INF/holderofkey/web.xml");
    return archive;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 63 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project wildfly by wildfly.

the class WSTrustTestCase method createOnBehalfOfServerDeployment.

@Deployment(name = ON_BEHALF_OF_SERVER_DEP, testable = false)
public static WebArchive createOnBehalfOfServerDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class, ON_BEHALF_OF_SERVER_DEP + ".war");
    archive.setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client, org.jboss.ws.cxf.sts\n")).addClass(org.jboss.as.test.integration.ws.wsse.trust.SayHello.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.SayHelloResponse.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.onbehalfof.OnBehalfOfCallbackHandler.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.onbehalfof.OnBehalfOfServiceIface.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.onbehalfof.OnBehalfOfServiceImpl.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.service.ServiceIface.class).addAsWebInfResource(createFilteredAsset("WEB-INF/wsdl/OnBehalfOfService.wsdl"), "wsdl/OnBehalfOfService.wsdl").addAsWebInfResource(createFilteredAsset("WEB-INF/wsdl/OnBehalfOfService_schema1.xsd"), "wsdl/OnBehalfOfService_schema1.xsd").addAsWebInfResource(WSTrustTestCase.class.getPackage(), "WEB-INF/actasstore.jks", "classes/actasstore.jks").addAsWebInfResource(WSTrustTestCase.class.getPackage(), "WEB-INF/actasKeystore.properties", "classes/actasKeystore.properties").addAsManifestResource(WSTrustTestCase.class.getPackage(), "META-INF/clientstore.jks", "clientstore.jks").addAsManifestResource(WSTrustTestCase.class.getPackage(), "META-INF/clientKeystore.properties", "clientKeystore.properties").addAsManifestResource(WSTrustTestCase.class.getPackage(), "META-INF/permissions.xml", "permissions.xml");
    return archive;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) OnBehalfOfServiceIface(org.jboss.as.test.integration.ws.wsse.trust.onbehalfof.OnBehalfOfServiceIface) ActAsServiceIface(org.jboss.as.test.integration.ws.wsse.trust.actas.ActAsServiceIface) ServiceIface(org.jboss.as.test.integration.ws.wsse.trust.service.ServiceIface) OnBehalfOfServiceIface(org.jboss.as.test.integration.ws.wsse.trust.onbehalfof.OnBehalfOfServiceIface) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 64 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project wildfly by wildfly.

the class MixedDomainDeploymentTest method setupDomain.

@Before
public void setupDomain() throws Exception {
    // Create our deployments
    webArchive = ShrinkWrap.create(WebArchive.class, TEST);
    ClassLoader tccl = Thread.currentThread().getContextClassLoader();
    URL index = tccl.getResource("helloWorld/index.html");
    webArchive.addAsWebResource(index, "index.html");
    webArchive2 = ShrinkWrap.create(WebArchive.class, TEST);
    index = tccl.getResource("helloWorld/index.html");
    webArchive2.addAsWebResource(index, "index.html");
    index = tccl.getResource("helloWorld/index2.html");
    webArchive2.addAsWebResource(index, "index2.html");
    // Make versions on the filesystem for URL-based deploy and for unmanaged content testing
    tmpDir = new File("target/deployments/" + this.getClass().getSimpleName());
    new File(tmpDir, "archives").mkdirs();
    new File(tmpDir, "exploded").mkdirs();
    webArchive.as(ZipExporter.class).exportTo(new File(tmpDir, "archives/" + TEST), true);
    webArchive.as(ExplodedExporter.class).exportExploded(new File(tmpDir, "exploded"));
    //Make the jsf war to test that jsf works on the older slaves that did not have the jsf subsystem
    jsfTestArchive = ShrinkWrap.create(WebArchive.class, "jsf-test.war");
    jsfTestArchive.addClass(Bean.class);
    jsfTestArchive.addAsWebResource("jsf-test/index.html");
    jsfTestArchive.addAsWebResource("jsf-test/home.xhtml");
    jsfTestArchive.addAsWebInfResource("jsf-test/WEB-INF/beans.xml");
    jsfTestArchive.addAsWebInfResource("jsf-test/WEB-INF/faces-config.xml");
    // Launch the domain
    testSupport = MixedDomainTestSuite.getSupport(this.getClass());
    confirmNoDeployments();
}
Also used : ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ExplodedExporter(org.jboss.shrinkwrap.api.exporter.ExplodedExporter) File(java.io.File) URL(java.net.URL) Before(org.junit.Before)

Example 65 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project wildfly by wildfly.

the class AuthenticationTestCase method deployment.

/*
     * 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).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.wildfly.test.integration.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

WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)519 Deployment (org.jboss.arquillian.container.test.api.Deployment)421 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)170 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)110 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)89 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)80 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)28 File (java.io.File)25 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)25 BatchTestHelper (org.javaee7.util.BatchTestHelper)13 PropertyPermission (java.util.PropertyPermission)11 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)11 SocketPermission (java.net.SocketPermission)10 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)10 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)9 BeforeClass (org.junit.BeforeClass)9 Test (org.junit.Test)9 ClassLoaderAsset (org.jboss.shrinkwrap.api.asset.ClassLoaderAsset)8 Runner (org.apache.openejb.arquillian.tests.Runner)7 Util (org.jboss.as.test.shared.integration.ejb.security.Util)7