hudson.plugins.findbugs
Class FindBugsResultAction

java.lang.Object
  extended by hudson.plugins.findbugs.FindBugsResultAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.HealthReportingAction, hudson.model.ModelObject, java.io.Serializable, org.kohsuke.stapler.StaplerProxy

public class FindBugsResultAction
extends java.lang.Object
implements org.kohsuke.stapler.StaplerProxy, hudson.model.HealthReportingAction

Controls the live cycle of the FindBugs results. This action persists the results of the FindBugs analysis of a build and displays the results on the build page. The actual visualization of the results is defined in the matching summary.jelly file.

Moreover, this class renders the FindBugs result trend.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
FindBugsResultAction(hudson.model.Build<?,?> owner, int minimumBugs, boolean isHealthyReportEnabled, int healthy, int unHealthy)
          Creates a new instance of FindBugsBuildAction.
 
Method Summary
 void doGraph(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Generates a PNG image for the test result trend.
 void doGraphMap(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Generates a PNG image for the test result trend.
 hudson.model.HealthReport getBuildHealth()
          
 java.lang.String getDisplayName()
          
 java.lang.String getIconFileName()
          
 hudson.model.Build<?,?> getOwner()
          Returns the associated build of this action.
 FindBugsResultAction getPreviousResult()
          Gets the FindBugs result of the previous build.
 FindBugsResult getResult()
          Returns the FindBugs result.
 java.lang.Object getTarget()
          
 java.lang.String getUrlName()
          
 boolean hasPreviousResult()
          Returns whether a previous build already did run with FindBugs.
 void setResult(FindBugsResult result)
          Sets the FindBugs result for this build.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindBugsResultAction

public FindBugsResultAction(hudson.model.Build<?,?> owner,
                            int minimumBugs,
                            boolean isHealthyReportEnabled,
                            int healthy,
                            int unHealthy)
Creates a new instance of FindBugsBuildAction.

Parameters:
owner - the associated build of this action
minimumBugs - Bug threshold to be reached if a build should be considered as unstable.
isHealthyReportEnabled - Determines whether to use the provided healthy thresholds.
healthy - Report health as 100% when the number of warnings is less than this value
unHealthy - Report health as 0% when the number of warnings is greater than this value
Method Detail

getOwner

public hudson.model.Build<?,?> getOwner()
Returns the associated build of this action.

Returns:
the associated build of this action

getTarget

public java.lang.Object getTarget()

Specified by:
getTarget in interface org.kohsuke.stapler.StaplerProxy

getResult

public FindBugsResult getResult()
Returns the FindBugs result.

Returns:
the FindBugs result

getBuildHealth

public hudson.model.HealthReport getBuildHealth()

Specified by:
getBuildHealth in interface hudson.model.HealthReportingAction

getDisplayName

public java.lang.String getDisplayName()

Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getIconFileName

public java.lang.String getIconFileName()

Specified by:
getIconFileName in interface hudson.model.Action

getUrlName

public java.lang.String getUrlName()

Specified by:
getUrlName in interface hudson.model.Action

getPreviousResult

public FindBugsResultAction getPreviousResult()
Gets the FindBugs result of the previous build.

Returns:
the FindBugs result of the previous build.
Throws:
java.util.NoSuchElementException - if there is no previous build for this action

hasPreviousResult

public boolean hasPreviousResult()
Returns whether a previous build already did run with FindBugs.

Returns:
true if a previous build already did run with FindBugs.

setResult

public void setResult(FindBugsResult result)
Sets the FindBugs result for this build. The specified result will be persisted in the build folder as an XML file.

Parameters:
result - the result to set

doGraph

public void doGraph(org.kohsuke.stapler.StaplerRequest request,
                    org.kohsuke.stapler.StaplerResponse response)
             throws java.io.IOException
Generates a PNG image for the test result trend.

Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error in doGraph(StaplerRequest, StaplerResponse)

doGraphMap

public void doGraphMap(org.kohsuke.stapler.StaplerRequest request,
                       org.kohsuke.stapler.StaplerResponse response)
                throws java.io.IOException
Generates a PNG image for the test result trend.

Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error in doGraph(StaplerRequest, StaplerResponse)


Copyright © 2007. All Rights Reserved.