use of io.vertx.starter.model.BuildTool in project vertx-starter by vert-x3.
the class GeneratorTest method testProject.
private void testProject(VertxProject project, Vertx vertx, VertxTestContext testContext) {
vertx.eventBus().<Buffer>request(Topics.PROJECT_REQUESTED, project, testContext.succeeding(msg -> {
unpack(vertx, testContext, workdir, msg.body(), testContext.succeeding(unpacked -> {
testContext.verify(() -> {
verifyBaseFiles();
BuildTool buildTool = project.getBuildTool();
Language language = project.getLanguage();
if (buildTool == MAVEN) {
verifyMavenFiles();
} else if (buildTool == GRADLE) {
verifyGradleFiles(language);
} else {
testContext.failNow(new NoStackTraceThrowable(unsupported(buildTool)));
return;
}
try {
verifySourceFiles(language);
} catch (IOException e) {
throw new AssertionError(e);
}
if (Utils.isWindows()) {
testContext.completeNow();
} else {
buildProject(vertx, buildTool, testContext.succeeding(projectBuilt -> {
testContext.verify(() -> {
if (buildTool == MAVEN) {
try {
verifyMavenOutputFiles();
} catch (IOException e) {
throw new AssertionError(e);
}
} else if (buildTool == GRADLE) {
try {
verifyGradleOutputFiles();
} catch (IOException e) {
throw new AssertionError(e);
}
} else {
testContext.failNow(new NoStackTraceThrowable(unsupported(buildTool)));
}
runDevMode(vertx, buildTool, testContext.succeeding(devModeRan -> testContext.completeNow()));
});
}));
}
});
}));
}));
}
use of io.vertx.starter.model.BuildTool in project vertx-starter by vert-x3.
the class GeneratorTest method testProjectsJdk8.
static Stream<VertxProject> testProjectsJdk8() throws IOException {
List<String> versions = Util.loadStarterData().getJsonArray("versions").stream().map(JsonObject.class::cast).map(obj -> obj.getString("number")).filter(version -> !version.endsWith("-SNAPSHOT")).collect(toList());
List<Set<String>> testDeps = Arrays.asList(Collections.singleton("vertx-unit"), Collections.singleton("vertx-junit5"));
Stream.Builder<VertxProject> builder = Stream.builder();
for (BuildTool buildTool : BuildTool.values()) {
for (Language language : Language.values()) {
for (String version : versions) {
for (Set<String> vertxDependencies : testDeps) {
VertxProject vertxProject = defaultProject().setBuildTool(buildTool).setLanguage(language).setVertxVersion(version).setVertxDependencies(new HashSet<>(vertxDependencies)).setPackageName("com.mycompany.project.special");
builder.add(vertxProject);
}
}
}
}
return builder.build();
}
Aggregations