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 39a7b53
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
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 +108,14 @@ 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("expected Build System: " + description.getBuildSystem().id());
}
}

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

0 comments on commit 39a7b53

Please sign in to comment.