hudson.plugins.pmd.util
Class BuildResultEvaluator

java.lang.Object
  extended by hudson.plugins.pmd.util.BuildResultEvaluator

public class BuildResultEvaluator
extends java.lang.Object

Evaluates if the number of annotations exceeds a given threshold value.

Author:
Ulli Hafner

Constructor Summary
BuildResultEvaluator()
           
 
Method Summary
 hudson.model.Result evaluateBuildResult(PluginLogger logger, Priority minimumPriority, ParserResult result, java.lang.String threshold, java.lang.String failureThreshold, ParserResult newResult, java.lang.String newThreshold, java.lang.String newFailureThreshold)
          Evaluates the build result.
 boolean isAnnotationCountExceeded(int annotationCount, java.lang.String annotationThreshold)
          Returns whether the new annotation count exceeds the user defined threshold and the build should be set to unstable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildResultEvaluator

public BuildResultEvaluator()
Method Detail

evaluateBuildResult

public hudson.model.Result evaluateBuildResult(PluginLogger logger,
                                               Priority minimumPriority,
                                               ParserResult result,
                                               java.lang.String threshold,
                                               java.lang.String failureThreshold,
                                               ParserResult newResult,
                                               java.lang.String newThreshold,
                                               java.lang.String newFailureThreshold)
Evaluates the build result. The build is marked as unstable if one of the thresholds has been exceeded.

Parameters:
logger - logs the results
minimumPriority - determines which warning priorities should be considered
result - the result collecting all annotations
threshold - annotation threshold to be reached if a build should be considered as unstable
failureThreshold - annotation threshold to be reached if a build should be considered as failure
newResult - the result collecting the new annotations
newThreshold - threshold for new annotations to be reached if a build should be considered as unstable
newFailureThreshold - threshold for new annotations to be reached if a build should be considered as failure
Returns:
the build result

isAnnotationCountExceeded

public boolean isAnnotationCountExceeded(int annotationCount,
                                         java.lang.String annotationThreshold)
Returns whether the new annotation count exceeds the user defined threshold and the build should be set to unstable.

Parameters:
annotationCount - the number of new annotations
annotationThreshold - string representation of the threshold value
Returns:
true if the build should be set to unstable


Copyright © 2009. All Rights Reserved.