当前位置: 首页>>代码示例>>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;未经允许,请勿转载。