use of org.wildfly.swarm.Swarm in project wildfly-swarm by wildfly-swarm.
the class TopologyWebAppArquillianTest method newContainer.
@CreateSwarm
public static Swarm newContainer() throws Exception {
TopologyWebAppFraction topology = new TopologyWebAppFraction();
topology.proxyService("myService", "/my-proxy");
return new Swarm().fraction(topology).fraction(new JGroupsTopologyFraction());
}
use of org.wildfly.swarm.Swarm in project wildfly-swarm by wildfly-swarm.
the class Main method main.
public static void main(String[] args) throws Exception {
/*BEGIN:custom main:JAR_WITH_MAIN*/
swarm = new Swarm();
WARArchive war = ShrinkWrap.create(WARArchive.class).addPackage(Main.class.getPackage()).addAsWebInfResource(new ClassLoaderAsset("web.xml", Main.class.getClassLoader()), WebXmlAsset.NAME);
swarm.start().deploy(war);
/*END:custom main:JAR_WITH_MAIN*/
/*BEGIN:custom main:WAR_WITH_MAIN*/
swarm2 = new Swarm().start().deploy();
/*END:custom main:WAR_WITH_MAIN*/
}
use of org.wildfly.swarm.Swarm in project wildfly-swarm by wildfly-swarm.
the class MainWithProperties method main.
public static void main(String... args) throws Exception {
System.setProperty("swarm.logging", "TRACE");
System.setProperty("swarm.logging.custom.category", "DEBUG");
System.setProperty("swarm.logging.pattern-formatters.MY_COLOR_PATTERN.pattern", "%K{level}%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p (%t) [%c.%M()] %s%e%n");
swarm = new Swarm(args);
swarm.start().deploy();
}
use of org.wildfly.swarm.Swarm in project wildfly-swarm by wildfly-swarm.
the class Main method main.
public static void main(String... args) throws Exception {
swarm = new Swarm(args).fraction(new CamelFraction().addRouteBuilder(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start").transform(simple("Hello ${body}"));
}
}));
swarm.start().deploy();
}
use of org.wildfly.swarm.Swarm 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