Search in sources :

Example 21 with JavaArchive

use of org.jboss.shrinkwrap.api.spec.JavaArchive in project wildfly by wildfly.

the class ScannerTests 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(shrinkwrapArchiveDirectory, fileName);
    archive.as(ZipExporter.class).exportTo(testPackage, true);
    return testPackage;
}
Also used : ArchivePath(org.jboss.shrinkwrap.api.ArchivePath) ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 22 with JavaArchive

use of org.jboss.shrinkwrap.api.spec.JavaArchive in project wildfly by wildfly.

the class ScannerTests method buildExplodedPar.

protected File buildExplodedPar() {
    String fileName = "explodedpar";
    JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName);
    archive.addClasses(Elephant.class, Carpet.class);
    ArchivePath path = ArchivePaths.create("META-INF/persistence.xml");
    archive.addAsResource("explodedpar/META-INF/persistence.xml", path);
    path = ArchivePaths.create("org/hibernate/jpa/test/pack/explodedpar/Elephant.hbm.xml");
    archive.addAsResource("explodedpar/org/hibernate/jpa/test/pack/explodedpar/Elephant.hbm.xml", path);
    path = ArchivePaths.create("org/hibernate/jpa/test/pack/explodedpar/package-info.class");
    archive.addAsResource("org/hibernate/jpa/test/pack/explodedpar/package-info.class", path);
    File testPackage = new File(shrinkwrapArchiveDirectory, fileName);
    archive.as(ExplodedExporter.class).exportExploded(shrinkwrapArchiveDirectory);
    return testPackage;
}
Also used : ArchivePath(org.jboss.shrinkwrap.api.ArchivePath) ExplodedExporter(org.jboss.shrinkwrap.api.exporter.ExplodedExporter) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 23 with JavaArchive

use of org.jboss.shrinkwrap.api.spec.JavaArchive in project wildfly by wildfly.

the class ScannerTest 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(shrinkwrapArchiveDirectory, fileName);
    archive.as(ZipExporter.class).exportTo(testPackage, true);
    return testPackage;
}
Also used : ArchivePath(org.jboss.shrinkwrap.api.ArchivePath) ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) VirtualFile(org.jboss.vfs.VirtualFile) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 24 with JavaArchive

use of org.jboss.shrinkwrap.api.spec.JavaArchive in project wildfly by wildfly.

the class ScannerTest 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;
}
Also used : ArchivePath(org.jboss.shrinkwrap.api.ArchivePath) ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) VirtualFile(org.jboss.vfs.VirtualFile) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 25 with JavaArchive

use of org.jboss.shrinkwrap.api.spec.JavaArchive in project wildfly by wildfly.

the class ScannerTest 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(shrinkwrapArchiveDirectory, fileName);
    archive.as(ZipExporter.class).exportTo(testPackage, true);
    return testPackage;
}
Also used : ArchivePath(org.jboss.shrinkwrap.api.ArchivePath) ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) VirtualFile(org.jboss.vfs.VirtualFile) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Aggregations

JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)1209 Deployment (org.jboss.arquillian.container.test.api.Deployment)979 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)301 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)192 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)183 File (java.io.File)125 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)109 Asset (org.jboss.shrinkwrap.api.asset.Asset)89 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)62 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)57 PropertyPermission (java.util.PropertyPermission)46 InputStream (java.io.InputStream)39 TargetsContainer (org.jboss.arquillian.container.test.api.TargetsContainer)36 Test (org.junit.Test)36 ArchivePath (org.jboss.shrinkwrap.api.ArchivePath)31 FilePermission (java.io.FilePermission)29 OSGiManifestBuilder (org.jboss.osgi.metadata.OSGiManifestBuilder)26 BeansXml (org.jboss.shrinkwrap.impl.BeansXml)22 CommandSupport (io.fabric8.itests.support.CommandSupport)18 ManifestBuilder (org.jboss.gravia.resource.ManifestBuilder)18