use of org.jboss.shrinkwrap.api.spec.JavaArchive 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.JavaArchive in project wildfly by wildfly.
the class ScannerTest method buildNestedEarDir.
protected File buildNestedEarDir(File includeFile) {
String fileName = "nesteddir.ear";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addAsResource(includeFile);
File testPackage = new File(shrinkwrapArchiveDirectory, fileName);
archive.as(ExplodedExporter.class).exportExploded(shrinkwrapArchiveDirectory);
return testPackage;
}
use of org.jboss.shrinkwrap.api.spec.JavaArchive in project wildfly by wildfly.
the class ScannerTests method buildDefaultPar.
protected File buildDefaultPar() {
final String fileName = "defaultpar.par";
final File physicalParFile = new File(shrinkwrapArchiveDirectory, fileName);
if (physicalParFile.exists()) {
return physicalParFile;
}
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addClasses(ApplicationServer.class, Lighter.class, Money.class, Mouse.class, OtherIncrementListener.class, IncrementListener.class, Version.class);
ArchivePath path = ArchivePaths.create("META-INF/orm.xml");
archive.addAsResource("defaultpar/META-INF/orm.xml", path);
path = ArchivePaths.create("META-INF/persistence.xml");
archive.addAsResource("defaultpar/META-INF/persistence.xml", path);
path = ArchivePaths.create("org/hibernate/jpa/test/pack/defaultpar/Mouse.hbm.xml");
archive.addAsResource("defaultpar/org/hibernate/jpa/test/pack/defaultpar/Mouse.hbm.xml", path);
path = ArchivePaths.create("org/hibernate/jpa/test/pack/defaultpar/package-info.class");
archive.addAsResource("org/hibernate/jpa/test/pack/defaultpar/package-info.class", path);
archive.as(ZipExporter.class).exportTo(physicalParFile, true);
return physicalParFile;
}
use of org.jboss.shrinkwrap.api.spec.JavaArchive in project wildfly by wildfly.
the class ScannerTests method buildNestedEarDir.
protected File buildNestedEarDir(File includeFile) {
String fileName = "nesteddir.ear";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addAsResource(includeFile);
File testPackage = new File(shrinkwrapArchiveDirectory, fileName);
archive.as(ExplodedExporter.class).exportExploded(shrinkwrapArchiveDirectory);
return testPackage;
}
use of org.jboss.shrinkwrap.api.spec.JavaArchive in project wildfly by wildfly.
the class ScannerTests method buildExcludeHbmPar.
protected File buildExcludeHbmPar() {
String fileName = "excludehbmpar.par";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addClasses(Caipirinha.class);
ArchivePath path = ArchivePaths.create("META-INF/orm2.xml");
archive.addAsResource("excludehbmpar/META-INF/orm2.xml", path);
path = ArchivePaths.create("META-INF/persistence.xml");
archive.addAsResource("excludehbmpar/META-INF/persistence.xml", path);
path = ArchivePaths.create("org/hibernate/jpa/test/pack/excludehbmpar/Mouse.hbm.xml");
archive.addAsResource("excludehbmpar/org/hibernate/jpa/test/pack/excludehbmpar/Mouse.hbm.xml", path);
File testPackage = new File(shrinkwrapArchiveDirectory, fileName);
archive.as(ZipExporter.class).exportTo(testPackage, true);
return testPackage;
}
Aggregations