Search in sources :

Example 21 with WebArchive

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

the class TestDeployments method initDeployment.

/**
     * Create a basic deployment with dependencies, beans.xml and persistence descriptor.
     *
     * @return Basic web archive.
     */
public static WebArchive initDeployment() {
    Logging.reconfigure();
    WebArchive archive = ShrinkWrap.create(WebArchive.class, "test.war").addAsLibraries(getDeltaSpikeDataWithDependencies()).addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    return archive;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive)

Example 22 with WebArchive

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

the class MethodLevelInterceptorTest method war.

@Deployment
public static WebArchive war() {
    Asset beansXml = new StringAsset("<beans><interceptors><class>" + CustomInterceptorImpl.class.getName() + "</class></interceptors></beans>");
    String simpleName = MethodLevelInterceptorTest.class.getSimpleName();
    String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
    //don't create a completely empty web-archive
    if (CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0)) {
        return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive());
    }
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(MethodLevelInterceptorTest.class.getPackage()).addPackage(TestPartialBeanBinding.class.getPackage()).addAsManifestResource(beansXml, "beans.xml");
    return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()).addAsLibraries(testJar).addAsWebInfResource(beansXml, "beans.xml");
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) CustomInterceptorImpl(org.apache.deltaspike.test.core.api.partialbean.shared.CustomInterceptorImpl) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 23 with WebArchive

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

the class ClassLevelInterceptorTest method war.

@Deployment
public static WebArchive war() {
    Asset beansXml = new StringAsset("<beans><interceptors><class>" + CustomInterceptorImpl.class.getName() + "</class></interceptors></beans>");
    String simpleName = ClassLevelInterceptorTest.class.getSimpleName();
    String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
    //don't create a completely empty web-archive
    if (CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0)) {
        return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive());
    }
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(ClassLevelInterceptorTest.class.getPackage()).addPackage(TestPartialBeanBinding.class.getPackage()).addAsManifestResource(beansXml, "beans.xml");
    return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()).addAsLibraries(testJar).addAsWebInfResource(beansXml, "beans.xml");
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) CustomInterceptorImpl(org.apache.deltaspike.test.core.api.partialbean.shared.CustomInterceptorImpl) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 24 with WebArchive

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

the class PartialBeanWithProducerWarFileTest method deploy.

@Deployment
public static WebArchive deploy() {
    String simpleName = PartialBeanWithProducerWarFileTest.class.getSimpleName();
    String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(PartialBeanWithProducerWarFileTest.class.getPackage()).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()).addAsLibraries(testJar).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 25 with WebArchive

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

the class PartialBeanAsAbstractClassTest method war.

@Deployment
public static WebArchive war() {
    String simpleName = PartialBeanAsAbstractClassTest.class.getSimpleName();
    String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(PartialBeanAsAbstractClassTest.class.getPackage()).addPackage(TestPartialBeanBinding.class.getPackage()).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    WebArchive webArchive = ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()).addAsLibraries(testJar).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    return webArchive;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)505 Deployment (org.jboss.arquillian.container.test.api.Deployment)409 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)159 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)104 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)83 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)80 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)28 File (java.io.File)22 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)14 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 Util (org.jboss.as.test.shared.integration.ejb.security.Util)7 URL (java.net.URL)6 FilePermission (java.io.FilePermission)5 BeansDescriptor (org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor)5