Search in sources :

Example 71 with EnterpriseArchive

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

the class EjbDeploymentTestCase method deployEar.

@Deployment(name = "ear", order = 2)
public static Archive<?> deployEar() {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, deploymentName);
    JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "lib.jar");
    ja.addClass(ITestStatelessEjb.class);
    ja.addClass(ITestStatelessEjbAO.class);
    ear.addAsLibraries(ja);
    ear.addAsModule(getRar());
    ear.addAsModule(getWar());
    ear.addAsModule(getEjb());
    //ear.addAsManifestResource(EjbDeploymentTestCase.class.getPackage(), "application.xml", "application.xml");
    ear.addAsManifestResource(new StringAsset("Dependencies: deployment." + rarDeploymentName + "\n"), "MANIFEST.MF");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 72 with EnterpriseArchive

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

the class EJBJarPackagingTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "scopedToEar.ear");
    JavaArchive ejbjar = ShrinkWrap.create(JavaArchive.class, "ejbjar.jar");
    ejbjar.addAsManifestResource(emptyEjbJar(), "ejb-jar.xml");
    ejbjar.addClasses(EmployeeBean.class, EJBJarPackagingTestCase.class);
    // add ejbjar to root of ear
    ear.addAsModule(ejbjar);
    JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "lib.jar");
    lib.addClasses(Employee.class);
    // add entity jar to ear/lib
    ear.addAsLibrary(lib);
    // add persistence.xml to ear/META-INF
    ear.addAsManifestResource(EJBJarPackagingTestCase.class.getPackage(), "persistence.xml", "persistence.xml");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 73 with EnterpriseArchive

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

the class PersistenceUnitPackagingTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "scopedToEar.ear");
    JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "lib.jar");
    lib.addClasses(Employee.class);
    lib.addAsManifestResource(PersistenceUnitPackagingTestCase.class.getPackage(), "persistence.xml", "persistence.xml");
    ear.addAsLibrary(lib);
    JavaArchive override = ShrinkWrap.create(JavaArchive.class, "override.jar");
    override.addClasses(Organisation.class, OrganisationBean.class, LibPersistenceUnitBean.class);
    override.addAsManifestResource(PersistenceUnitPackagingTestCase.class.getPackage(), "persistence.xml", "persistence.xml");
    ear.addAsModule(override);
    JavaArchive noOverride = ShrinkWrap.create(JavaArchive.class, "noOverride.jar");
    noOverride.addClasses(EmployeeBean.class, PersistenceUnitPackagingTestCase.class);
    ear.addAsModule(noOverride);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 74 with EnterpriseArchive

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

the class JpaJarFileTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME);
    JavaArchive ejbModule = ShrinkWrap.create(JavaArchive.class, "my-ejb-module.jar");
    ejbModule.addClasses(JpaJarFileTestCase.class, JpaTestSlsb.class);
    ejbModule.addAsManifestResource(JpaJarFileTestCase.class.getPackage(), "persistence.xml", "persistence.xml");
    ear.addAsModule(ejbModule);
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "jarfile.jar");
    jar.addClass(JarFileEntity.class);
    jar.addClass(MainArchiveEntity.class);
    ear.addAsLibrary(jar);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 75 with EnterpriseArchive

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

the class TxTimeoutTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    JavaArchive persistenceProvider = ShrinkWrap.create(JavaArchive.class, ARCHIVE_NAME + ".jar");
    persistenceProvider.addClasses(TestEntityManagerFactory.class, TestEntityManager.class, TestPersistenceProvider.class);
    // META-INF/services/javax.persistence.spi.PersistenceProvider
    persistenceProvider.addAsResource(new StringAsset("org.jboss.as.test.integration.jpa.mockprovider.txtimeout.TestPersistenceProvider"), "META-INF/services/javax.persistence.spi.PersistenceProvider");
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
    JavaArchive ejbjar = ShrinkWrap.create(JavaArchive.class, "ejbjar.jar");
    ejbjar.addAsManifestResource(emptyEjbJar(), "ejb-jar.xml");
    ejbjar.addClasses(TxTimeoutTestCase.class, SFSB1.class);
    ejbjar.addAsManifestResource(TxTimeoutTestCase.class.getPackage(), "persistence.xml", "persistence.xml");
    // add ejbjar to root of ear
    ear.addAsModule(ejbjar);
    JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "lib.jar");
    lib.addClasses(Employee.class, TxTimeoutTestCase.class);
    ear.addAsLibraries(lib, persistenceProvider);
    ear.addAsManifestResource(new StringAsset("Dependencies: org.jboss.jboss-transaction-spi export \n"), "MANIFEST.MF");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)164 Deployment (org.jboss.arquillian.container.test.api.Deployment)143 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)139 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)85 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)58 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)21 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)15 BeforeClass (org.junit.BeforeClass)10 File (java.io.File)8 ModelNode (org.jboss.dmr.ModelNode)8 OperationBuilder (org.jboss.as.controller.client.OperationBuilder)7 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)6 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)4 ByteArrayAsset (org.jboss.shrinkwrap.api.asset.ByteArrayAsset)4 ApplicationDescriptor (org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor)4 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)4 Properties (java.util.Properties)3 PropertyPermission (java.util.PropertyPermission)3 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)3 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)3