use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project wildfly by wildfly.
the class Hibernate4NativeAPINaturalIdTestCase method deploy.
@Deployment
public static Archive<?> deploy() throws Exception {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
// add required jars as manifest dependencies
ear.addAsManifestResource(new StringAsset("Dependencies: org.hibernate \n"), "MANIFEST.MF");
JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "beans.jar");
lib.addClasses(SFSBHibernateSFNaturalId.class);
ear.addAsModule(lib);
lib = ShrinkWrap.create(JavaArchive.class, "entities.jar");
lib.addClasses(Person.class);
lib.addAsResource(new StringAsset(testmapping), "testmapping.hbm.xml");
lib.addAsResource(new StringAsset(hibernate_cfg), "hibernate.cfg.xml");
ear.addAsLibraries(lib);
final WebArchive main = ShrinkWrap.create(WebArchive.class, "main.war");
main.addClasses(Hibernate4NativeAPINaturalIdTestCase.class);
ear.addAsModule(main);
// add application dependency on H2 JDBC driver, so that the Hibernate classloader (same as app classloader)
// will see the H2 JDBC driver.
// equivalent hack for use of shared Hiberante module, would be to add the H2 dependency directly to the
// shared Hibernate module.
// also add dependency on org.slf4j
ear.addAsManifestResource(new StringAsset("<jboss-deployment-structure>" + " <deployment>" + " <dependencies>" + " <module name=\"com.h2database.h2\" />" + " <module name=\"org.slf4j\"/>" + " </dependencies>" + " </deployment>" + "</jboss-deployment-structure>"), "jboss-deployment-structure.xml");
return ear;
}
use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project wildfly by wildfly.
the class DsWithSecurityDomainTestCase method deployment.
@Deployment
public static Archive<?> deployment() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "single.jar").addClasses(DsWithSecurityDomainTestCase.class);
jar.addClasses(AbstractLoginModuleSecurityDomainTestCaseSetup.class, AbstractSecurityDomainSetup.class);
final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear").addAsLibrary(jar).addAsManifestResource(DsWithSecurityDomainTestCase.class.getPackage(), "security-ds.xml", "security-ds.xml");
return ear;
}
use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project wildfly by wildfly.
the class JAASIdentityCachingTestCase method earDeployment.
// Public methods --------------------------------------------------------
/**
* Creates {@link EnterpriseArchive} deployment.
*/
@Deployment
public static EnterpriseArchive earDeployment() {
final JavaArchive libJar = ShrinkWrap.create(JavaArchive.class, LM_LIB_NAME).addClasses(CustomLoginModule.class, CustomPrincipal.class);
final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, JAR_BASE_NAME + ".jar").addClasses(Hello.class, HelloBean.class).addAsManifestResource(Utils.getJBossEjb3XmlAsset(TEST_NAME), "jboss-ejb3.xml");
final WebArchive war = ShrinkWrap.create(WebArchive.class, WAR_BASE_NAME + ".war").addClasses(HelloEJBCallServlet.class, //
LMCounterServlet.class).addAsWebInfResource(UsersRolesLoginModuleTestCase.class.getPackage(), "web-basic-authn.xml", //
"web.xml").addAsWebInfResource(Utils.getJBossWebXmlAsset(TEST_NAME), "jboss-web.xml");
final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, EAR_BASE_NAME + ".ear");
ear.addAsLibrary(libJar);
ear.addAsModule(war);
ear.addAsModule(ejbJar);
return ear;
}
use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project wildfly by wildfly.
the class SharedSessionFailoverTestCase method getDeployment.
private static Archive<?> getDeployment() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE + ".jar");
jar.addClass(Mutable.class);
WebArchive war1 = ShrinkWrap.create(WebArchive.class, MODULE_1 + ".war");
war1.addClass(SimpleServlet.class);
WebArchive war2 = ShrinkWrap.create(WebArchive.class, MODULE_2 + ".war");
war2.addClass(SimpleServlet.class);
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, MODULE + ".ear");
ear.addAsLibraries(jar);
ear.addAsModule(war1);
ear.addAsModule(war2);
ear.addAsManifestResource(SharedSessionFailoverTestCase.class.getPackage(), "jboss-all.xml", "jboss-all.xml");
return ear;
}
use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project Payara by payara.
the class PayaraRestDeployEarTest method getTestArchive.
/**
* Deployment for the test
*/
@Deployment(testable = false)
public static Archive<?> getTestArchive() {
final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war").addClasses(GreeterServlet.class);
final JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "test.jar").addClasses(Greeter.class);
final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear").setApplicationXML("application.xml").addAsModule(war).addAsModule(ejb);
log.info(ear.toString(true));
return ear;
}
Aggregations