Class CloverPassTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.openclover.ant.tasks.AbstractCloverTask
org.openclover.ant.tasks.CloverPassTask
All Implemented Interfaces:
Cloneable

public class CloverPassTask extends AbstractCloverTask
Clover Ant Task to report pass/fail status of a test run against given targets. Targets may be given overall and/or per package level. The build may optionally fail if targets are not met
Since:
Clover 1.1
  • Constructor Details

    • CloverPassTask

      public CloverPassTask()
  • Method Details

    • setCodeType

      public void setCodeType(String codeTypeAsString)
    • init

      public void init() throws org.apache.tools.ant.BuildException
      Overrides:
      init in class AbstractCloverTask
      Throws:
      org.apache.tools.ant.BuildException
    • addPackage

      public void addPackage(CloverPassTask.PackageRequirement requirement)
      Add a apcage spec to the list of packages to be checked for coverage.
      Parameters:
      requirement - the package rquirement including the apckage name and percentage coverage required.
    • setHistorydir

      public void setHistorydir(File historydir)
    • getHistorydir

      public File getHistorydir()
    • setThreshold

      public void setThreshold(org.openclover.core.cfg.Percentage threshold)
    • getThreshold

      public double getThreshold()
    • setTarget

      public void setTarget(org.openclover.core.cfg.Percentage percentValue)
      Set the overall system coverage target
      Parameters:
      percentValue - the percentage coverage target for the build
    • getMethodTarget

      public org.openclover.core.cfg.Percentage getMethodTarget()
    • setMethodTarget

      public void setMethodTarget(org.openclover.core.cfg.Percentage methodTarget)
    • getStatementTarget

      public org.openclover.core.cfg.Percentage getStatementTarget()
    • setStatementTarget

      public void setStatementTarget(org.openclover.core.cfg.Percentage statementTarget)
    • getConditionalTarget

      public org.openclover.core.cfg.Percentage getConditionalTarget()
    • setConditionalTarget

      public void setConditionalTarget(org.openclover.core.cfg.Percentage conditionalTarget)
    • setFailureProperty

      public void setFailureProperty(String failureProperty)
    • getFailureProperty

      public String getFailureProperty()
    • setFilter

      public void setFilter(String filterSpec)
      set the filter which controls which items are included in the log report.
      Parameters:
      filterSpec - a comma separated set of values denoting the items to include in the report.
    • setSpan

      public void setSpan(org.openclover.core.cfg.Interval span)
    • addTestResults

      public void addTestResults(org.apache.tools.ant.types.FileSet fileset)
    • setIncludeFailedTestCoverage

      public void setIncludeFailedTestCoverage(boolean include)
    • addTestSources

      public void addTestSources(org.apache.tools.ant.types.FileSet fileset)
    • getTestSources

      public List<org.apache.tools.ant.types.FileSet> getTestSources()
    • setHaltOnFailure

      public void setHaltOnFailure(boolean haltOnFailure)
      Set the flag indicating whether the build will be failed for failing to meet a target coverage. If this is false the coverage target failures are logged
      Parameters:
      haltOnFailure - true if the build is to fail when targets are not met.
    • cloverExecute

      public void cloverExecute()
      Do the work - checking the overall and per-package coverage against the givenm targets.
      Specified by:
      cloverExecute in class AbstractCloverTask