TestListener

   
TestListener

Description

TestListener (see Figure B-8) is an interface used for listeners to a TestResult object. A listener may be any class that follows Test progress. Listeners are informed when a Test starts and ends, and when a Test produces a failure or error.

Figure B-8. The interface TestListener
figs/utf_ab08.gif

Declaration

 public interface TestListener 

Constructors

None (it's an interface).

Public Methods


void addError(Test test, Throwable t)

Informs listener that Test produced an error.


void addFailure(Test test, AssertionFailedError e)

Informs listener that Test produced a failure.


void endTest(Test test)

Informs listener that Test finished.


void startTest(Test test)

Informs listener that Test is about to be run.

Protected/Private Methods

None.

Attributes

None.



Unit Test Frameworks
Unit Test Frameworks
ISBN: 0596006896
EAN: 2147483647
Year: 2006
Pages: 146
Authors: Paul Hamill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net