|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejosunit.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
.
lejosunit changes:
Test
Constructor Summary | |
TestResult()
Default constructor. |
Method Summary | |
void |
addError(Test test,
java.lang.Throwable t)
Adds an error to the list of errors. |
void |
addFailure(Test test,
AssertionFailedError t)
Adds a failure to the list of failures. |
void |
endTest(Test test)
Informs the listener that a test was completed. |
int |
errorCount()
Gets the number of detected errors. |
java.lang.Object[] |
errors()
Returns an Enumeration for the errors |
int |
failureCount()
Gets the number of detected failures. |
java.lang.Object[] |
failures()
Returns an Enumeration for the failures. |
protected void |
run(TestCase test)
Runs a TestCase. |
int |
runCount()
Gets the number of run tests. |
void |
runProtected(Test test,
Protectable p)
Runs a TestCase. |
void |
setListener(TestListener aListener)
Registers a TestListener. |
boolean |
shouldStop()
Checks whether the test run should stop. |
void |
startTest(Test test)
Informs the result that a test will be started. |
void |
stop()
Marks that the test run should stop. |
boolean |
wasSuccessful()
Returns whether the entire test was successful or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TestResult()
Method Detail |
public void addError(Test test, java.lang.Throwable t)
test
- the test to add to error listt
- the throwable to add to error listpublic void addFailure(Test test, AssertionFailedError t)
test
- the test to add to failure listt
- the throwable to add to failure listpublic void setListener(TestListener aListener)
aListener
- the listerner to set for the test resultpublic void endTest(Test test)
test
- the test which indicates the endpublic java.lang.Object[] errors()
public java.lang.Object[] failures()
protected void run(TestCase test)
test
- the test case which will be running.public int runCount()
public void runProtected(Test test, Protectable p)
test
- the test which have to be runningp
- the protectable to catch all exceptionspublic boolean shouldStop()
public void startTest(Test test)
test
- the test which indicates start of an test casepublic void stop()
public int errorCount()
public int failureCount()
public boolean wasSuccessful()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |