use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class RemotingArquillianTest method createDeployment.
@Deployment
public static Archive createDeployment() {
JARArchive deployment = ShrinkWrap.create(JARArchive.class);
deployment.add(EmptyAsset.INSTANCE, "nothing");
return deployment;
}
use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class SwaggerWebAppDefaultUrlChangerArquillianTest method createDeployment.
@SuppressWarnings("rawtypes")
@Deployment(testable = false)
public static Archive createDeployment() {
JARArchive deployment = ShrinkWrap.create(JARArchive.class);
deployment.addAsResource("project-application-path.yml");
return deployment;
}
use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class CDITest method testFractionMatching.
@Test
public void testFractionMatching() throws Exception {
JARArchive archive = ShrinkWrap.create(JARArchive.class);
archive.addAsResource("WEB-INF/beans.xml");
FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();
final File out = Files.createTempFile(archive.getName(), ".war").toFile();
out.deleteOnExit();
archive.as(ZipExporter.class).exportTo(out, true);
analyzer.source(out);
assertThat(analyzer.detectNeededFractions().stream().filter(fd -> fd.getArtifactId().equals("cdi")).count()).isEqualTo(1);
}
use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class CDITest method testFractionMatchingWEBINFClasses.
@Test
public void testFractionMatchingWEBINFClasses() throws Exception {
JARArchive archive = ShrinkWrap.create(JARArchive.class);
archive.addAsResource("WEB-INF/classes/META-INF/beans.xml");
FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();
final File out = Files.createTempFile(archive.getName(), ".war").toFile();
out.deleteOnExit();
archive.as(ZipExporter.class).exportTo(out, true);
analyzer.source(out);
assertThat(analyzer.detectNeededFractions().stream().filter(fd -> fd.getArtifactId().equals("cdi")).count()).isEqualTo(1);
}
use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class DeploymentFailureTest method testDeploymentFailure.
@Test
public void testDeploymentFailure() throws Exception {
Swarm swarm = new Swarm();
swarm.start();
JARArchive a = ShrinkWrap.create(JARArchive.class, "bad-deployment.jar");
a.addModule("com.i.do.no.exist");
try {
swarm.deploy(a);
fail("should have throw a DeploymentException");
} catch (DeploymentException e) {
// expected and correct
assertThat(e.getArchive()).isSameAs(a);
assertThat(e.getMessage()).contains("org.jboss.modules.ModuleNotFoundException: com.i.do.no.exist");
} finally {
swarm.stop();
}
}
Aggregations