Examples of waitForSuspension()


Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

        QueueTaskFuture<WorkflowRun> q = foo.scheduleBuild2(0);
        WorkflowRun b = q.getStartCondition().get();
        CpsFlowExecution e = (CpsFlowExecution) b.getExecutionPromise().get();

        while (b.getAction(InputAction.class)==null) {
            e.waitForSuspension();
        }

        // make sure we are pausing at the right state that reflects what we wrote in the program
        InputAction a = b.getAction(InputAction.class);
        assertEquals(1, a.getExecutions().size());
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                        "echo('in B');\n" +
                        "semaphore('X');\n" +
                        "echo('done')"));
                WorkflowRun b1 = p.scheduleBuild2(0).waitForStart();
                CpsFlowExecution e1 = (CpsFlowExecution) b1.getExecutionPromise().get();
                e1.waitForSuspension();
                assertTrue(JenkinsRule.getLog(b1), b1.isBuilding());
                WorkflowRun b2 = p.scheduleBuild2(0).waitForStart();
                CpsFlowExecution e2 = (CpsFlowExecution) b2.getExecutionPromise().get();
                e2.waitForSuspension();
                assertTrue(b2.isBuilding());
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                CpsFlowExecution e1 = (CpsFlowExecution) b1.getExecutionPromise().get();
                e1.waitForSuspension();
                assertTrue(JenkinsRule.getLog(b1), b1.isBuilding());
                WorkflowRun b2 = p.scheduleBuild2(0).waitForStart();
                CpsFlowExecution e2 = (CpsFlowExecution) b2.getExecutionPromise().get();
                e2.waitForSuspension();
                assertTrue(b2.isBuilding());
                WorkflowRun b3 = p.scheduleBuild2(0).waitForStart();
                CpsFlowExecution e3 = (CpsFlowExecution) b3.getExecutionPromise().get();
                e3.waitForSuspension();
                assertTrue(b3.isBuilding());
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                CpsFlowExecution e2 = (CpsFlowExecution) b2.getExecutionPromise().get();
                e2.waitForSuspension();
                assertTrue(b2.isBuilding());
                WorkflowRun b3 = p.scheduleBuild2(0).waitForStart();
                CpsFlowExecution e3 = (CpsFlowExecution) b3.getExecutionPromise().get();
                e3.waitForSuspension();
                assertTrue(b3.isBuilding());
                try {
                    story.j.assertLogContains("in A", b1);
                    story.j.assertLogNotContains("in B", b1);
                    story.j.assertLogContains("in A", b2);
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                    SemaphoreStep.success("B/1", null);
                    e1.waitForSuspension();
                    assertTrue(b1.isBuilding());
                    e2.waitForSuspension();
                    assertTrue(b2.isBuilding());
                    e3.waitForSuspension();
                    assertTrue(b3.isBuilding());
                    story.j.assertLogContains("in B", b1);
                    story.j.assertLogNotContains("done", b1);
                    story.j.assertLogNotContains("in B", b2);
                    story.j.assertLogContains("in A", b3);
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                    SemaphoreStep.success("B/2", null);
                    e1.waitForSuspension();
                    assertTrue(b1.isBuilding());
                    e2.waitForSuspension();
                    assertTrue(b2.isBuilding());
                    e3.waitForSuspension();
                    assertTrue(b3.isBuilding());
                    story.j.assertLogNotContains("done", b1);
                    story.j.assertLogNotContains("in B", b2);
                    story.j.assertLogNotContains("in B", b3);
                    SemaphoreStep.success("B/3", null);
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                    story.j.assertLogNotContains("in B", b3);
                    SemaphoreStep.success("B/3", null);
                    e1.waitForSuspension();
                    assertTrue(b1.isBuilding());
                    e2.waitForSuspension();
                    e3.waitForSuspension();
                    Thread.sleep(1000); // TODO why is this necessary?
                    assertFalse(b2.isBuilding());
                    assertEquals(Result.NOT_BUILT, b2.getResult());
                    InterruptedBuildAction iba = b2.getAction(InterruptedBuildAction.class);
                    assertNotNull(iba);
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                WorkflowRun b3 = p.getBuildByNumber(3);
                try {
                    assertTrue(b1.isBuilding());
                    story.j.assertLogNotContains("done", b1);
                    CpsFlowExecution e1 = (CpsFlowExecution) b1.getExecutionPromise().get();
                    e1.waitForSuspension();
                    assertTrue(b3.isBuilding());
                    story.j.assertLogNotContains("in B", b3);
                    CpsFlowExecution e3 = (CpsFlowExecution) b3.getExecutionPromise().get();
                    e3.waitForSuspension();
                    SemaphoreStep.success("X/1", null);
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                    CpsFlowExecution e1 = (CpsFlowExecution) b1.getExecutionPromise().get();
                    e1.waitForSuspension();
                    assertTrue(b3.isBuilding());
                    story.j.assertLogNotContains("in B", b3);
                    CpsFlowExecution e3 = (CpsFlowExecution) b3.getExecutionPromise().get();
                    e3.waitForSuspension();
                    SemaphoreStep.success("X/1", null);
                    e1.waitForSuspension();
                    assertFalse(b1.isBuilding());
                    assertEquals(Result.SUCCESS, b1.getResult());
                    e3.waitForSuspension();
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension()

                    e3.waitForSuspension();
                    SemaphoreStep.success("X/1", null);
                    e1.waitForSuspension();
                    assertFalse(b1.isBuilding());
                    assertEquals(Result.SUCCESS, b1.getResult());
                    e3.waitForSuspension();
                    assertTrue(b3.isBuilding());
                    story.j.assertLogContains("done", b1);
                    story.j.assertLogContains("in B", b3);
                    story.j.assertLogNotContains("done", b3);
                    SemaphoreStep.success("X/2", null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.