All Packages Class Hierarchy This Package Previous Next Index
Class test.framework.TestResult
java.lang.Object
|
+----test.framework.TestResult
- public class TestResult
- extends Object
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
.
- See Also:
- Test
-
fErrors
-
-
fFailures
-
-
fRunTests
-
-
TestResult()
-
-
addError(Test, Throwable)
- Adds an error to the list of errors.
-
addFailure(Test, Throwable)
- Adds a failure to the list of failures.
-
endTest(Test)
- Informs the result that a test was completed.
-
errors()
- Returns an Enumeration for the errors
-
failures()
- Returns an Enumeration for the failures
-
runTests()
- Gets the number of run tests.
-
shouldStop()
- Checks whether the test run should stop
-
startTest(Test)
- Informs the result that a test will be started.
-
stop()
- Marks that the test run should stop.
-
testErrors()
- Gets the number of detected errors.
-
testFailures()
- Gets the number of detected failures.
-
wasSuccessful()
- Returns whether the entire test was successful or not.
fFailures
protected Vector fFailures
fErrors
protected Vector fErrors
fRunTests
protected int fRunTests
TestResult
public TestResult()
addError
public synchronized void addError(Test test,
Throwable t)
- Adds an error to the list of errors. The passed in exception
caused the error.
addFailure
public synchronized void addFailure(Test test,
Throwable t)
- Adds a failure to the list of failures. The passed in exception
caused the failure.
startTest
public synchronized void startTest(Test test)
- Informs the result that a test will be started.
endTest
public synchronized void endTest(Test test)
- Informs the result that a test was completed.
runTests
public synchronized int runTests()
- Gets the number of run tests.
testErrors
public synchronized int testErrors()
- Gets the number of detected errors.
testFailures
public synchronized int testFailures()
- Gets the number of detected failures.
wasSuccessful
public synchronized boolean wasSuccessful()
- Returns whether the entire test was successful or not.
failures
public synchronized Enumeration failures()
- Returns an Enumeration for the failures
errors
public synchronized Enumeration errors()
- Returns an Enumeration for the errors
stop
public synchronized void stop()
- Marks that the test run should stop.
shouldStop
public synchronized boolean shouldStop()
- Checks whether the test run should stop
All Packages Class Hierarchy This Package Previous Next Index