Search in sources :

Example 6 with StepExecution

use of org.jenkinsci.plugins.workflow.steps.StepExecution in project workflow-cps-plugin by jenkinsci.

the class CpsFlowExecutionTest method stepNames.

private static List<String> stepNames(ListenableFuture<List<StepExecution>> executionsFuture) throws Exception {
    List<String> r = new ArrayList<String>();
    for (StepExecution e : executionsFuture.get()) {
        // TODO should this method be defined in StepContext?
        StepDescriptor d = ((CpsStepContext) e.getContext()).getStepDescriptor();
        assertNotNull(d);
        r.add(d.getFunctionName());
    }
    return r;
}
Also used : ArrayList(java.util.ArrayList) StepDescriptor(org.jenkinsci.plugins.workflow.steps.StepDescriptor) StepExecution(org.jenkinsci.plugins.workflow.steps.StepExecution)

Aggregations

StepExecution (org.jenkinsci.plugins.workflow.steps.StepExecution)6 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 FlowNode (org.jenkinsci.plugins.workflow.graph.FlowNode)3 ExecutionException (java.util.concurrent.ExecutionException)2 StepEndNode (org.jenkinsci.plugins.workflow.cps.nodes.StepEndNode)2 StepStartNode (org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode)2 FlowInterruptedException (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException)2 Test (org.junit.Test)2 Function (com.google.common.base.Function)1 ImmutableList (com.google.common.collect.ImmutableList)1 GroovyRuntimeException (groovy.lang.GroovyRuntimeException)1 EnvVars (hudson.EnvVars)1 Computer (hudson.model.Computer)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 TimeoutException (java.util.concurrent.TimeoutException)1