Hansel Ant Task

Description

The hansel ant task prints out all classes, that are not covered by coverage tests.

Usage

To use the task in a build file, you will need the following taskdef declaration:

       <taskdef name= coverage"
           classname="org.hansel.AntCoverageTask"/>
    

Parameters

Attribute Description Required
classfilepath Classpath the classfiles are searched in. This only has to include the files, that are tested for coverage and the coverage testcases. Classfilepath has to be a simple path. yes
packages Comma seperated list of packages that require coverage testing or contain testcases for these classes. yes
classpath Classpath to use (This has to include third party packages, that are needed by the test cases). no
classpathref The classpath to use, given as reference to a PATH defined elsewhere. no
excludepackages Packages that do not have do be covered by coverage tests. This property has only to be set, if the packages containing the test cases also contain helper classes for the test cases that do not have to be tested by coverage tests. no
stats Boolean indicating wether a small statistic should be printed. Defaults to true. no

Examples

    <coverage classfilepath="${hansel.classes}"
              packages="${packages}"/>
Require that all hansel classes are tested by coverage tests. All classes, that are not covered by any test, are printed out. Prints some stats.
    <coverage classfilepath="${hansel.classes}"
              packages="${packages}, org.hanseltest.*"
              excludepackages="org.hanseltest"/>
Requires that all hansel classes except the "org.hanseltest" package are tested by coverage tests. All classes, that are not covered by any test, are printed out. Prints some stats.
    <coverage classfilepath="${hansel.classes}"
              packages="${packages}, org.hanseltest.*"
              excludepackages="org.hanseltest"
              stats="false"/>
Requires that all hansel classes except the "org.hanseltest" package are tested by coverage tests. Prints no stats.