Search in sources :

Example 16 with JavaArchive

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;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 17 with JavaArchive

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

Example 18 with JavaArchive

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;
}
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 19 with JavaArchive

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;
}
Also used : ExplodedExporter(org.jboss.shrinkwrap.api.exporter.ExplodedExporter) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 20 with JavaArchive

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;
}
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)

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