use of org.jboss.shrinkwrap.api.ArchivePath in project hibernate-orm by hibernate.
the class PackagingTestCase method buildWar.
protected File buildWar() {
String fileName = "war.war";
WebArchive archive = ShrinkWrap.create(WebArchive.class, fileName);
archive.addClasses(org.hibernate.jpa.test.pack.war.ApplicationServer.class, org.hibernate.jpa.test.pack.war.IncrementListener.class, org.hibernate.jpa.test.pack.war.Lighter.class, org.hibernate.jpa.test.pack.war.Money.class, org.hibernate.jpa.test.pack.war.Mouse.class, org.hibernate.jpa.test.pack.war.OtherIncrementListener.class, org.hibernate.jpa.test.pack.war.Version.class);
ArchivePath path = ArchivePaths.create("WEB-INF/classes/META-INF/orm.xml");
archive.addAsResource("war/WEB-INF/classes/META-INF/orm.xml", path);
path = ArchivePaths.create("WEB-INF/classes/META-INF/persistence.xml");
archive.addAsResource("war/WEB-INF/classes/META-INF/persistence.xml", path);
path = ArchivePaths.create("WEB-INF/classes/org/hibernate/jpa/test/pack/war/Mouse.hbm.xml");
archive.addAsResource("war/WEB-INF/classes/org/hibernate/jpa/test/pack/war/Mouse.hbm.xml", path);
File testPackage = new File(packageTargetDir, fileName);
archive.as(ZipExporter.class).exportTo(testPackage, true);
return testPackage;
}
use of org.jboss.shrinkwrap.api.ArchivePath in project hibernate-orm by hibernate.
the class PackagingTestCase method buildSpacePar.
protected File buildSpacePar() {
String fileName = "space par.par";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addClasses(Bug.class);
ArchivePath path = ArchivePaths.create("META-INF/persistence.xml");
archive.addAsResource("space par/META-INF/persistence.xml", path);
File testPackage = new File(packageTargetDir, fileName);
archive.as(ZipExporter.class).exportTo(testPackage, true);
return testPackage;
}
use of org.jboss.shrinkwrap.api.ArchivePath in project hibernate-orm by hibernate.
the class PackagingTestCase method buildExternalJar2.
protected File buildExternalJar2() {
String fileName = "externaljar2.jar";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addClasses(Scooter.class);
ArchivePath path = ArchivePaths.create("META-INF/orm.xml");
archive.addAsResource("externaljar/META-INF/orm.xml", path);
File testPackage = new File(packageTargetDir, fileName);
archive.as(ZipExporter.class).exportTo(testPackage, true);
return testPackage;
}
use of org.jboss.shrinkwrap.api.ArchivePath in project wildfly by wildfly.
the class ScannerTest method buildWar.
protected File buildWar() {
String fileName = "war.war";
WebArchive archive = ShrinkWrap.create(WebArchive.class, fileName);
archive.addClasses(org.hibernate.jpa.test.pack.war.ApplicationServer.class, org.hibernate.jpa.test.pack.war.IncrementListener.class, org.hibernate.jpa.test.pack.war.Lighter.class, org.hibernate.jpa.test.pack.war.Money.class, org.hibernate.jpa.test.pack.war.Mouse.class, org.hibernate.jpa.test.pack.war.OtherIncrementListener.class, org.hibernate.jpa.test.pack.war.Version.class);
ArchivePath path = ArchivePaths.create("WEB-INF/classes/META-INF/orm.xml");
archive.addAsResource("war/WEB-INF/classes/META-INF/orm.xml", path);
path = ArchivePaths.create("WEB-INF/classes/META-INF/persistence.xml");
archive.addAsResource("war/WEB-INF/classes/META-INF/persistence.xml", path);
path = ArchivePaths.create("WEB-INF/classes/org/hibernate/jpa/test/pack/war/Mouse.hbm.xml");
archive.addAsResource("war/WEB-INF/classes/org/hibernate/jpa/test/pack/war/Mouse.hbm.xml", path);
File testPackage = new File(shrinkwrapArchiveDirectory, fileName);
archive.as(ZipExporter.class).exportTo(testPackage, true);
return testPackage;
}
use of org.jboss.shrinkwrap.api.ArchivePath 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;
}
Aggregations