Search in sources :

Example 26 with JavaArchive

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

the class ScannerTest 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) VirtualFile(org.jboss.vfs.VirtualFile) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 27 with JavaArchive

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

the class JMXPropertyEditorsTestCase method deploymentObjectByte.

@Deployment(name = "ObjectByte", managed = false)
public static Archive<?> deploymentObjectByte() {
    // jar
    final JavaArchive jmxSAR = createArchive("ObjectByte");
    Asset asset = createServiceAsset("ObjectByte", "10");
    jmxSAR.addAsManifestResource(asset, "jboss-service.xml");
    return jmxSAR;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 28 with JavaArchive

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

the class JMXPropertyEditorsTestCase method deploymentInetAddress.

@Deployment(name = "InetAddress", managed = false)
public static Archive<?> deploymentInetAddress() {
    // jar
    final JavaArchive jmxSAR = createArchive("InetAddress");
    Asset asset = createServiceAsset("InetAddress", "10.10.10.1");
    jmxSAR.addAsManifestResource(asset, "jboss-service.xml");
    return jmxSAR;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 29 with JavaArchive

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

the class JMXPropertyEditorsTestCase method deploymentObjectBoolean.

@Deployment(name = "ObjectBoolean", managed = false)
public static Archive<?> deploymentObjectBoolean() {
    // jar
    final JavaArchive jmxSAR = createArchive("ObjectBoolean");
    Asset asset = createServiceAsset("ObjectBoolean", "true");
    jmxSAR.addAsManifestResource(asset, "jboss-service.xml");
    return jmxSAR;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 30 with JavaArchive

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

the class JMXPropertyEditorsTestCase method deploymentLocale.

@Deployment(name = "Locale", managed = false)
public static Archive<?> deploymentLocale() {
    // jar
    final JavaArchive jmxSAR = createArchive("Locale");
    Asset asset = createServiceAsset("Locale", Locale.ENGLISH.toString());
    jmxSAR.addAsManifestResource(asset, "jboss-service.xml");
    return jmxSAR;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

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