Package org.jenkinsci.plugins.workflow.graph

Examples of org.jenkinsci.plugins.workflow.graph.FlowNode.addAction()


                            throw new IllegalStateException(node + " is offline");
                        }
                        WorkspaceList.Lease lease = computer.getWorkspaceList().allocate(p);
                        FilePath workspace = lease.path;
                        FlowNode flowNode = context.get(FlowNode.class);
                        flowNode.addAction(new WorkspaceActionImpl(workspace, flowNode));
                        listener.getLogger().println("Running on " + computer.getDisplayName() + " in " + workspace); // TODO hyperlink
                        context.invokeBodyLater(exec, computer, env, workspace).addCallback(new Callback(cookie, lease));
                        LOGGER.log(Level.FINE, "started {0}", cookie);
                    } else {
                        // just rescheduled after a restart; wait for task to complete
View Full Code Here


        // run till the end successfully FIXME: failure comes here, too
        // TODO: if program terminates with exception, we need to record it
        // TODO: in the error case, we have to close all the open nodes
        FlowNode head = new FlowEndNode(this, iotaStr(), (FlowStartNode)startNodes.pop(), result, getCurrentHeads().toArray(new FlowNode[0]));
        if (outcome.isFailure())
            head.addAction(new ErrorAction(outcome.getAbnormal()));

        // shrink everything into a single new head
        done = true;
        FlowHead first = getFirstHead();
        first.setNewHead(head);
View Full Code Here

        };

        Assert.assertEquals(false, PauseAction.isPaused(flowNode));
        Assert.assertEquals(0L, PauseAction.getPauseDuration(flowNode));

        flowNode.addAction(new PauseAction("P1"));
        PauseAction firstPause = PauseAction.getCurrentPause(flowNode);
        Assert.assertEquals("P1", firstPause.getCause());
        Assert.assertEquals(true, PauseAction.isPaused(flowNode));
        Thread.sleep(200);
        Assert.assertTrue(PauseAction.getPauseDuration(flowNode) > 100L);
View Full Code Here

        long firstPauseDuration = firstPause.getPauseDuration();

        Thread.sleep(200);
        Assert.assertEquals(firstPauseDuration, PauseAction.getPauseDuration(flowNode));

        flowNode.addAction(new PauseAction("P2"));
        PauseAction secondPause = PauseAction.getCurrentPause(flowNode);
        Assert.assertEquals("P2", secondPause.getCause());
        Assert.assertEquals(true, PauseAction.isPaused(flowNode));
        Thread.sleep(200);
        Assert.assertTrue(PauseAction.getPauseDuration(flowNode) > firstPauseDuration);
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.