-
Notifications
You must be signed in to change notification settings - Fork 5
/
TestVerticle.java
38 lines (31 loc) · 1.11 KB
/
TestVerticle.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.genericsystem.watch;
import org.genericsystem.common.GSVertx;
import org.genericsystem.reactor.appserver.ApplicationServer;
import org.genericsystem.watch.gui.WatchApp;
import io.vertx.core.AbstractVerticle;
/**
* Test Verticle to evaluate whether the GUI application can be launched from a verticle.
*
* @author Pierrik Lassalas
*/
public class TestVerticle extends AbstractVerticle {
private static final String gsPath = "/gs-cv_model3";
public static void main(String[] mainArgs) {
GSVertx.vertx().getVertx().deployVerticle(new TestVerticle(), res -> {
if (res.failed())
throw new IllegalStateException("Deployment of worker verticle failed.", res.cause());
});
}
@Override
public void start() throws Exception {
String[] mainArgs = {};
GSVertx.vertx().getVertx().executeBlocking(handler -> {
ApplicationServer server = ApplicationServer.startSimpleGenericApp(mainArgs, WatchApp.class, gsPath);
handler.complete(server);
}, res -> {
if (res.failed())
throw new IllegalStateException("Unable to execute the task");
System.out.println("server: " + res.result());
});
}
}