Search in sources :

Example 6 with FlowEndNode

use of org.jenkinsci.plugins.workflow.graph.FlowEndNode in project workflow-cps-plugin by jenkinsci.

the class PersistenceProblemsTest method assertCleanInProgress.

static void assertCleanInProgress(WorkflowRun run) throws Exception {
    Assert.assertTrue(run.isBuilding());
    Assert.assertNull(run.getResult());
    FlowExecution fe = run.getExecution();
    AtomicBoolean hasExecutionInList = new AtomicBoolean(false);
    FlowExecutionList.get().forEach(f -> {
        if (fe != null && f == fe) {
            hasExecutionInList.set(true);
        }
    });
    if (!hasExecutionInList.get()) {
        Assert.fail("Build completed but should still show in FlowExecutionList");
    }
    CpsFlowExecution cpsExec = (CpsFlowExecution) fe;
    Assert.assertFalse(cpsExec.isComplete());
    Assert.assertEquals(Boolean.FALSE, cpsExec.done);
    Assert.assertFalse(cpsExec.getCurrentHeads().get(0) instanceof FlowEndNode);
    Assert.assertTrue(cpsExec.startNodes != null && !cpsExec.startNodes.isEmpty());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) FlowExecution(org.jenkinsci.plugins.workflow.flow.FlowExecution) FlowEndNode(org.jenkinsci.plugins.workflow.graph.FlowEndNode)

Aggregations

FlowEndNode (org.jenkinsci.plugins.workflow.graph.FlowEndNode)6 FlowExecution (org.jenkinsci.plugins.workflow.flow.FlowExecution)4 FlowNode (org.jenkinsci.plugins.workflow.graph.FlowNode)3 AbortException (hudson.AbortException)2 IOException (java.io.IOException)2 InterruptedIOException (java.io.InterruptedIOException)2 ExecutionException (java.util.concurrent.ExecutionException)2 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)2 TimeoutException (java.util.concurrent.TimeoutException)2 UsernameNotFoundException (org.acegisecurity.userdetails.UsernameNotFoundException)2 ErrorAction (org.jenkinsci.plugins.workflow.actions.ErrorAction)2 FlowInterruptedException (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException)2 Queue (hudson.model.Queue)1 Result (hudson.model.Result)1 Run (hudson.model.Run)1 Date (java.util.Date)1 Map (java.util.Map)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 GuardedBy (net.jcip.annotations.GuardedBy)1 CpsFlowExecution (org.jenkinsci.plugins.workflow.cps.CpsFlowExecution)1