本文整理匯總了Java中hudson.model.Result.isBetterOrEqualTo方法的典型用法代碼示例。如果您正苦於以下問題:Java Result.isBetterOrEqualTo方法的具體用法?Java Result.isBetterOrEqualTo怎麽用?Java Result.isBetterOrEqualTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hudson.model.Result
的用法示例。
在下文中一共展示了Result.isBetterOrEqualTo方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRunStatus
import hudson.model.Result; //導入方法依賴的package包/類
private String getRunStatus(AbstractBuild<?, ?> theBuild) {
Result result = theBuild.getResult();
if (result != null) {
if (result.isBetterOrEqualTo(Result.SUCCESS)) {
return "PASSED";
} else if (result.isBetterOrEqualTo(Result.UNSTABLE)) {
return "WARNING";
} else if (result.equals(Result.ABORTED)) {
return "INTERRUPTED";
} else {
return "FAILED";
}
} else {
return "FAILED";
}
}
示例2: getResult
import hudson.model.Result; //導入方法依賴的package包/類
private Result getResult(View view) {
Result ret = Result.SUCCESS;
for (TopLevelItem item : view.getAllItems()) {
for (Job<?,?> job : item.getAllJobs()) {
Run<?, ?> build = job.getLastCompletedBuild();
if(build != null) {
Result result = build.getResult();
if(result.isBetterOrEqualTo(Result.FAILURE))
ret = ret.combine(result);
}
}
}
return ret;
}
示例3: getCommitState
import hudson.model.Result; //導入方法依賴的package包/類
public static GHCommitState getCommitState(final Run<?, ?> run, final GHCommitState unstableAs) {
GHCommitState state;
Result result = run.getResult();
if (isNull(result)) {
LOG.error("{} result is null.", run);
state = GHCommitState.ERROR;
} else if (result.isBetterOrEqualTo(SUCCESS)) {
state = GHCommitState.SUCCESS;
} else if (result.isBetterOrEqualTo(UNSTABLE)) {
state = unstableAs;
} else {
state = GHCommitState.FAILURE;
}
return state;
}
示例4: isSuccess
import hudson.model.Result; //導入方法依賴的package包/類
/**
* Is the build a success?
*
* @return true if the build is a success
*/
public boolean isSuccess() {
Result result = getResult();
return result != null && result.isBetterOrEqualTo(Result.SUCCESS);
}
示例5: isUnstable
import hudson.model.Result; //導入方法依賴的package包/類
/**
* Is the build unstable?
*
* @return true if the build is unstable
*/
public boolean isUnstable() {
Result result = getResult();
return result != null && result.isBetterOrEqualTo(Result.UNSTABLE) && result.isWorseThan(Result.SUCCESS);
}