hudson.plugins.findbugs
Class FindBugsPublisher

java.lang.Object
  extended by hudson.tasks.Publisher
      extended by hudson.plugins.findbugs.FindBugsPublisher
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Publisher>, hudson.tasks.BuildStep

public class FindBugsPublisher
extends hudson.tasks.Publisher

Publishes the results of the FindBugs analysis.

TODO: Add checking of ant path like in the JUNIT plug-in

Author:
Ulli Hafner

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
static FindBugsDescriptor FIND_BUGS_DESCRIPTOR
          Descriptor of this publisher.
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
FindBugsPublisher(java.lang.String pattern, java.lang.String threshold, java.lang.String healthy, java.lang.String unHealthy)
          Creates a new instance of FindBugsPublisher.
 
Method Summary
 hudson.model.Descriptor<hudson.tasks.Publisher> getDescriptor()
          
 java.lang.String getHealthy()
          Returns the healthy threshold.
 java.lang.String getPattern()
          Returns the Ant file-set pattern to FindBugs XML files.
 hudson.model.Action getProjectAction(hudson.model.Project project)
          
 java.lang.String getThreshold()
          Returns the Bug threshold to be reached if a build should be considered as unstable.
 java.lang.String getUnHealthy()
          Returns the unhealthy threshold.
 boolean perform(hudson.model.Build<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          Scans the workspace, collects all data files and copies these files to the build results folder.
 
Methods inherited from class hudson.tasks.Publisher
prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIND_BUGS_DESCRIPTOR

public static final FindBugsDescriptor FIND_BUGS_DESCRIPTOR
Descriptor of this publisher.

Constructor Detail

FindBugsPublisher

public FindBugsPublisher(java.lang.String pattern,
                         java.lang.String threshold,
                         java.lang.String healthy,
                         java.lang.String unHealthy)
Creates a new instance of FindBugsPublisher.

Parameters:
pattern - Ant file-set pattern to scan for FindBugs files
threshold - Bug threshold to be reached if a build should be considered as unstable.
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

getProjectAction

public hudson.model.Action getProjectAction(hudson.model.Project project)

Specified by:
getProjectAction in interface hudson.tasks.BuildStep
Overrides:
getProjectAction in class hudson.tasks.Publisher

getThreshold

public java.lang.String getThreshold()
Returns the Bug threshold to be reached if a build should be considered as unstable.

Returns:
the bug threshold

getHealthy

public java.lang.String getHealthy()
Returns the healthy threshold.

Returns:
the healthy

getUnHealthy

public java.lang.String getUnHealthy()
Returns the unhealthy threshold.

Returns:
the unHealthy

getPattern

public java.lang.String getPattern()
Returns the Ant file-set pattern to FindBugs XML files.

Returns:
ant file-set pattern to FindBugs XML files.

perform

public boolean perform(hudson.model.Build<?,?> build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
                throws java.lang.InterruptedException,
                       java.io.IOException
Scans the workspace, collects all data files and copies these files to the build results folder. Then counts the number of bugs and sets the result of the build accordingly (threshold.

Parameters:
build - the build
launcher - the launcher
listener - the build listener
Returns:
true in case the processing has been aborted
Throws:
java.io.IOException - if the files could not be copied
java.lang.InterruptedException - if user cancels the operation

getDescriptor

public hudson.model.Descriptor<hudson.tasks.Publisher> getDescriptor()



Copyright © 2007. All Rights Reserved.