Search in sources :

Example 26 with JARArchive

use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.

the class RibbonArchiveTest method testAdvertiseExplicitName.

@Test
public void testAdvertiseExplicitName() {
    JARArchive archive = ShrinkWrap.create(JARArchive.class, "myapp.war");
    archive.as(RibbonArchive.class).advertise("myotherapp");
    Asset asset = archive.get(RibbonArchive.REGISTRATION_CONF).getAsset();
    assertThat(asset).isNotNull();
    assertThat(asset).isInstanceOf(StringAsset.class);
    assertThat(((StringAsset) asset).getSource().trim()).isEqualTo("myotherapp");
    assertThat(archive.as(ServiceActivatorArchive.class).containsServiceActivator(RibbonArchiveImpl.SERVICE_ACTIVATOR_CLASS_NAME)).isTrue();
}
Also used : ServiceActivatorArchive(org.wildfly.swarm.msc.ServiceActivatorArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) JARArchive(org.wildfly.swarm.spi.api.JARArchive) Test(org.junit.Test)

Example 27 with JARArchive

use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.

the class RibbonArchiveTest method testAdvertiseDefaultName.

@Test
public void testAdvertiseDefaultName() {
    JARArchive archive = ShrinkWrap.create(JARArchive.class, "myapp.war");
    archive.as(RibbonArchive.class).advertise();
    Asset asset = archive.get(RibbonArchive.REGISTRATION_CONF).getAsset();
    assertThat(asset).isNotNull();
    assertThat(asset).isInstanceOf(StringAsset.class);
    assertThat(((StringAsset) asset).getSource().trim()).isEqualTo("myapp");
    assertThat(archive.as(ServiceActivatorArchive.class).containsServiceActivator(RibbonArchiveImpl.SERVICE_ACTIVATOR_CLASS_NAME)).isTrue();
}
Also used : ServiceActivatorArchive(org.wildfly.swarm.msc.ServiceActivatorArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) JARArchive(org.wildfly.swarm.spi.api.JARArchive) Test(org.junit.Test)

Example 28 with JARArchive

use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.

the class JCAArquillianTest method createDeployment.

@Deployment(testable = false)
public static Archive createDeployment() {
    JARArchive deployment = ShrinkWrap.create(JARArchive.class);
    deployment.add(EmptyAsset.INSTANCE, "nothing");
    return deployment;
}
Also used : JARArchive(org.wildfly.swarm.spi.api.JARArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 29 with JARArchive

use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.

the class MySQLJPAArquillianTest method createDeployment.

@Deployment(testable = true)
public static Archive createDeployment() {
    JARArchive deployment = ShrinkWrap.create(JARArchive.class);
    deployment.add(EmptyAsset.INSTANCE, "nothing");
    return deployment;
}
Also used : JARArchive(org.wildfly.swarm.spi.api.JARArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 30 with JARArchive

use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.

the class JPAArquillianTest method createDeployment.

@Deployment(testable = true)
public static Archive createDeployment() {
    JARArchive deployment = ShrinkWrap.create(JARArchive.class);
    deployment.add(EmptyAsset.INSTANCE, "nothing");
    return deployment;
}
Also used : JARArchive(org.wildfly.swarm.spi.api.JARArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

JARArchive (org.wildfly.swarm.spi.api.JARArchive)84 Deployment (org.jboss.arquillian.container.test.api.Deployment)52 Test (org.junit.Test)25 File (java.io.File)12 ShrinkWrap (org.jboss.shrinkwrap.api.ShrinkWrap)12 Files (java.nio.file.Files)11 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)11 Assertions.assertThat (org.fest.assertions.Assertions.assertThat)10 FractionUsageAnalyzer (org.wildfly.swarm.fractions.FractionUsageAnalyzer)10 IOException (java.io.IOException)5 Asset (org.jboss.shrinkwrap.api.asset.Asset)5 ServiceActivatorArchive (org.wildfly.swarm.msc.ServiceActivatorArchive)5 Assertions (org.fest.assertions.Assertions)4 ArchivePath (org.jboss.shrinkwrap.api.ArchivePath)4 Node (org.jboss.shrinkwrap.api.Node)4 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)4 InputStream (java.io.InputStream)3 Map (java.util.Map)3 ZipImporter (org.jboss.shrinkwrap.api.importer.ZipImporter)3 TopologyArchive (org.wildfly.swarm.topology.TopologyArchive)3