use of org.jboss.shrinkwrap.api.ArchivePath in project hibernate-orm by hibernate.
the class PackagingTestCase method buildDefaultPar.
protected File buildDefaultPar() {
String fileName = "defaultpar.par";
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);
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 buildOverridenPar.
protected File buildOverridenPar() {
String fileName = "overridenpar.jar";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addClasses(org.hibernate.jpa.test.pack.overridenpar.Bug.class);
ArchivePath path = ArchivePaths.create("META-INF/persistence.xml");
archive.addAsResource("overridenpar/META-INF/persistence.xml", path);
path = ArchivePaths.create("overridenpar.properties");
archive.addAsResource("overridenpar/overridenpar.properties", 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 buildExplicitPar.
protected File buildExplicitPar() {
String fileName = "explicitpar.par";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addClasses(Airplane.class, Seat.class, Cat.class, Kitten.class, Distributor.class, Item.class);
ArchivePath path = ArchivePaths.create("META-INF/orm.xml");
archive.addAsResource("explicitpar/META-INF/orm.xml", path);
path = ArchivePaths.create("META-INF/persistence.xml");
archive.addAsResource("explicitpar/META-INF/persistence.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 ScannerTest method buildCfgXmlPar.
protected File buildCfgXmlPar() {
String fileName = "cfgxmlpar.par";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addClasses(Morito.class, Item.class);
ArchivePath path = ArchivePaths.create("META-INF/persistence.xml");
archive.addAsResource("cfgxmlpar/META-INF/persistence.xml", path);
path = ArchivePaths.create("org/hibernate/jpa/test/pack/cfgxmlpar/hibernate.cfg.xml");
archive.addAsResource("cfgxmlpar/org/hibernate/jpa/test/pack/cfgxmlpar/hibernate.cfg.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 buildCfgXmlPar.
protected File buildCfgXmlPar() {
String fileName = "cfgxmlpar.par";
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
archive.addClasses(Morito.class, Item.class);
ArchivePath path = ArchivePaths.create("META-INF/persistence.xml");
archive.addAsResource("cfgxmlpar/META-INF/persistence.xml", path);
path = ArchivePaths.create("org/hibernate/jpa/test/pack/cfgxmlpar/hibernate.cfg.xml");
archive.addAsResource("cfgxmlpar/org/hibernate/jpa/test/pack/cfgxmlpar/hibernate.cfg.xml", path);
File testPackage = new File(shrinkwrapArchiveDirectory, fileName);
archive.as(ZipExporter.class).exportTo(testPackage, true);
return testPackage;
}
Aggregations