use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RedeployTest method testStartingApplicationInRedeployMode.
@Test
public void testStartingApplicationInRedeployMode() {
cli.dispatch(new Launcher(), new String[] { "run", HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt", "--launcher-class=" + Launcher.class.getName() });
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
}
use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RedeployTest method testRedeployment.
@Test
public void testRedeployment() throws IOException {
cli.dispatch(new Launcher(), new String[] { "run", HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt", "--launcher-class=" + Launcher.class.getName(), ExecUtils.isWindows() ? "--redeploy-termination-period=3000" : "" });
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
long start1 = RunCommandTest.getContent().getLong("startTime");
File file = new File("target/test-classes/foo.txt");
if (file.exists()) {
file.delete();
}
file.createNewFile();
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200 && start1 != RunCommandTest.getContent().getLong("startTime");
} catch (IOException e) {
return false;
}
}, 20000);
}
use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RedeployTest method testStartingApplicationInRedeployModeWithInlineOptions.
@Test
public void testStartingApplicationInRedeployModeWithInlineOptions() throws IOException {
cli.dispatch(new Launcher(), new String[] { "run", HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt", "--launcher-class=" + OptionsRecordingLauncher.class.getName(), "--options", "{\"metricsOptions\":{\"enabled\":true}}" });
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
JsonObject vertxOptions = conf.getJsonObject(OptionsRecordingLauncher.class.getName());
assertThat(vertxOptions).isNotNull().isNotEmpty();
JsonObject metricsOptions = vertxOptions.getJsonObject("metricsOptions");
assertThat(metricsOptions).isNotNull().isNotEmpty();
assertThat(metricsOptions.getBoolean("enabled")).isEqualTo(true);
}
use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RedeployTest method testStartingApplicationInRedeployModeWithFileConf.
@Test
public void testStartingApplicationInRedeployModeWithFileConf() throws IOException {
cli.dispatch(new Launcher(), new String[] { "run", HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt", "--launcher-class=" + Launcher.class.getName(), "--conf", new File("src/test/resources/conf.json").getAbsolutePath() });
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getString("name")).isEqualTo("vertx");
}
use of io.vertx.core.Launcher in project vert.x by eclipse.
the class RunCommandTest method testFatJarWithMissingMainVerticle.
@Test
public void testFatJarWithMissingMainVerticle() throws IOException, InterruptedException {
setManifest("MANIFEST-Launcher-Missing-Main-Verticle.MF");
record();
cli.dispatch(new Launcher(), new String[] {});
assertWaitUntil(() -> error.toString().contains("ClassNotFoundException"));
stop();
}
Aggregations