use of org.jenkinsci.test.acceptance.plugins.gradle.GradleStep in project acceptance-test-harness by jenkinsci.
the class GradlePluginTest method run_gradle_script_in_dir.
/**
* Verify the execution of gradle build script localized divergent to default folder.
*/
@Test
public void run_gradle_script_in_dir() {
final String gradleInstallationName = "gradle-1.5";
GradleInstallation.installGradle(jenkins, gradleInstallationName, "1.5");
FreeStyleJob job = jenkins.jobs.create();
job.copyResource(resource(GRADLE_SCRIPT_NO_PLUGIN), "gradle/hello.gradle");
GradleStep step = job.addBuildStep(GradleStep.class);
step.setFile("hello.gradle");
step.setVersion(gradleInstallationName);
step.setTasks(HELLO.getName());
step.setDir("gradle");
job.save();
final Build build = job.startBuild();
build.shouldSucceed();
assertThat(build.getConsole(), containsString(HELLO.getPrintln()));
}
use of org.jenkinsci.test.acceptance.plugins.gradle.GradleStep in project acceptance-test-harness by jenkinsci.
the class GradlePluginTest method run_gradle_environment_variables.
/**
* Verify the execution of gradle build script with Jenkins environment variables as gradle parameters.
*/
@Test
public void run_gradle_environment_variables() {
GradleInstallation.installGradle(jenkins);
final FreeStyleJob job = jenkins.jobs.create();
job.copyResource(resource(GRADLE_SCRIPT), "build.gradle");
final GradleStep step = job.addBuildStep(GradleStep.class);
step.setVersion(GradleInstallation.DEFAULT);
step.setTasks(ENVIRONMENT_VARIABLES.getName());
job.save();
final Build build = job.startBuild().shouldSucceed();
assertThat(build.getConsole(), containsString("Build Number: " + build.getNumber()));
assertThat(build.getConsole(), containsString("Build Name: " + build.getName()));
}
Aggregations