Search in sources :

Example 56 with WebArchive

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

the class AnnotatedDeployTestCase method createDeployment.

@Deployment
public static EnterpriseArchive createDeployment() {
    final WebArchive war = createWAR(SampleBeanWebService.class, "ws-annotated-XXX.war");
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "ws-annotated-XXX.ear");
    ear.addAsManifestResource(AnnotatedDeployTestCase.class.getPackage(), "application.xml", "application.xml");
    ear.addAsModule(war);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 57 with WebArchive

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

the class NotAnnotatedDeployTestCase method createDeployment.

@Deployment
public static EnterpriseArchive createDeployment() {
    final WebArchive war = createWAR(SampleBean.class, "ws-notannotated-XXX.war");
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "ws-notannotated-XXX.ear");
    ear.addAsManifestResource(NotAnnotatedDeployTestCase.class.getPackage(), "application-notannotated.xml", "application.xml");
    ear.addAsModule(war);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 58 with WebArchive

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

the class BothPojoAndEjbInWarTestCase method createDeployment.

@Deployment
public static WebArchive createDeployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "as1605-usecase1.war");
    war.addClass(EndpointIface.class);
    war.addClass(POJOEndpoint.class);
    war.addClass(EJB3Endpoint.class);
    war.addAsWebInfResource(new StringAsset("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<web-app version=\"3.0\"\n" + "         xmlns=\"http://java.sun.com/xml/ns/javaee\"\n" + "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + "         xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\"\n" + "         metadata-complete=\"false\">\n" + "  <servlet>\n" + "    <servlet-name>POJOService</servlet-name>\n" + "    <servlet-class>org.jboss.as.test.integration.ws.context.as1605.POJOEndpoint</servlet-class>\n" + "  </servlet>\n" + "  <servlet-mapping>\n" + "    <servlet-name>POJOService</servlet-name>\n" + "    <url-pattern>/POJOEndpoint</url-pattern>\n" + "  </servlet-mapping>\n" + "</web-app>\n"), "web.xml");
    war.addAsWebInfResource(new StringAsset("<?xml version='1.0' encoding='UTF-8'?>\n" + "<!DOCTYPE jboss-web PUBLIC \"-//JBoss//DTD Web Application 2.4//EN\" \"http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd\">\n" + "<jboss-web>\n" + "<context-root>/as1605-customized</context-root>\n" + "</jboss-web>\n"), "jboss-web.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 59 with WebArchive

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

the class DeploymentHelper method getWebArchiveWithPermissions.

public WebArchive getWebArchiveWithPermissions(final String archiveName) {
    final String javaHome = TestSuiteEnvironment.getSystemProperty("java.home");
    final String serverHostPort = TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getHttpPort();
    final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")).addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(new ReflectPermission("suppressAccessChecks"), new ReflectPermission("accessDeclaredMembers"), // Permissions for port access
    new PropertyPermission("management.address", "read"), new PropertyPermission("node0", "read"), new PropertyPermission("jboss.http.port", "read"), new SocketPermission(serverHostPort, "connect,resolve"), // Permissions for the new client creation
    new RuntimePermission("accessDeclaredMembers"), new RuntimePermission("createClassLoader"), new RuntimePermission("getClassLoader"), new RuntimePermission("org.apache.cxf.permission"), new FilePermission(javaHome + File.separator + "lib" + File.separator + "wsdl.properties", "read"), new PropertyPermission("user.dir", "read"), new PropertyPermission("arquillian.debug", "read"), new FilePermission(System.getProperty("basedir") + File.separator + "target" + File.separator + "workdir" + File.separator + "xcatalog", "read")), "permissions.xml");
    return webArchive;
}
Also used : PropertyPermission(java.util.PropertyPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) SocketPermission(java.net.SocketPermission) ReflectPermission(java.lang.reflect.ReflectPermission) FilePermission(java.io.FilePermission)

Example 60 with WebArchive

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

the class WSTrustTestCase method createBearerSTSDeployment.

@Deployment(name = BEARER_STS_DEP, testable = false)
public static WebArchive createBearerSTSDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class, BEARER_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.stsbearer.STSBearerCallbackHandler.class).addClass(org.jboss.as.test.integration.ws.wsse.trust.stsbearer.SampleSTSBearer.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/bearer-ws-trust-1.4-service.wsdl"), "wsdl/bearer-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(), "META-INF/permissions.xml", "permissions.xml").setWebXML(WSTrustTestCase.class.getPackage(), "WEB-INF/bearer/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)

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