Class CoverageTask

  • All Implemented Interfaces:
    java.lang.Cloneable, org.apache.tools.ant.TaskContainer

    public class CoverageTask
    extends AbstractCoverageTask
    implements org.apache.tools.ant.TaskContainer
    Container task to run Java/JUnit tasks with the JaCoCo agent jar. Coverage will only be applied if all of the following are true:
    • Exactly one sub task may be present
    • Task must be either Java or JUnit
    • Task must be using a forked VM (so vm args can be passed)
    • Field Detail

      • childTask

        private org.apache.tools.ant.Task childTask
    • Constructor Detail

      • CoverageTask

        public CoverageTask()
        Creates a new default coverage task
    • Method Detail

      • addTask

        public void addTask​(org.apache.tools.ant.Task task)
        Add child task to this container and reconfigure it to run with coverage enabled
        Specified by:
        addTask in interface org.apache.tools.ant.TaskContainer
      • execute

        public void execute()
                     throws org.apache.tools.ant.BuildException
        Executes subtask and performs any required cleanup
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException