forked from jenkinsci/gerrit-trigger-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move build status votes in VerdictCategory
- moved build status votes fields to VerdictCategory instead of having them as private fields in Config/GerritTrigger & mark their getters/setters deprecated - remove the entries for the removed status votes from jelly gerrit-trigger config & add them in VerdictCategory list instead (all the votes are set within VerdictCategory) - votes are now part of the VerdictCategory list (categories) so all deprecated methods are now searching through the list instead
- Loading branch information
Showing
20 changed files
with
990 additions
and
648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/config/BuildStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.sonyericsson.hudson.plugins.gerrit.trigger.config; | ||
|
||
import hudson.model.Result; | ||
|
||
public enum BuildStatus { | ||
STARTED, | ||
SUCCESSFUL, | ||
FAILED, | ||
UNSTABLE, | ||
NOT_BUILT, | ||
ABORTED, | ||
NOT_REGISTERED; | ||
|
||
public static BuildStatus fromResult(Result result) { | ||
if (result == Result.SUCCESS) | ||
return BuildStatus.SUCCESSFUL; | ||
if (result == Result.FAILURE) | ||
return BuildStatus.FAILED; | ||
if (result == Result.UNSTABLE) | ||
return BuildStatus.UNSTABLE; | ||
if (result == Result.NOT_BUILT) | ||
return BuildStatus.NOT_BUILT; | ||
if (result == Result.ABORTED) | ||
return BuildStatus.ABORTED; | ||
|
||
return BuildStatus.FAILED; | ||
} | ||
} |
Oops, something went wrong.