|
27 | 27 | import hudson.tools.ToolProperty;
|
28 | 28 | import java.util.Collections;
|
29 | 29 | import org.jenkinsci.plugins.docker.commons.tools.DockerTool;
|
30 |
| -import org.jenkinsci.plugins.workflow.BuildWatcher; |
31 |
| -import org.jenkinsci.plugins.workflow.JenkinsRuleExt; |
32 | 30 | import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
|
33 | 31 | import org.jenkinsci.plugins.workflow.job.WorkflowJob;
|
34 | 32 | import org.jenkinsci.plugins.workflow.job.WorkflowRun;
|
|
37 | 35 | import org.junit.ClassRule;
|
38 | 36 | import org.junit.Test;
|
39 | 37 | import org.junit.Rule;
|
| 38 | +import org.junit.rules.TemporaryFolder; |
40 | 39 | import org.junit.runners.model.Statement;
|
| 40 | +import org.jvnet.hudson.test.BuildWatcher; |
41 | 41 | import org.jvnet.hudson.test.RestartableJenkinsRule;
|
42 | 42 |
|
43 | 43 | public class WithContainerStepTest {
|
44 | 44 |
|
45 | 45 | @ClassRule public static BuildWatcher buildWatcher = new BuildWatcher();
|
46 | 46 | @Rule public RestartableJenkinsRule story = new RestartableJenkinsRule();
|
| 47 | + @Rule public TemporaryFolder tmp = new TemporaryFolder(); |
47 | 48 |
|
48 | 49 | @Test public void configRoundTrip() {
|
49 | 50 | story.addStep(new Statement() {
|
@@ -88,9 +89,9 @@ public class WithContainerStepTest {
|
88 | 89 | " }\n" +
|
89 | 90 | "}", true));
|
90 | 91 | WorkflowRun b = p.scheduleBuild2(0).waitForStart();
|
91 |
| - JenkinsRuleExt.waitForMessage("sleeping now", b); |
| 92 | + story.j.waitForMessage("sleeping now", b); |
92 | 93 | b.doStop();
|
93 |
| - story.j.assertBuildStatus(Result.ABORTED, JenkinsRuleExt.waitForCompletion(b)); |
| 94 | + story.j.assertBuildStatus(Result.ABORTED, story.j.waitForCompletion(b)); |
94 | 95 | story.j.assertLogContains("script returned exit code 99", b);
|
95 | 96 | }
|
96 | 97 | });
|
@@ -134,7 +135,7 @@ public class WithContainerStepTest {
|
134 | 135 | SemaphoreStep.success("wait/1", null);
|
135 | 136 | WorkflowJob p = story.j.jenkins.getItemByFullName("prj", WorkflowJob.class);
|
136 | 137 | WorkflowRun b = p.getLastBuild();
|
137 |
| - story.j.assertLogContains("Require method GET POST OPTIONS", story.j.assertBuildStatusSuccess(JenkinsRuleExt.waitForCompletion(b))); |
| 138 | + story.j.assertLogContains("Require method GET POST OPTIONS", story.j.assertBuildStatusSuccess(story.j.waitForCompletion(b))); |
138 | 139 | }
|
139 | 140 | });
|
140 | 141 | }
|
|
0 commit comments