Skip to content

Commit b474666

Browse files
authored
Merge pull request #73 from dwnusbaum/fix-grape-test
Make GrapeTest.var work with new versions of jenkins-test-harness
2 parents d6273c0 + c19ad8f commit b474666

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<parent>
2929
<groupId>org.jenkins-ci.plugins</groupId>
3030
<artifactId>plugin</artifactId>
31-
<version>3.43</version>
31+
<version>3.47</version>
3232
<relativePath />
3333
</parent>
3434
<groupId>org.jenkins-ci.plugins.workflow</groupId>

src/test/java/org/jenkinsci/plugins/workflow/cps/global/GrapeTest.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,16 @@ public class GrapeTest {
8181
story.addStep(new Statement() {
8282
@Override public void evaluate() throws Throwable {
8383
FileUtils.write(new File(repo.workspace, "vars/one.groovy"),
84-
"@Grab('org.apache.commons:commons-math3:3.4.1')\n" +
85-
"import org.apache.commons.math3.complex.ComplexField\n" +
86-
"def call() {ComplexField.instance.one}");
84+
"@Grab('commons-primitives:commons-primitives:1.0')\n" +
85+
"import org.apache.commons.collections.primitives.ArrayIntList\n" +
86+
"def call() {\n" +
87+
" def list = new ArrayIntList()\n" +
88+
" list.incrModCount()\n" +
89+
" list.modCount\n" +
90+
"}");
8791
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
88-
p.setDefinition(new CpsFlowDefinition("echo(/${one()} + ${one()} = ${one().add(one())}/)", true));
89-
story.j.assertLogContains("(1.0, 0.0) + (1.0, 0.0) = (2.0, 0.0)", story.j.buildAndAssertSuccess(p));
92+
p.setDefinition(new CpsFlowDefinition("echo(/${one()} + ${one()} = ${one() + one()}/)", true));
93+
story.j.assertLogContains("1 + 1 = 2", story.j.buildAndAssertSuccess(p));
9094
}
9195
});
9296
}

0 commit comments

Comments
 (0)