|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--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
.
Test
Constructor Summary | |
TestResult()
|
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 |
addListener(TestListener listener)
Registers a TestListener |
void |
endTest(Test test)
Informs the result that a test was completed. |
int |
errorCount()
Gets the number of detected errors. |
java.util.Enumeration |
errors()
Returns an Enumeration for the errors |
int |
failureCount()
Gets the number of detected failures. |
java.util.Enumeration |
failures()
Returns an Enumeration for the failures |
int |
runCount()
Gets the number of run tests. |
void |
runProtected(Test test,
Protectable p)
Runs a TestCase. |
int |
runTests()
Deprecated. use runCount instead |
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. |
int |
testErrors()
Deprecated. use errorCount instead |
int |
testFailures()
Deprecated. use failureCount instead |
boolean |
wasSuccessful()
Returns whether the entire test was successful or not. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TestResult()
Method Detail |
public void addError(Test test, java.lang.Throwable t)
public void addFailure(Test test, AssertionFailedError t)
public void addListener(TestListener listener)
public void endTest(Test test)
public int errorCount()
public java.util.Enumeration errors()
public int failureCount()
public java.util.Enumeration failures()
public int runCount()
public void runProtected(Test test, Protectable p)
public int runTests()
runCount
insteadpublic boolean shouldStop()
public void startTest(Test test)
public void stop()
public int testErrors()
errorCount
insteadpublic int testFailures()
failureCount
insteadpublic boolean wasSuccessful()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |