當前位置: 首頁>>代碼示例>>Java>>正文


Java ErrorAction類代碼示例

本文整理匯總了Java中org.jenkinsci.plugins.workflow.actions.ErrorAction的典型用法代碼示例。如果您正苦於以下問題:Java ErrorAction類的具體用法?Java ErrorAction怎麽用?Java ErrorAction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ErrorAction類屬於org.jenkinsci.plugins.workflow.actions包,在下文中一共展示了ErrorAction類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onNewHead

import org.jenkinsci.plugins.workflow.actions.ErrorAction; //導入依賴的package包/類
@Override
public void onNewHead(FlowNode node) {
    if (isNamedStageStartNode(node)) {
        publishBuildStatus(build, metadata, running, getRunningContexts().push(node), "");
    } else if (isStageEndNode(node, getRunningContexts().peekNodeId())) {
        ErrorAction error = node.getError();
        if (error != null) {
            if (error.getError() instanceof FlowInterruptedException) {
                publishBuildStatus(build, metadata, canceled, getRunningContexts().pop(), "");
            } else {
                publishBuildStatus(build, metadata, failed, getRunningContexts().pop(), "");
            }
        } else {
            publishBuildStatus(build, metadata, success, getRunningContexts().pop(), "");
        }
    }
}
 
開發者ID:Argelbargel,項目名稱:gitlab-branch-source-plugin,代碼行數:18,代碼來源:GitLabSCMPublishAction.java

示例2: killingParallel

import org.jenkinsci.plugins.workflow.actions.ErrorAction; //導入依賴的package包/類
@Test
public void killingParallel() throws Exception {
    story.addStep(new Statement() {
        @Override
        public void evaluate() throws Throwable {
            WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
            p.setDefinition(new CpsFlowDefinition(""
                    + "node {\n"
                    + "  timeout(time:5, unit:'SECONDS') {\n"
                    + "    parallel(\n"
                    + "      a: { echo 'ShouldBeHere1'; sleep 10; echo 'NotHere' },\n"
                    + "      b: { echo 'ShouldBeHere2'; sleep 10; echo 'NotHere' },\n"
                    + "    );\n"
                    + "    echo 'NotHere'\n"
                    + "  }\n"
                    + "  echo 'NotHere'\n"
                    + "}\n", true));
            WorkflowRun b = story.j.assertBuildStatus(Result.ABORTED, p.scheduleBuild2(0).get());

            // make sure things that are supposed to run do, and things that are NOT supposed to run do not.
            story.j.assertLogNotContains("NotHere", b);
            story.j.assertLogContains("ShouldBeHere1", b);
            story.j.assertLogContains("ShouldBeHere2", b);

            // we expect every sleep step to have failed
            FlowGraphTable t = new FlowGraphTable(b.getExecution());
            t.build();
            for (Row r : t.getRows()) {
                if (r.getNode() instanceof StepAtomNode) {
                    StepAtomNode a = (StepAtomNode) r.getNode();
                    if (a.getDescriptor().getClass() == SleepStep.DescriptorImpl.class) {
                        assertTrue(a.getAction(ErrorAction.class) != null);
                    }
                }
            }
        }
    });
}
 
開發者ID:10000TB,項目名稱:Jenkins-Plugin-Examples,代碼行數:39,代碼來源:TimeoutStepTest.java

示例3: createErrorDTO

import org.jenkinsci.plugins.workflow.actions.ErrorAction; //導入依賴的package包/類
public static ErrorDTO createErrorDTO(ErrorAction error) {
    if (error != null) {
        Throwable throwable = error.getError();
        if (throwable != null) {
            return new ErrorDTO(throwable.getMessage(), throwable.getClass().getName());
        }
    }
    return null;
}
 
開發者ID:fabric8io,項目名稱:fabric8-jenkins-workflow-steps,代碼行數:10,代碼來源:ErrorDTO.java


注:本文中的org.jenkinsci.plugins.workflow.actions.ErrorAction類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。