use of javaposse.jobdsl.plugin.ExecuteDslScripts in project promoted-builds-plugin by jenkinsci.
the class PromotionsDslContextExtensionTest method testShouldGenerateTheDefindedComplexJob.
@Test
public void testShouldGenerateTheDefindedComplexJob() throws Exception {
// Given
String dsl = FileUtils.readFileToString(new File("src/test/resources/complex-example-dsl.groovy"));
FreeStyleProject seedJob = createFreeStyleProject();
seedJob.getBuildersList().add(new ExecuteDslScripts(new ExecuteDslScripts.ScriptLocation(Boolean.TRUE.toString(), null, dsl), false, RemovedJobAction.DELETE));
// When
QueueTaskFuture<FreeStyleBuild> scheduleBuild2 = seedJob.scheduleBuild2(0);
// Then
assertBuildStatusSuccess(scheduleBuild2);
}
use of javaposse.jobdsl.plugin.ExecuteDslScripts in project promoted-builds-plugin by jenkinsci.
the class PromotionsDslContextExtensionTest method testShouldGenerateTheDefindedJob.
@Test
public void testShouldGenerateTheDefindedJob() throws Exception {
// Given
String dsl = FileUtils.readFileToString(new File("src/test/resources/example-dsl.groovy"));
FreeStyleProject seedJob = createFreeStyleProject();
seedJob.getBuildersList().add(new ExecuteDslScripts(new ExecuteDslScripts.ScriptLocation(Boolean.TRUE.toString(), null, dsl), false, RemovedJobAction.DELETE));
// When
QueueTaskFuture<FreeStyleBuild> scheduleBuild2 = seedJob.scheduleBuild2(0);
// Then
assertBuildStatusSuccess(scheduleBuild2);
}
use of javaposse.jobdsl.plugin.ExecuteDslScripts in project promoted-builds-plugin by jenkinsci.
the class PromotionsDslContextExtensionTest method testShouldGenerateTheCopyArtifactsJob.
@Test
public void testShouldGenerateTheCopyArtifactsJob() throws Exception {
// Given
String dsl = FileUtils.readFileToString(new File("src/test/resources/copyartifacts-example-dsl.groovy"));
FreeStyleProject seedJob = createFreeStyleProject();
seedJob.getBuildersList().add(new ExecuteDslScripts(new ExecuteDslScripts.ScriptLocation(Boolean.TRUE.toString(), null, dsl), false, RemovedJobAction.DELETE));
// When
QueueTaskFuture<FreeStyleBuild> scheduleBuild2 = seedJob.scheduleBuild2(0);
// Then (unstable b/c we aren't including the CopyArtifacts dependency)
assertBuildStatus(Result.UNSTABLE, scheduleBuild2.get());
TopLevelItem item = jenkins.getItem("copy-artifacts-test");
File config = new File(item.getRootDir(), "promotions/Development/config.xml");
String content = Files.toString(config, Charset.forName("UTF-8"));
assert content.contains("<selector class=\"hudson.plugins.copyartifact.SpecificBuildSelector\">");
}
Aggregations