Search in sources :

Example 71 with WebArchive

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

the class InitializeInOrderTestCase method deployment.

@Deployment
public static Archive<?> deployment() {
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "init.ear");
    ear.addAsResource(InitializeInOrderTestCase.class.getPackage(), "application.xml", "application.xml");
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "ejb.jar");
    jar.addClasses(MyEjb.class, InitializeInOrderTestCase.class);
    ear.addAsModule(jar);
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "web.war");
    war.addClass(MyServlet.class);
    ear.addAsModule(war);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 72 with WebArchive

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

the class SubDirectoryModuleDeploymentTestCase method createDeployment.

@Deployment
public static Archive<?> createDeployment() {
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "subdirectory.ear");
    final JavaArchive jarOne = ShrinkWrap.create(JavaArchive.class, "ejb.jar");
    jarOne.addClass(MessageBean.class);
    ear.addAsModule(new ArchiveAsset(jarOne, ZipExporter.class), "subdir/ejb/ejb.jar");
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "web.war");
    war.addClass(MessageServlet.class);
    ear.addAsModule(new ArchiveAsset(war, ZipExporter.class), "subdir/web/web.war");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ArchiveAsset(org.jboss.shrinkwrap.api.asset.ArchiveAsset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 73 with WebArchive

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

the class InfinispanResourceRefTestCase method deployment.

@Deployment
public static Archive<?> deployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "infinispan-resource-ref.war");
    war.addClasses(InfinispanBean.class, InfinispanResourceRefTestCase.class);
    war.addAsWebInfResource(getWebXml(), "web.xml");
    war.setManifest(new StringAsset(Descriptors.create(ManifestDescriptor.class).attribute("Dependencies", "org.infinispan export").exportAsString()));
    war.addAsManifestResource(createPermissionsXmlAsset(new MBeanPermission("-#-[-]", "queryNames"), new MBeanPermission("org.infinispan.*[jboss.infinispan:*,type=Cache]", "registerMBean"), new ReflectPermission("suppressAccessChecks"), new RuntimePermission("accessDeclaredMembers"), new RuntimePermission("getClassLoader")), "permissions.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) MBeanPermission(javax.management.MBeanPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ReflectPermission(java.lang.reflect.ReflectPermission) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 74 with WebArchive

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

the class PersistenceContextRefTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME + ".war");
    war.addPackage(PersistenceContextRefTestCase.class.getPackage());
    war.addAsResource(new StringAsset(persistence_xml), "META-INF/persistence.xml");
    war.addAsWebInfResource(getWebXml(), "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 75 with WebArchive

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

the class ProducerInjectionTestCase method getSimpleEar.

@Deployment(name = SIMPLE_EAR, testable = false)
public static Archive<?> getSimpleEar() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, SIMPLE_WAR);
    war.addClasses(SimpleBeanServlet.class);
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, SIMPLE_CDI_JAR);
    jar.addClasses(SimpleManagedBean.class, SimpleProducerBean.class);
    jar.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, SIMPLE_EAR);
    ear.addAsModule(war);
    ear.addAsModule(jar);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) 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