use of org.gradle.testkit.runner.BuildResult in project core-java by SpineEventEngine.
the class ModelVerifierPluginShould method halt_build_on_malformed_command_handling_methods.
// TODO:2017-08-25:dmytro.dashenkov: Re-enable when Model is capable of
@Ignore
// https://github.com/SpineEventEngine/base/issues/49
@Test
public void halt_build_on_malformed_command_handling_methods() {
final BuildResult result = newProjectWithJava("io/spine/model/verify/MalformedAggregate.java").executeAndFail(VERIFY_MODEL);
final BuildTask task = result.task(toPath(VERIFY_MODEL));
assertNotNull(task);
final TaskOutcome generationResult = task.getOutcome();
assertEquals(FAILED, generationResult);
}
use of org.gradle.testkit.runner.BuildResult in project core-java by SpineEventEngine.
the class ModelVerifierPluginShould method halt_build_on_duplicate_command_handling_methods.
@Test
public void halt_build_on_duplicate_command_handling_methods() {
final BuildResult result = newProjectWithJava("io/spine/model/verify/DuplicateAggregate.java", "io/spine/model/verify/DuplicateCommandHandler.java").executeAndFail(VERIFY_MODEL);
final BuildTask task = result.task(toPath(VERIFY_MODEL));
assertNotNull(task);
final TaskOutcome generationResult = task.getOutcome();
assertEquals(FAILED, generationResult);
}
use of org.gradle.testkit.runner.BuildResult in project wildfly-gradle-tools by wildfly.
the class CombinedPluginsTest method testFeaturePackTask.
@Test
public void testFeaturePackTask() throws Exception {
BuildResult result = testProject.runTask("provision");
assertEquals(TaskOutcome.SUCCESS, result.task(":provision").getOutcome());
}
use of org.gradle.testkit.runner.BuildResult in project wildfly-gradle-tools by wildfly.
the class FeaturePackFunctionalTest method testFeaturePackTask.
@Test
public void testFeaturePackTask() throws Exception {
BuildResult result = testProject.runTask("featurepack");
assertEquals(result.task(":featurepack").getOutcome(), TaskOutcome.SUCCESS);
File expectedModuleFile = new File(testProject.getWorkDirectory() + File.separator + "featurepack" + File.separator + "modules" + File.separator + "system" + File.separator + "layers" + File.separator + "base" + File.separator + "org" + File.separator + "hibernate" + File.separator + "orm53" + File.separator + "module.xml");
assertTrue("The module.xml has not been created " + expectedModuleFile.getPath(), expectedModuleFile.exists());
ModuleParseResult parseResult = ModuleParser.parse(expectedModuleFile.toPath());
assertThat(parseResult.getIdentifier().getSlot(), is("orm53"));
}
use of org.gradle.testkit.runner.BuildResult in project liferay-blade-samples by liferay.
the class GradleRunnerUtil method executeGradleRunner.
public static BuildTask executeGradleRunner(File projectDir, String... taskPath) {
GradleRunner runner = GradleRunner.create().withProjectDir(projectDir);
GradleRunner runnerWithArguments = runner.withArguments(taskPath);
BuildResult buildResult = runnerWithArguments.build();
BuildTask buildtask = null;
for (BuildTask task : buildResult.getTasks()) {
if (task.getPath().endsWith(taskPath[taskPath.length - 1])) {
buildtask = task;
break;
}
}
return buildtask;
}
Aggregations