use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RunCommandTest method testDeploymentOfJavaVerticleWithCluster.
@Test
public void testDeploymentOfJavaVerticleWithCluster() throws IOException {
cli.dispatch(new Launcher(), new String[] { "run", HttpTestVerticle.class.getName(), "-cluster" });
assertWaitUntil(() -> {
try {
return getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
assertThat(getContent().getBoolean("clustered")).isTrue();
}
use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RunCommandTest method testWithConfProvidedAsFile.
@Test
public void testWithConfProvidedAsFile() throws IOException {
setManifest("MANIFEST-Launcher-Http-Verticle.MF");
cli.dispatch(new Launcher(), new String[] { "--conf", "target/test-classes/conf.json" });
assertWaitUntil(() -> {
try {
return getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
assertThat(getContent().getJsonObject("conf").getString("name")).isEqualToIgnoringCase("vertx");
}
use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RunCommandTest method testFatJarWithHTTPVerticleWithCluster.
@Test
public void testFatJarWithHTTPVerticleWithCluster() throws IOException, InterruptedException {
setManifest("MANIFEST-Launcher-Http-Verticle.MF");
cli.dispatch(new Launcher(), new String[] { "-cluster" });
assertWaitUntil(() -> {
try {
return getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
assertThat(getContent().getBoolean("clustered")).isTrue();
}
use of io.vertx.core.Launcher in project vert.x by eclipse.
the class StartStopListCommandsTest method testStartListStopWithJVMOptions.
@Test
public void testStartListStopWithJVMOptions() throws InterruptedException, IOException {
record();
cli.dispatch(new String[] { "start", "run", HttpTestVerticle.class.getName(), "--launcher-class", Launcher.class.getName(), "--java-opts=-Dfoo=bar -Dbaz=bar", "--redirect-output" });
waitForStartup();
assertThat(output.toString()).contains("Starting vert.x application");
JsonObject content = RunCommandTest.getContent();
assertThat(content.getString("foo")).isEqualToIgnoringCase("bar");
assertThat(content.getString("baz")).isEqualToIgnoringCase("bar");
output.reset();
cli.dispatch(new String[] { "list" });
assertThat(output.toString()).hasLineCount(2);
// Extract id.
String[] lines = output.toString().split(System.lineSeparator());
String id = lines[1].trim().substring(0, lines[1].trim().indexOf("\t"));
output.reset();
// pass --redeploy to not call system.exit
cli.dispatch(new String[] { "stop", id, "--redeploy" });
assertThat(output.toString()).contains("Stopping vert.x application '" + id + "'").contains("Application '" + id + "' terminated with status 0");
waitForShutdown();
assertWaitUntil(() -> {
output.reset();
cli.dispatch(new String[] { "list" });
return !output.toString().contains(id);
});
assertThat(output.toString()).hasLineCount(2).contains("No vert.x application found");
}
use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RunCommandTest method testThatHADeploysVerticleWhenCombinedWithCluster.
@Test
public void testThatHADeploysVerticleWhenCombinedWithCluster() throws IOException {
setManifest("MANIFEST-Launcher-Http-Verticle.MF");
cli.dispatch(new Launcher(), new String[] { "-ha", "-cluster" });
assertWaitUntil(() -> {
try {
return getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
assertThat(getContent().getBoolean("clustered")).isTrue();
}
Aggregations