Search in sources :

Example 51 with WebArchive

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

the class SchemaLocationsRewriteTestCase method createDeployment.

@Deployment
public static WebArchive createDeployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "schema-location-rewrite.war");
    war.addPackage(SimpleService.class.getPackage()).addAsWebInfResource(SchemaLocationsRewriteTestCase.class.getPackage(), "SimpleService.wsdl", "wsdl/SimpleService.wsdl").addAsWebInfResource(SchemaLocationsRewriteTestCase.class.getPackage(), "imported/AnotherService.wsdl", "wsdl/imported/AnotherService.wsdl").addAsWebInfResource(SchemaLocationsRewriteTestCase.class.getPackage(), "imported/SimpleService.xsd", "wsdl/imported/SimpleService.xsd").addAsWebInfResource(SchemaLocationsRewriteTestCase.class.getPackage(), "imported/importedschema.xsd", "wsdl/imported/importedschema.xsd");
    war.addClass(SimpleService.class);
    return war;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 52 with WebArchive

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

the class SimpleWebserviceEndpointTestCase method createDeployment.

@Deployment
public static WebArchive createDeployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "ws-endpoint-example.war");
    war.addPackage(SimpleWebserviceEndpointImpl.class.getPackage());
    war.addClass(SimpleWebserviceEndpointImpl.class);
    war.addAsWebInfResource(SimpleWebserviceEndpointTestCase.class.getPackage(), "web.xml", "web.xml");
    return war;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 53 with WebArchive

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

the class Usecase2TestCase method createDeployment.

@Deployment
public static WebArchive createDeployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "anonymous-pojo-usecase2.war");
    war.addPackage(AnonymousPOJO.class.getPackage());
    war.addClass(AnonymousPOJO.class);
    return war;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 54 with WebArchive

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

the class ServiceRefSevletTestCase method clientDeployment.

@Deployment(name = "servletClient", testable = false)
public static WebArchive clientDeployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "ws-serviceref-example-servlet-client.war").addClasses(EndpointInterface.class, EndpointService.class, ServletClient.class).addAsWebInfResource(ServiceRefSevletTestCase.class.getPackage(), "web.xml", "web.xml").addAsWebInfResource(ServiceRefSevletTestCase.class.getPackage(), "jboss-web.xml", "jboss-web.xml");
    String wsdl = FileUtils.readFile(ServiceRefSevletTestCase.class, "TestService.wsdl");
    final Properties properties = new Properties();
    properties.putAll(System.getProperties());
    final String node0 = NetworkUtils.formatPossibleIpv6Address((String) properties.get("node0"));
    if (properties.containsKey("node0")) {
        properties.put("node0", node0);
    }
    war.addAsWebInfResource(new StringAsset(PropertiesValueResolver.replaceProperties(wsdl, properties)), "wsdl/TestService.wsdl");
    // all the following permissions are needed because EndpointService directly extends javax.xml.ws.Service class
    // and CXF guys are not willing to add more privileged blocks into their code, thus deployments need to have
    // the following permissions (note that the wsdl.properties permission is needed by wsdl4j)
    war.addAsManifestResource(createPermissionsXmlAsset(new FilePermission(System.getProperty("java.home") + File.separator + "lib" + File.separator + "wsdl.properties", "read"), new PropertyPermission("user.dir", "read"), new RuntimePermission("getClassLoader"), new RuntimePermission("org.apache.cxf.permission", "resolveUri"), new RuntimePermission("createClassLoader"), new RuntimePermission("accessDeclaredMembers"), new SocketPermission(node0 + ":8080", "connect,resolve")), "jboss-permissions.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) SocketPermission(java.net.SocketPermission) Properties(java.util.Properties) FilePermission(java.io.FilePermission) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 55 with WebArchive

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

the class CdiJsfWebServicesTestCase method archive.

@Deployment
public static Archive<?> archive() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME + ".war");
    war.addPackage(CdiJsfWebServicesTestCase.class.getPackage());
    war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    war.add(new StringAsset("<html><body>#{myBean.message}</body></html>"), "index.xhtml");
    war.addAsWebInfResource(new StringAsset(FACES_CONFIG), "faces-config.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)

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