use of org.gradle.testkit.runner.BuildTask in project liferay-blade-samples by liferay.
the class BladeSamplesTest method testPanelAppGradleTemplates.
@Test
public void testPanelAppGradleTemplates() throws Exception {
File projectPath = BladeCLIUtil.createProject(_testDir, "panel-app", "helloworld");
BuildTask buildtask = GradleRunnerUtil.executeGradleRunner(projectPath, "build");
GradleRunnerUtil.verifyGradleRunnerOutput(buildtask);
File buildOutput = new File(projectPath + "/build/libs/helloworld-1.0.0.jar");
Assert.assertTrue(buildOutput.exists());
String bundleID = BladeCLIUtil.installBundle(buildOutput);
BladeCLIUtil.startBundle(bundleID);
BladeCLIUtil.uninstallBundle(bundleID);
}
use of org.gradle.testkit.runner.BuildTask 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.BuildTask 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.BuildTask 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;
}
use of org.gradle.testkit.runner.BuildTask in project liferay-blade-samples by liferay.
the class BladeSamplesTest method testMVCPortletGradleTemplates.
@Test
public void testMVCPortletGradleTemplates() throws Exception {
File projectPath = BladeCLIUtil.createProject(_testDir, "mvc-portlet", "helloworld");
BuildTask buildtask = GradleRunnerUtil.executeGradleRunner(projectPath, "build");
GradleRunnerUtil.verifyGradleRunnerOutput(buildtask);
File buildOutput = new File(projectPath + "/build/libs/helloworld-1.0.0.jar");
Assert.assertTrue(buildOutput.exists());
String bundleID = BladeCLIUtil.installBundle(buildOutput);
BladeCLIUtil.startBundle(bundleID);
BladeCLIUtil.uninstallBundle(bundleID);
}
Aggregations