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

Variable Index

 o fErrors
 o fFailures
 o fRunTests

Constructor Index

 o TestResult()

Method Index

 o addError(Test, Throwable)
Adds an error to the list of errors.
 o addFailure(Test, Throwable)
Adds a failure to the list of failures.
 o endTest(Test)
Informs the result that a test was completed.
 o errors()
Returns an Enumeration for the errors
 o failures()
Returns an Enumeration for the failures
 o runTests()
Gets the number of run tests.
 o shouldStop()
Checks whether the test run should stop
 o startTest(Test)
Informs the result that a test will be started.
 o stop()
Marks that the test run should stop.
 o testErrors()
Gets the number of detected errors.
 o testFailures()
Gets the number of detected failures.
 o wasSuccessful()
Returns whether the entire test was successful or not.

Variables

 o fFailures
 protected Vector fFailures
 o fErrors
 protected Vector fErrors
 o fRunTests
 protected int fRunTests

Constructors

 o TestResult
 public TestResult()

Methods

 o addError
 public synchronized void addError(Test test,
                                   Throwable t)
Adds an error to the list of errors. The passed in exception caused the error.

 o addFailure
 public synchronized void addFailure(Test test,
                                     Throwable t)
Adds a failure to the list of failures. The passed in exception caused the failure.

 o startTest
 public synchronized void startTest(Test test)
Informs the result that a test will be started.

 o endTest
 public synchronized void endTest(Test test)
Informs the result that a test was completed.

 o runTests
 public synchronized int runTests()
Gets the number of run tests.

 o testErrors
 public synchronized int testErrors()
Gets the number of detected errors.

 o testFailures
 public synchronized int testFailures()
Gets the number of detected failures.

 o wasSuccessful
 public synchronized boolean wasSuccessful()
Returns whether the entire test was successful or not.

 o failures
 public synchronized Enumeration failures()
Returns an Enumeration for the failures

 o errors
 public synchronized Enumeration errors()
Returns an Enumeration for the errors

 o stop
 public synchronized void stop()
Marks that the test run should stop.

 o shouldStop
 public synchronized boolean shouldStop()
Checks whether the test run should stop


All Packages  Class Hierarchy  This Package  Previous  Next  Index