Package org.jenkinsci.plugins.workflow.support.actions

Examples of org.jenkinsci.plugins.workflow.support.actions.PauseAction


    public boolean start() throws Exception {
        // record this input
        getPauseAction().add(this);

        // This node causes the flow to pause at this point so we mark it as a "Pause Node".
        node.addAction(new PauseAction("Input"));

        String baseUrl = '/' + run.getUrl() + getPauseAction().getUrlName() + '/';
        if (input.getParameters().isEmpty()) {
            String thisUrl = baseUrl + Util.rawEncode(getId()) + '/';
            listener.getLogger().printf("%s%n%s or %s%n", input.getMessage(),
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);

        PauseAction.endCurrentPause(flowNode);
        Assert.assertEquals(false, PauseAction.isPaused(flowNode));
        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);

        PauseAction.endCurrentPause(flowNode);
        Assert.assertEquals(false, PauseAction.isPaused(flowNode));
        long secondPauseDuration = secondPause.getPauseDuration();

        Thread.sleep(200);
        Assert.assertEquals((firstPauseDuration + secondPauseDuration), PauseAction.getPauseDuration(flowNode));
    }
View Full Code Here

TOP

Related Classes of org.jenkinsci.plugins.workflow.support.actions.PauseAction

Copyright © 2018 www.massapicom. 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.