use of org.folio.okapi.bean.LaunchDescriptor in project okapi by folio-org.
the class ProcessModuleHandleTest method test3.
@Test
public void test3(TestContext context) {
final Async async = context.async();
LaunchDescriptor desc = new LaunchDescriptor();
desc.setExec("java -Dport=%p -jar unknown.jar");
ModuleHandle mh = createModuleHandle(desc, 9231);
mh.start(res -> {
context.assertFalse(res.succeeded());
async.complete();
});
}
use of org.folio.okapi.bean.LaunchDescriptor in project okapi by folio-org.
the class ProcessModuleHandleTest method test4.
@Test
public void test4(TestContext context) {
final Async async = context.async();
LaunchDescriptor desc = new LaunchDescriptor();
desc.setExec("java -Dport=9000 -jar unknown.jar");
ModuleHandle mh = createModuleHandle(desc, 9231);
mh.start(res -> {
context.assertFalse(res.succeeded());
context.assertEquals("Can not deploy: No %p in the exec line", res.cause().getMessage());
async.complete();
});
}
use of org.folio.okapi.bean.LaunchDescriptor in project okapi by folio-org.
the class ProcessModuleHandleTest method test2.
@Test
public void test2(TestContext context) {
final Async async = context.async();
LaunchDescriptor desc = new LaunchDescriptor();
desc.setExec("sleepxx 10 %p");
ModuleHandle mh = createModuleHandle(desc, 0);
mh.start(res -> {
context.assertFalse(res.succeeded());
async.complete();
});
}
use of org.folio.okapi.bean.LaunchDescriptor in project okapi by folio-org.
the class ProcessModuleHandleTest method test6.
@Test
public void test6(TestContext context) {
final Async async = context.async();
LaunchDescriptor desc = new LaunchDescriptor();
desc.setExec("java " + invokeTest);
ModuleHandle mh = createModuleHandle(desc, 9231);
mh.start(res1 -> {
mh.stop(res2 -> {
context.assertTrue(res2.succeeded());
async.complete();
});
});
}
use of org.folio.okapi.bean.LaunchDescriptor in project okapi by folio-org.
the class DeploymentManagerTest method test1.
@Test
public void test1(TestContext context) {
async = context.async();
LaunchDescriptor descriptor = new LaunchDescriptor();
descriptor.setExec("java -Dport=%p -jar " + "../okapi-test-module/target/okapi-test-module-fat.jar");
DeploymentDescriptor dd = new DeploymentDescriptor("1", "sid", descriptor);
dm.deploy(dd, res1 -> {
context.assertTrue(res1.succeeded());
dm.undeploy(res1.result().getInstId(), res2 -> {
// after undeploy so we have no stale process
context.assertEquals("http://myhost.index:9231", res1.result().getUrl());
context.assertTrue(res2.succeeded());
async.complete();
});
});
}
Aggregations