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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations