当前位置: 首页>>代码示例>>Java>>正文


Java Result.FAILURE属性代码示例

本文整理汇总了Java中hudson.model.Result.FAILURE属性的典型用法代码示例。如果您正苦于以下问题:Java Result.FAILURE属性的具体用法?Java Result.FAILURE怎么用?Java Result.FAILURE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在hudson.model.Result的用法示例。


在下文中一共展示了Result.FAILURE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onFailure

@Override public void onFailure(StepContext context, Throwable t) {
    try {
        TaskListener listener = context.get(TaskListener.class);
        Result r = Result.FAILURE;
        if (t instanceof AbortException) {
            listener.error(t.getMessage());
        } else if (t instanceof FlowInterruptedException) {
            FlowInterruptedException fie = (FlowInterruptedException) t;
            fie.handle(context.get(Run.class), listener);
            r = fie.getResult();
        } else {
            listener.getLogger().println(Functions.printThrowable(t).trim()); // TODO 2.43+ use Functions.printStackTrace
        }
        context.get(Run.class).setResult(r);
        context.onSuccess(null);
    } catch (Exception x) {
        context.onFailure(x);
    }
}
 
开发者ID:10000TB,项目名称:Jenkins-Plugin-Examples,代码行数:19,代码来源:CatchErrorStep.java

示例2: processBuildResult

void processBuildResult(boolean commentOnSuccess, boolean commentWithConsoleLinkOnFailure, boolean runHarbormaster) {
    if (result == Result.SUCCESS) {
        if (comment.length() == 0 && (commentOnSuccess || !runHarbormaster)) {
            comment.append("Build is green");
        }
    } else if (result == Result.UNSTABLE) {
        comment.append("Build is unstable");
    } else if (result == Result.FAILURE) {
        if (!runHarbormaster || commentWithConsoleLinkOnFailure) {
            comment.append("Build has FAILED");
        }
    } else if (result == Result.ABORTED) {
        comment.append("Build was aborted");
    } else {
        logger.info(UBERALLS_TAG, "Unknown build status " + result.toString());
    }
}
 
开发者ID:uber,项目名称:phabricator-jenkins-plugin,代码行数:17,代码来源:CommentBuilder.java

示例3: perform

@Override
public boolean perform(AbstractBuild build, Launcher launcher, final BuildListener listener) throws InterruptedException, IOException {

	if (build.getResult() != null && build.getResult() == Result.FAILURE) {
		return false;
	}
	listener.getLogger().println("TestFairy Advanced Uploader (Android)... v " + Utils.getVersion(getClass()) + ", run on " + getHostName());
	try {
		EnvVars vars = build.getEnvironment(listener);
		String changeLog = Utils.extractChangeLog(vars, build.getChangeSet(), listener.getLogger());
		AndroidBuildEnvironment environment = getDescriptor().getEnvironment(launcher);

		try {
			launcher.getChannel().call(new AndroidRemoteRecorder(listener, this, vars, environment, changeLog));

		} catch (Throwable ue) {
			throw new TestFairyException(ue.getMessage(), ue);
		}
		return true;

	} catch (TestFairyException e) {
		listener.error(e.getMessage() + "\n");
		e.printStackTrace(listener.getLogger());
		return false;
	}
}
 
开发者ID:testfairy,项目名称:testfairy-jenkins-plugin,代码行数:26,代码来源:TestFairyAndroidRecorder.java

示例4: perform

@Override
public boolean perform(AbstractBuild build, Launcher launcher, final BuildListener listener) throws IOException, InterruptedException {

	if (build.getResult() != null && build.getResult() == Result.FAILURE) {
		return false;
	}
	listener.getLogger().println("TestFairy iOS/Android Uploader... v " + Utils.getVersion(getClass()) + ", run on " + getHostName());
	try {
		EnvVars vars = build.getEnvironment(listener);
		String changeLog = Utils.extractChangeLog(vars, build.getChangeSet(), listener.getLogger());

		try {
			launcher.getChannel().call(new IosRemoteRecorder(listener, this, vars, changeLog));

		} catch (Throwable ue) {
			throw new TestFairyException(ue.getMessage(), ue);
		}
		return true;

	} catch (TestFairyException e) {
		listener.error(e.getMessage() + "\n");
		e.printStackTrace(listener.getLogger());
		return false;
	}
}
 
开发者ID:testfairy,项目名称:testfairy-jenkins-plugin,代码行数:25,代码来源:TestFairyIosRecorder.java

示例5: getTitle

public static String getTitle(Result result, String jobName) {
  String base = "[" + jobName + "] ";
  if (result == Result.SUCCESS) {
    return base + "Successfully built";
  } else if (result == Result.FAILURE) {
    return base + "Failed to build";
  }
  return "The build completed with some errors, but it wasn't marked as failed";
}
 
开发者ID:xmartlabs,项目名称:BuildSlackNotifier,代码行数:9,代码来源:ResultHelper.java

示例6: toAttachmentType

public static AttachmentType toAttachmentType(Result result) {
  if (result == Result.SUCCESS) {
    return AttachmentType.GOOD;
  } else if (result == Result.FAILURE) {
    return AttachmentType.DANGER;
  }
  return AttachmentType.WARNING;
}
 
开发者ID:xmartlabs,项目名称:BuildSlackNotifier,代码行数:8,代码来源:ResultHelper.java

示例7: completed

public void completed(AbstractBuild r) {
    AbstractProject<?, ?> project = r.getProject();
    if(project == null) return;
    Result result = r.getResult();
    AbstractBuild<?, ?> previousBuild = project.getLastBuild();
    if(previousBuild == null) return;
    do {
        previousBuild = previousBuild.getPreviousCompletedBuild();
    } while (previousBuild != null && previousBuild.getResult() == Result.ABORTED);
    Result previousResult = (previousBuild != null) ? previousBuild.getResult() : Result.SUCCESS;
    if ((result == Result.ABORTED && notifier.getNotifyAborted())
            || (result == Result.FAILURE //notify only on single failed build
                && previousResult != Result.FAILURE
                && notifier.getNotifyFailure())
            || (result == Result.FAILURE //notify only on repeated failures
                && previousResult == Result.FAILURE
                && notifier.getNotifyRepeatedFailure())
            || (result == Result.NOT_BUILT && notifier.getNotifyNotBuilt())
            || (result == Result.SUCCESS
                && (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
                && notifier.getNotifyBackToNormal())
            || (result == Result.SUCCESS && notifier.getNotifySuccess())
            || (result == Result.UNSTABLE && notifier.getNotifyUnstable())) {
        getTelegram(r).publish(getBuildStatusMessage(r, notifier.includeTestSummary(),
                notifier.getIncludeFailedTests(),notifier.includeCustomMessage()), getBuildColor(r));

    }
}
 
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:28,代码来源:ActiveNotifier.java

示例8: getBuildColor

static String getBuildColor(AbstractBuild r) {
    Result result = r.getResult();
    if (result == Result.SUCCESS) {
        return "good";
    } else if (result == Result.FAILURE) {
        return "danger";
    } else {
        return "warning";
    }
}
 
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:10,代码来源:ActiveNotifier.java

示例9: toJenkinsResult

public static Result toJenkinsResult(Object shellResult) {
    if (shellResult instanceof String && !shellResult.equals("")) {
        return Result.FAILURE;
    } else if (shellResult instanceof Boolean) {
        return (Boolean) shellResult ? Result.SUCCESS : Result.FAILURE;
    } else {
        return Result.SUCCESS;
    }
}
 
开发者ID:jenkinsci,项目名称:ontrack-plugin,代码行数:9,代码来源:OntrackDSLResult.java

示例10: postCheckout

@Override
public void postCheckout(@Nonnull Run<?, ?> build,
        @Nonnull Launcher launcher, @Nonnull FilePath workspace,
        @Nonnull TaskListener listener) throws IOException,
        InterruptedException {
    if (build.getResult() == Result.FAILURE) {
        EnvVars env = build.getEnvironment(listener);
        String msg = String.format(
                MessageConstants.SCM_IMAGESTREAM_NOT_FOUND,
                getImageStreamName(env), getTag(env));
        throw new AbortException(msg);
    }
}
 
开发者ID:openshift,项目名称:jenkins-plugin,代码行数:13,代码来源:OpenShiftImageStreams.java

示例11: completed

public void completed(AbstractBuild r) {
	AbstractProject<?, ?> project = r.getProject();
	Result result = r.getResult();
	AbstractBuild<?, ?> previousBuild = project.getLastBuild();
	if (previousBuild != null) {
		do {
			previousBuild = previousBuild.getPreviousCompletedBuild();
		} while (previousBuild != null && previousBuild.getResult() == Result.ABORTED);
	}
	Result previousResult = (previousBuild != null) ? previousBuild.getResult() : Result.SUCCESS;
	if ((result == Result.ABORTED && notifier.getNotifyAborted())
			|| (result == Result.FAILURE //notify only on single failed build
			&& previousResult != Result.FAILURE
			&& notifier.getNotifyFailure())
			|| (result == Result.FAILURE //notify only on repeated failures
			&& previousResult == Result.FAILURE
			&& notifier.getNotifyRepeatedFailure())
			|| (result == Result.NOT_BUILT && notifier.getNotifyNotBuilt())
			|| (result == Result.SUCCESS
			&& (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
			&& notifier.getNotifyBackToNormal())
			|| (result == Result.SUCCESS && notifier.getNotifySuccess())
			|| (result == Result.UNSTABLE && notifier.getNotifyUnstable())) {
		String expandedCustomMessage = getExpandedCustomMessage(r);
		getMattermost(r).publish(getBuildStatusMessage(r, notifier.includeTestSummary(),
				notifier.includeCustomAttachmentMessage()), expandedCustomMessage, getBuildColor(r));
		if (notifier.getCommitInfoChoice().showAnything()) {
			getMattermost(r).publish(getCommitList(r), expandedCustomMessage, getBuildColor(r));
		}
	}
}
 
开发者ID:jovandeginste,项目名称:jenkins-mattermost-plugin,代码行数:31,代码来源:ActiveNotifier.java

示例12: getBuildColor

static String getBuildColor(AbstractBuild r) {
	Result result = r.getResult();
	if (result == Result.SUCCESS) {
		return "good";
	} else if (result == Result.FAILURE) {
		return "danger";
	} else {
		return "warning";
	}
}
 
开发者ID:jovandeginste,项目名称:jenkins-mattermost-plugin,代码行数:10,代码来源:ActiveNotifier.java

示例13: newPyJenkinsInterpreter

public static PythonInterpreter newPyJenkinsInterpreter(BuildContext context, BuildConfig config) {
    PythonInterpreter python = newInterpreter();
    python.exec("import pyjenkins");
    PyModule pyjenkins = (PyModule) python.get("pyjenkins");

    context.listener.getLogger().println("Initializing pyjenkins module");
    PyObject ret = pyjenkins.invoke("init", new PyObject[]{ context, config });
    if (!ret.equals( new PyBoolean(true))) {
        context.listener.fatalError("pyjenkins init did not return true: " + ret);
        throw new BuildResultException(Result.FAILURE);
    }

    return python;
}
 
开发者ID:tanium,项目名称:pyjenkins,代码行数:14,代码来源:PythonFactory.java

示例14: from

public static States from(@Nonnull Result result) {
    if (result == Result.SUCCESS) {
        return success;
    }
    if (result == Result.FAILURE) {
        return error;
    }
    if (result == Result.UNSTABLE) {
        return failure;
    }
    return error;
}
 
开发者ID:jenkinsci,项目名称:dockerhub-notification-plugin,代码行数:12,代码来源:DockerHubCallbackPayload.java

示例15: setup

@Before
public void setup() {
    failure = new RunStub(0, Result.FAILURE, 500L);
    repair = new RunStub(5000L, Result.SUCCESS, 1000L);
}
 
开发者ID:oliveiragabriel07,项目名称:redtime,代码行数:5,代码来源:RedIntervalTest.java


注:本文中的hudson.model.Result.FAILURE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。