Search in sources :

Example 21 with Deployment

use of org.jboss.arquillian.container.test.api.Deployment in project quickstarts by jboss-switchyard.

the class JCAInflowBindingTest method createTestArchive.

@Deployment
public static Archive<?> createTestArchive() {
    File artifact = new File(QUICKSTART_JAR);
    if (!artifact.exists()) {
        String error = QUICKSTART_JAR + " not found. Do \"mvn package\" before the test";
        _logger.error(error);
        throw new RuntimeException(error);
    }
    try {
        JBossCliUtil.executeCliScript(CLI_CONFIG_FILE);
        return ShrinkWrap.create(ZipImporter.class, artifact.getName()).importFrom(new ZipFile(artifact)).as(JavaArchive.class);
    } catch (Exception e) {
        e.printStackTrace();
        throw new RuntimeException(e);
    }
}
Also used : ZipFile(java.util.zip.ZipFile) File(java.io.File) ZipFile(java.util.zip.ZipFile) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 22 with Deployment

use of org.jboss.arquillian.container.test.api.Deployment in project deltaspike by apache.

the class EntityManagerFactoryProducerTest method deploy.

@Deployment
public static WebArchive deploy() {
    // set the dummy PersistenceProviderResolver which creates our DummyEntityManagerFactory
    PersistenceProviderResolverHolder.setPersistenceProviderResolver(new TestPersistenceProviderResolver());
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "unitDefinitionTest.jar").addPackage(ArchiveUtils.SHARED_PACKAGE).addPackage(EntityManagerFactoryProducerTest.class.getPackage().getName()).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml").addAsResource(new StringAsset(TestPersistenceProviderResolver.class.getName()), "META-INF/services/javax.persistence.spi.PersistenceProviderResolver");
    return ShrinkWrap.create(WebArchive.class).addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJpaArchive()).addAsLibraries(testJar).addAsWebInfResource(ArchiveUtils.getBeansXml(), "beans.xml");
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 23 with Deployment

use of org.jboss.arquillian.container.test.api.Deployment 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 24 with Deployment

use of org.jboss.arquillian.container.test.api.Deployment 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 25 with Deployment

use of org.jboss.arquillian.container.test.api.Deployment 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)

Aggregations

Deployment (org.jboss.arquillian.container.test.api.Deployment)853 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)523 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)410 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)288 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)139 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)139 Asset (org.jboss.shrinkwrap.api.asset.Asset)45 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)45 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)28 TargetsContainer (org.jboss.arquillian.container.test.api.TargetsContainer)27 PropertyPermission (java.util.PropertyPermission)26 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)23 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)23 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)16 File (java.io.File)15 SocketPermission (java.net.SocketPermission)13 BatchTestHelper (org.javaee7.util.BatchTestHelper)13 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)13 Util (org.jboss.as.test.shared.integration.ejb.security.Util)11 Properties (java.util.Properties)10