本文整理汇总了Java中hudson.model.Result.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Result.toString方法的具体用法?Java Result.toString怎么用?Java Result.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hudson.model.Result
的用法示例。
在下文中一共展示了Result.toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: alternativeResult
import hudson.model.Result; //导入方法依赖的package包/类
public String alternativeResult(Result res){
switch(res.toString()){
case "ABORTED":
return getAbortedRES();
case "FAILURE":
return getFailureRES();
case "NOT_BUILT":
return getNotBuildRES();
case "SUCCESS":
return getSuccessRES();
case "UNSTABLE":
return getUnstableRES();
default:
return "";
}
}
示例2: getResultText
import hudson.model.Result; //导入方法依赖的package包/类
public static String getResultText(Run run) {
if (run != null) {
Result result = run.getResult();
if (result != null) {
return result.toString();
}
}
return null;
}
示例3: listProjects
import hudson.model.Result; //导入方法依赖的package包/类
public SlackTextMessage listProjects() {
ACL.impersonate(ACL.SYSTEM);
String response = "*Projects:*\n";
List<AbstractProject> jobs =
Jenkins.getInstance().getAllItems(AbstractProject.class);
for (AbstractProject job : jobs) {
if (job.isBuildable()) {
AbstractBuild lastBuild = job.getLastBuild();
String buildNumber = "TBD";
String status = "TBD";
if (lastBuild != null) {
buildNumber = Integer.toString(lastBuild.getNumber());
if (lastBuild.isBuilding()) {
status = "BUILDING";
}
Result result = lastBuild.getResult();
if (result != null) {
status = result.toString();
}
}
response += ">*"+job.getDisplayName() + "*\n>*Last Build:* #"+buildNumber+"\n>*Status:* "+status;
response += "\n\n\n";
}
}
if (jobs == null || jobs.size() == 0)
response += ">_No projects found_";
return new SlackTextMessage(response);
}