Skip to content

Commit

Permalink
check for build success
Browse files Browse the repository at this point in the history
  • Loading branch information
sullis committed Dec 15, 2024
1 parent 9702624 commit 0d44ac8
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.junit.jupiter.api.io.TempDir;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Fail.fail;

/**
* Tests for {@link ProjectGenerator} that uses all available
Expand Down Expand Up @@ -106,6 +107,16 @@ private void runBuild(Path mavenHome, Path projectDirectory, MutableProjectDescr
processBuilder.redirectOutput(output.toFile());
assertThat(processBuilder.start().waitFor()).describedAs(String.join("\n", Files.readAllLines(output)))
.isEqualTo(0);

if (description.getBuildSystem().id().equals(GradleBuildSystem.ID)) {
assertThat(output.toFile()).content().contains("BUILD SUCCESSFUL");
}
else if (description.getBuildSystem().id().equals(MavenBuildSystem.ID)) {
assertThat(output.toFile()).content().contains("BUILD SUCCESS");
}
else {
fail("unexpected Build System: " + description.getBuildSystem().id());
}
}

private ProcessBuilder createProcessBuilder(Path directory, BuildSystem buildSystem, Path home) {
Expand Down

0 comments on commit 0d44ac8

Please sign in to comment.