use of org.gradle.testkit.runner.BuildResult in project crnk-framework by crnk-project.
the class GradleDeltaspikeTest method test.
@Test
public void test() throws IOException {
testFolder.create();
root = testFolder.getRoot();
saveFile("test_build.gradle", "build.gradle");
saveFile("test_settings.gradle", "settings.gradle");
saveFile("META-INF/beans.xml", "src/main/resources/META-INF/beans.xml");
saveFile("TestModuleProducer.template", "src/main/java/io/crnk/gen/typescript/TestModuleProducer.java");
GradleRunner runner = GradleRunner.create();
runner = runner.withPluginClasspath();
// List<File> files = Arrays.asList(new File("C:\\projects\\oss\\crnk-framework\\crnk-gen-typescript\\build\\classes\\main"));
runner = runner.withProjectDir(root);
// TODO move to assembleTypescript once ngrx-json-api released
runner = runner.withArguments("generateTypescript");
BuildResult build = runner.build();
System.out.println(build.getOutput());
}
use of org.gradle.testkit.runner.BuildResult in project lightning by automatictester.
the class ReportTaskTest method runReportWithFailureExpected.
@Test
public void runReportWithFailureExpected() {
BuildResult result = GradleRunner.create().withProjectDir(new File("src/integrationTest/resources/build/failure_report")).withArguments(":report").withPluginClasspath().buildAndFail();
assertThat(taskOutputContainsFileContent("/results/expected/report_failure.txt", result), is(true));
}
use of org.gradle.testkit.runner.BuildResult in project lightning by automatictester.
the class VerifyTaskTest method runVerifyWithMissingInput.
@Test(dataProvider = "getProjectDir")
public void runVerifyWithMissingInput(String projectDir) {
BuildResult result = GradleRunner.create().withProjectDir(new File(projectDir)).withArguments(":verify").withPluginClasspath().buildAndFail();
assertThat(taskOutputContainsText("Not all mandatory input specified for this task or specified files not readable", result), is(true));
}
use of org.gradle.testkit.runner.BuildResult in project lightning by automatictester.
the class VerifyTaskTest method runVerify.
@Test
public void runVerify() {
BuildResult result = GradleRunner.create().withProjectDir(new File("src/integrationTest/resources/build/complete")).withArguments(":verify").withPluginClasspath().build();
assertThat(result.task(":verify").getOutcome(), is(SUCCESS));
assertThat(taskOutputContainsFileContent("/results/expected/3_0_0.txt", result), is(true));
}
use of org.gradle.testkit.runner.BuildResult in project lightning by automatictester.
the class VerifyTaskTest method runVerifyWithRegexp.
@Test
public void runVerifyWithRegexp() {
BuildResult result = GradleRunner.create().withProjectDir(new File("src/integrationTest/resources/build/regexp")).withArguments(":verify").withPluginClasspath().build();
assertThat(result.task(":verify").getOutcome(), is(SUCCESS));
assertThat(taskOutputContainsFileContent("/results/expected/regexp.txt", result), is(true));
}
Aggregations