|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.analysis.core.BuildResult
@ExportedBean public abstract class BuildResult
A base class for build results that is capable of storing a reference to the current build. Provides support for persisting the results of the build and loading and saving of annotations (all, new, and fixed) and delta computation.
| Field Summary | |
|---|---|
protected String |
high
Deprecated. |
protected String |
low
Deprecated. |
protected String |
normal
Deprecated. |
| Constructor Summary | |
|---|---|
protected |
BuildResult(hudson.model.AbstractBuild<?,?> build,
BuildHistory history,
ParserResult result,
String defaultEncoding)
Creates a new instance of BuildResult. |
|
BuildResult(hudson.model.AbstractBuild<?,?> build,
String defaultEncoding,
ParserResult result)
Deprecated. use BuildResult(AbstractBuild, BuildHistory, ParserResult, String)
The new constructor will not save the annotations anymore.
you need to save them manually |
|
BuildResult(hudson.model.AbstractBuild<?,?> build,
String defaultEncoding,
ParserResult result,
BuildHistory history)
Deprecated. use BuildResult(AbstractBuild, BuildHistory, ParserResult, String)
The new constructor will not save the annotations anymore.
you need to save them manually |
| Method Summary | |
|---|---|
boolean |
canUseDeltaValues()
Returns the whether delta values should be used to compute the new warnings. |
protected void |
configure(com.thoughtworks.xstream.XStream xstream)
Configures the XStream. |
protected static String |
createDefaultDeltaMessage(String url,
int newWarnings,
int fixedWarnings)
Creates a default delta message for the build result. |
protected static String |
createDefaultSummary(String url,
int warnings,
int modules)
Creates a default summary message for the build result. |
protected String |
createDeltaMessage()
Returns the build summary HTML delta message. |
protected BuildHistory |
createHistory(hudson.model.AbstractBuild<?,?> build)
Creates a new history based on the specified build. |
protected static String |
createUrl(String url)
Creates an HTML URL reference start tag. |
void |
evaluateStatus(Thresholds thresholds,
boolean useDeltaValues,
boolean canComputeNew,
PluginLogger logger,
String url)
Updates the build status, i.e. |
void |
evaluateStatus(Thresholds thresholds,
boolean useDeltaValues,
PluginLogger logger,
String url)
Updates the build status, i.e. |
FileAnnotation |
getAnnotation(long key)
Returns the annotation with the specified key. |
FileAnnotation |
getAnnotation(String key)
Returns the annotation with the specified key. |
Set<FileAnnotation> |
getAnnotations()
Returns the annotations for this object. |
Set<FileAnnotation> |
getAnnotations(Priority priority)
Returns the annotations of the specified priority for this object. |
Set<FileAnnotation> |
getAnnotations(String priority)
Returns the annotations of the specified priority for this object. |
hudson.model.Api |
getApi()
Gets the remote API for this build result. |
AnnotationContainer |
getContainer()
Gets the annotation container. |
hudson.XmlFile |
getDataFile()
Returns the serialization file. |
static long |
getDays(long ms)
Returns the number of days for the specified number of milliseconds. |
String |
getDefaultEncoding()
Returns the defined default encoding. |
int |
getDelta()
Returns the delta. |
String |
getDetails()
Returns the detail messages for the summary.jelly file. |
Object |
getDynamic(String link,
org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
Returns the dynamic result of the selection element. |
List<String> |
getErrors()
Returns the error messages associated with this build. |
Collection<FileAnnotation> |
getFixedWarnings()
Returns the fixed warnings of this build. |
String |
getHeader()
Returns the header for the build result page. |
int |
getHighDelta()
Returns the high delta. |
long |
getHighScoreGap()
Returns the number of msec still to go before a new highscore is reached. |
BuildHistory |
getHistory()
Returns the build history. |
int |
getLowDelta()
Returns the low delta. |
Collection<String> |
getModules()
Returns the modules of this build result. |
Collection<FileAnnotation> |
getNewWarnings()
Returns the new warnings of this build. |
int |
getNormalDelta()
Returns the normal delta. |
int |
getNumberOfAnnotations()
Gets the number of warnings. |
int |
getNumberOfAnnotations(Priority priority)
Returns the total number of warnings of the specified priority for this object. |
int |
getNumberOfAnnotations(String priority)
Returns the annotations of the specified priority for this object. |
int |
getNumberOfFixedWarnings()
Gets the number of fixed warnings. |
int |
getNumberOfHighPriorityWarnings()
Returns the number of warnings with high priority. |
int |
getNumberOfLowPriorityWarnings()
Returns the number of warnings with low priority. |
int |
getNumberOfModules()
Returns the number of modules in this project. |
int |
getNumberOfNewWarnings()
Gets the number of new warnings. |
int |
getNumberOfNormalPriorityWarnings()
Returns the number of warnings with normal priority. |
int |
getNumberOfWarnings()
Gets the number of warnings. |
hudson.model.AbstractBuild<?,?> |
getOwner()
Returns the build as owner of this action. |
hudson.model.Result |
getPluginResult()
Returns the Result of the plug-in. |
BuildResult |
getPreviousResult()
Returns the previous build result. |
Priority[] |
getPriorities()
Returns all possible priorities. |
JavaProject |
getProject()
Returns the associated project of this result. |
String |
getReason()
Returns the reason for the computed value of the build result. |
protected abstract Class<? extends ResultAction<? extends BuildResult>> |
getResultActionType()
Returns the actual type of the associated result action. |
String |
getResultIcon()
Returns the icon for the build result. |
protected abstract String |
getSerializationFileName()
Returns the name of the file to store the serialized annotations. |
long |
getSuccessfulHighScore()
Returns the maximum period of successful builds. |
long |
getSuccessfulHighScoreGap()
Returns the number of msec still to go before a new highscore is reached. |
int |
getSuccessfulSinceBuild()
Returns the build since we are successful. |
long |
getSuccessfulSinceDate()
Returns the time since we are successful. |
abstract String |
getSummary()
Returns a summary message for the summary.jelly file. |
Thresholds |
getThresholds()
Returns the thresholds used to compute the build health. |
int |
getWarningsDelta()
Returns the delta between two builds. |
long |
getZeroWarningsHighScore()
Returns the maximum period with zero warnings in a build. |
int |
getZeroWarningsSinceBuild()
Returns the build since we have zero warnings. |
long |
getZeroWarningsSinceDate()
Returns the time since we have zero warnings. |
boolean |
hasAnnotations()
Returns whether this objects has annotations. |
boolean |
hasAnnotations(Priority priority)
Returns whether this objects has annotations with the specified priority. |
boolean |
hasAnnotations(String priority)
Returns whether this objects has annotations with the specified priority. |
boolean |
hasError()
Returns whether a module with an error is part of this project. |
boolean |
hasNoAnnotations()
Returns whether this objects has no annotations. |
boolean |
hasNoAnnotations(Priority priority)
Returns whether this objects has no annotations with the specified priority. |
boolean |
hasNoAnnotations(String priority)
Returns whether this objects has no annotations with the specified priority. |
boolean |
hasPreviousResult()
Returns whether there is a previous result available. |
boolean |
isCurrent()
Returns whether this result belongs to the last build. |
boolean |
isNewSuccessfulHighScore()
Returns if the current result reached the old successful highscore. |
boolean |
isNewZeroWarningsHighScore()
Returns if the current result reached the old zero warnings highscore. |
boolean |
isSuccessful()
Returns whether this build is successful with respect to the HealthDescriptor of this result. |
boolean |
isSuccessfulTouched()
Returns whether the successful state has been touched. |
protected Object |
readResolve()
Initializes members that were not present in previous versions of the associated plug-in. |
protected void |
serializeAnnotations(Collection<FileAnnotation> annotations)
Serializes the annotations of the specified project and writes them to the file specified by method getDataFile(). |
protected void |
setHighWarnings(int highWarnings)
Sets the number of high warnings to the specified value. |
protected void |
setLowWarnings(int lowWarnings)
Sets the number of low warnings to the specified value. |
protected void |
setNormalWarnings(int normalWarnings)
Sets the number of normal warnings to the specified value. |
void |
setResult(hudson.model.Result result)
Deprecated. use #evaluateStatus(Thresholds, boolean, PluginLogger) |
protected void |
setWarnings(int warnings)
Sets the number of warnings to the specified value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface hudson.model.ModelObject |
|---|
getDisplayName |
| Field Detail |
|---|
@Deprecated protected transient String low
@Deprecated protected transient String normal
@Deprecated protected transient String high
| Constructor Detail |
|---|
protected BuildResult(hudson.model.AbstractBuild<?,?> build,
BuildHistory history,
ParserResult result,
String defaultEncoding)
BuildResult. Note that the warnings are
not serialized anymore automatically. You need to call
serializeAnnotations(Collection) manually in your constructor to
persist them.
build - the current build as owner of this actionhistory - build historyresult - the parsed result with all annotationsdefaultEncoding - the default encoding to be used when reading and parsing files
@Deprecated
public BuildResult(hudson.model.AbstractBuild<?,?> build,
String defaultEncoding,
ParserResult result,
BuildHistory history)
BuildResult(AbstractBuild, BuildHistory, ParserResult, String)
The new constructor will not save the annotations anymore.
you need to save them manually
BuildResult.
build - the current build as owner of this actiondefaultEncoding - the default encoding to be used when reading and parsing filesresult - the parsed result with all annotationshistory - the history of build results of the associated plug-in
@Deprecated
public BuildResult(hudson.model.AbstractBuild<?,?> build,
String defaultEncoding,
ParserResult result)
BuildResult(AbstractBuild, BuildHistory, ParserResult, String)
The new constructor will not save the annotations anymore.
you need to save them manually
BuildResult.
build - the current build as owner of this actiondefaultEncoding - the default encoding to be used when reading and parsing filesresult - the parsed result with all annotations| Method Detail |
|---|
public static long getDays(long ms)
ms - milliseconds
protected BuildHistory createHistory(hudson.model.AbstractBuild<?,?> build)
build - the build to start with
public BuildHistory getHistory()
public boolean hasError()
true if at least one module has an error.public List<String> getErrors()
protected Object readResolve()
public Collection<String> getModules()
public int getNumberOfModules()
public String getDefaultEncoding()
public Thresholds getThresholds()
public boolean canUseDeltaValues()
true if the absolute annotations delta should be
used, false if the actual annotations set difference
should be used to evaluate the build stability.public final hudson.XmlFile getDataFile()
protected void configure(com.thoughtworks.xstream.XStream xstream)
XStream. This default implementation is empty.
xstream - the stream to configureprotected abstract String getSerializationFileName()
public boolean isCurrent()
true if this result belongs to the last buildpublic hudson.model.AbstractBuild<?,?> getOwner()
public boolean hasAnnotations(Priority priority)
hasAnnotations in interface AnnotationProviderpriority - the priority
true if this objects has annotations.public boolean hasAnnotations(String priority)
hasAnnotations in interface AnnotationProviderpriority - the priority as a string object
true if this objects has annotations.public boolean hasAnnotations()
hasAnnotations in interface AnnotationProvidertrue if this objects has annotations.public boolean hasNoAnnotations()
hasNoAnnotations in interface AnnotationProvidertrue if this objects has no annotations.public boolean hasNoAnnotations(Priority priority)
hasNoAnnotations in interface AnnotationProviderpriority - the priority
true if this objects has no annotations.public boolean hasNoAnnotations(String priority)
hasNoAnnotations in interface AnnotationProviderpriority - the priority as a string object
true if this objects has no annotations.@Exported(name="warnings") public Set<FileAnnotation> getAnnotations()
getAnnotations in interface AnnotationProviderpublic FileAnnotation getAnnotation(long key)
getAnnotation in interface AnnotationProviderkey - the key of the annotation
public FileAnnotation getAnnotation(String key)
getAnnotation in interface AnnotationProviderkey - the key of the annotation as a long value in string representation
protected void setHighWarnings(int highWarnings)
highWarnings - the value to setprotected void setNormalWarnings(int normalWarnings)
normalWarnings - the value to setprotected void setLowWarnings(int lowWarnings)
lowWarnings - the value to setprotected void setWarnings(int warnings)
warnings - the value to setpublic Set<FileAnnotation> getAnnotations(Priority priority)
getAnnotations in interface AnnotationProviderpriority - the priority
protected void serializeAnnotations(Collection<FileAnnotation> annotations)
getDataFile().
annotations - the annotations to store@Exported public int getZeroWarningsSinceBuild()
@Exported public long getZeroWarningsSinceDate()
@Exported public long getZeroWarningsHighScore()
@Exported public boolean isNewZeroWarningsHighScore()
true, if the current result reached the old zero warnings highscore.public long getHighScoreGap()
@Exported public int getSuccessfulSinceBuild()
@Exported public long getSuccessfulSinceDate()
@Exported public long getSuccessfulHighScore()
@Exported public boolean isNewSuccessfulHighScore()
true, if the current result reached the old successful highscore.public long getSuccessfulHighScoreGap()
@Exported public int getNumberOfWarnings()
public int getNumberOfAnnotations()
getNumberOfAnnotations in interface AnnotationProviderpublic int getNumberOfAnnotations(Priority priority)
getNumberOfAnnotations in interface AnnotationProviderpriority - the priority
@Exported public int getNumberOfFixedWarnings()
@Exported public int getNumberOfNewWarnings()
public int getDelta()
public int getHighDelta()
public int getNormalDelta()
public int getLowDelta()
@Exported public int getWarningsDelta()
@Exported public int getNumberOfHighPriorityWarnings()
@Exported public int getNumberOfNormalPriorityWarnings()
@Exported public int getNumberOfLowPriorityWarnings()
public JavaProject getProject()
@Exported public Collection<FileAnnotation> getNewWarnings()
public Collection<FileAnnotation> getFixedWarnings()
protected abstract Class<? extends ResultAction<? extends BuildResult>> getResultActionType()
public Object getDynamic(String link,
org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
link - the link to identify the sub page to showrequest - Stapler requestresponse - Stapler response
public Priority[] getPriorities()
public Set<FileAnnotation> getAnnotations(String priority)
getAnnotations in interface AnnotationProviderpriority - the priority as a string object
public int getNumberOfAnnotations(String priority)
getNumberOfAnnotations in interface AnnotationProviderpriority - the priority as a string object
public AnnotationContainer getContainer()
public hudson.model.Api getApi()
public boolean isSuccessful()
HealthDescriptor of this result.
true if the build is successful, false
if the build has been set to Result.UNSTABLE or
Result.FAILURE by this result.
public void evaluateStatus(Thresholds thresholds,
boolean useDeltaValues,
PluginLogger logger,
String url)
Result. Additionally, the Result of the
build that owns this instance of BuildResult will be also
changed.
thresholds - the failure thresholdsuseDeltaValues - the use delta values when computing the differenceslogger - the loggerurl - the URL of the results
public void evaluateStatus(Thresholds thresholds,
boolean useDeltaValues,
boolean canComputeNew,
PluginLogger logger,
String url)
Result. Additionally, the Result of the
build that owns this instance of BuildResult will be also
changed.
thresholds - the failure thresholdsuseDeltaValues - the use delta values when computing the differencescanComputeNew - determines whether new warnings should be computed (with
respect to baseline)logger - the loggerurl - the URL of the results@Deprecated public void setResult(hudson.model.Result result)
#evaluateStatus(Thresholds, boolean, PluginLogger)
public hudson.model.Result getPluginResult()
Result of the plug-in.
public boolean isSuccessfulTouched()
true if the successful state has been touched,
false otherwisepublic boolean hasPreviousResult()
true if there is a previous result availablepublic BuildResult getPreviousResult()
public String getReason()
protected static String createDefaultSummary(String url,
int warnings,
int modules)
getSummary() to create the actual
visible user message.
url - the URL to the build resultswarnings - number of warningsmodules - number of modules
protected static String createUrl(String url)
url - the URL
protected static String createDefaultDeltaMessage(String url,
int newWarnings,
int fixedWarnings)
createDeltaMessage() to create the actual
visible user message.
url - the URL to the build resultsnewWarnings - number of new warningsfixedWarnings - number of fixed warnings
public abstract String getSummary()
public String getDetails()
public String getResultIcon()
public String getHeader()
protected String createDeltaMessage()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||