use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class WarPluginActionIntegrationTests method errorMessageIsHelpfulWhenMainClassCannotBeResolved.
@TestTemplate
void errorMessageIsHelpfulWhenMainClassCannotBeResolved() {
BuildResult result = this.gradleBuild.buildAndFail("build", "-PapplyWarPlugin");
assertThat(result.task(":bootWar").getOutcome()).isEqualTo(TaskOutcome.FAILED);
assertThat(result.getOutput()).contains("Main class name has not been configured and it could not be resolved");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootRunIntegrationTests method optimizedLaunchDisabledJvmArgs.
@TestTemplate
void optimizedLaunchDisabledJvmArgs() throws IOException {
copyJvmArgsApplication();
BuildResult result = this.gradleBuild.build("bootRun");
assertThat(result.task(":bootRun").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).doesNotContain("-Xverify:none").doesNotContain("-XX:TieredStopAtLevel=1");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootRunIntegrationTests method defaultJvmArgs.
@TestTemplate
void defaultJvmArgs() throws IOException {
copyJvmArgsApplication();
BuildResult result = this.gradleBuild.build("bootRun");
assertThat(result.task(":bootRun").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
assertThat(result.getOutput()).contains("1. -XX:TieredStopAtLevel=1");
} else {
assertThat(result.getOutput()).contains("1. -Xverify:none").contains("2. -XX:TieredStopAtLevel=1");
}
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootRunIntegrationTests method applicationPluginMainClassNameIsUsed.
@TestTemplate
void applicationPluginMainClassNameIsUsed() throws IOException {
copyMainClassApplication();
BuildResult result = this.gradleBuild.build("bootRun");
assertThat(result.task(":bootRun").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("com.example.bootrun.main.CustomMainClass");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootRunIntegrationTests method sourceResourcesCanBeUsed.
@TestTemplate
void sourceResourcesCanBeUsed() throws IOException {
copyClasspathApplication();
BuildResult result = this.gradleBuild.build("bootRun");
assertThat(result.task(":bootRun").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("1. " + canonicalPathOf("src/main/resources"));
assertThat(result.getOutput()).contains("2. " + canonicalPathOf("build/classes/java/main"));
assertThat(result.getOutput()).doesNotContain(canonicalPathOf("build/resources/main"));
}
Aggregations