org.apache.ant.antunit.listener
Class FailureAntUnitListener

java.lang.Object
  extended by org.apache.ant.antunit.listener.BaseAntUnitListener
      extended by org.apache.ant.antunit.listener.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.


Nested Class Summary
 class FailureAntUnitListener.TestInfos
          Class for collecting needed information about failed tests.
 
Nested classes/interfaces inherited from class org.apache.ant.antunit.listener.BaseAntUnitListener
BaseAntUnitListener.AntUnitLogLevel, BaseAntUnitListener.LogGrabber, BaseAntUnitListener.SendLogTo
 
Field Summary
 
Fields inherited from class org.apache.ant.antunit.listener.BaseAntUnitListener
errorCount, failureCount, nf, runCount, start, testStart
 
Constructor Summary
FailureAntUnitListener()
          No-arg constructor.
 
Method Summary
 void addError(java.lang.String target, java.lang.Throwable ae)
          Invoked if any error other than a failed assertion occured during execution.
 void addFailure(java.lang.String target, AssertionFailedException ae)
          Invoked if an assert tasked caused an error during execution.
 void endTest(java.lang.String target)
          not in use
 void endTestSuite(org.apache.tools.ant.Project testProject, java.lang.String buildFile)
          Invoked once per build file, after all targets have been executed.
 void setFile(java.io.File file)
           
 void startTestSuite(org.apache.tools.ant.Project testProject, java.lang.String buildFile)
          Invoked once per build file, before any targets get executed.
 
Methods inherited from class org.apache.ant.antunit.listener.BaseAntUnitListener
close, getCurrentTestProject, getLocation, getOut, getToDir, messageLogged, normalize, setCurrentTestProject, setLogLevel, setParentTask, setSendLogTo, setToDir, startTest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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

addFailure

public void addFailure(java.lang.String target,
                       AssertionFailedException ae)
Description copied from interface: AntUnitListener
Invoked if an assert tasked caused an error during execution.

Specified by:
addFailure in interface AntUnitListener
Overrides:
addFailure in class BaseAntUnitListener

endTest

public void endTest(java.lang.String target)
not in use


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.



Copyright © 2011 The Apache Software Foundation. All Rights Reserved.