junit.framework.TestResult
A TestResult
collects the results of executing
a test case. It is an instance of the Collecting Parameter pattern.
The test framework distinguishes between failures and errors.
A failure is anticipated and checked for with assertions. Errors are
unanticipated problems like an ArrayIndexOutOfBoundsException
.
Summary
Fields
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Fields
Public Constructors
Public Methods
public
synchronized
void
addError(Test test, Throwable t)
Adds an error to the list of errors. The passed in exception
caused the error.
Adds a failure to the list of failures. The passed in exception
caused the failure.
public
synchronized
void
addListener(TestListener listener)
Registers a TestListener
public
void
endTest(Test test)
Informs the result that a test was completed.
public
synchronized
int
errorCount()
Gets the number of detected errors.
public
synchronized
Enumeration
errors()
Returns an Enumeration for the errors
public
synchronized
int
failureCount()
Gets the number of detected failures.
public
synchronized
Enumeration
failures()
Returns an Enumeration for the failures
public
synchronized
void
removeListener(TestListener listener)
Unregisters a TestListener
public
synchronized
int
runCount()
Gets the number of run tests.
public
synchronized
boolean
shouldStop()
Checks whether the test run should stop
public
void
startTest(Test test)
Informs the result that a test will be started.
public
synchronized
void
stop()
Marks that the test run should stop.
public
synchronized
boolean
wasSuccessful()
Returns whether the entire test was successful or not.
Protected Methods
protected
void
run(TestCase test)
Runs a TestCase.