Class FailureAntUnitListener

  • All Implemented Interfaces:
    AntUnitListener

    public class FailureAntUnitListener
    extends BaseAntUnitListener
    This AntUnitListener creates a new buildfile with a target for each failed test target in the AntUnit run. The generated target calls the failed target (with setUp and tearDown if present in the called project). This is intended for rerunning just failed tests.
    • Constructor Detail

      • FailureAntUnitListener

        public FailureAntUnitListener()
        No-arg constructor.
    • Method Detail

      • setFile

        public void setFile​(java.io.File file)
      • startTestSuite

        public void startTestSuite​(org.apache.tools.ant.Project testProject,
                                   java.lang.String buildFile)
        Description copied from interface: AntUnitListener
        Invoked once per build file, before any targets get executed.
        Specified by:
        startTestSuite in interface AntUnitListener
        Overrides:
        startTestSuite in class BaseAntUnitListener
        Parameters:
        testProject - the project
        buildFile - the build file
      • addError

        public void addError​(java.lang.String target,
                             java.lang.Throwable ae)
        Description copied from interface: AntUnitListener
        Invoked if any error other than a failed assertion occured during execution.
        Specified by:
        addError in interface AntUnitListener
        Overrides:
        addError in class BaseAntUnitListener
        Parameters:
        target - name of the target
        ae - the error
      • endTest

        public void endTest​(java.lang.String target)
        not in use
        Parameters:
        target - name of the target
      • endTestSuite

        public void endTestSuite​(org.apache.tools.ant.Project testProject,
                                 java.lang.String buildFile)
        Description copied from interface: AntUnitListener
        Invoked once per build file, after all targets have been executed.
        Parameters:
        testProject - the project
        buildFile - the build file