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);
swarm.start();
JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "myapp.war");
deployment.addClass(MyResource.class);
deployment.setContextRoot("rest");
deployment.addAllDependencies();
swarm.deploy(deployment);
}
use of org.wildfly.swarm.Swarm in project wildfly-swarm by wildfly-swarm.
the class MonitorPayloadTest method getContainer.
@CreateSwarm
public static Swarm getContainer() throws Exception {
Swarm container = new Swarm();
container.fraction(new JAXRSFraction());
container.fraction(new MonitorFraction());
return container;
}
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);
swarm.fraction(new DatasourcesFraction().jdbcDriver("h2", (d) -> {
d.driverClassName("org.h2.Driver");
d.xaDatasourceClass("org.h2.jdbcx.JdbcDataSource");
d.driverModuleName("com.h2database.h2");
}).dataSource("ExampleDS", (ds) -> {
ds.driverName("h2");
ds.connectionUrl("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE");
ds.userName("sa");
ds.password("sa");
}));
swarm.start().deploy();
}
use of org.wildfly.swarm.Swarm in project wildfly-swarm by wildfly-swarm.
the class EEArquillianTest method newSwarm.
@CreateSwarm
public static Swarm newSwarm() throws Exception {
EEFraction fraction = new EEFraction();
fraction.applyDefaults();
return new Swarm().fraction(fraction);
}
use of org.wildfly.swarm.Swarm in project wildfly-swarm by wildfly-swarm.
the class SWARM553Test method newContainer.
@CreateSwarm
public static Swarm newContainer() throws Exception {
return new Swarm().fraction(new LoggingFraction().periodicSizeRotatingFileHandler("FILE", (h) -> {
h.level(Level.INFO).append(true).suffix(".yyyy-MM-dd").rotateSize("30m").enabled(true).encoding("UTF-8").maxBackupIndex(2);
Map<String, String> fileSpec = new HashMap<>();
fileSpec.put("path", logFile);
h.file(fileSpec);
}).logger("br.org.sistemafieg.cliente", (l) -> {
l.level(Level.INFO).handler("FILE");
}));
}
Aggregations