本文整理匯總了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);
}