TestResult
open class TestResult
| kotlin.Any | |
| ↳ | 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
Public constructors |
|
|---|---|
<init>() |
|
Public methods |
|
|---|---|
| open Unit |
Adds an error to the list of errors. |
| open Unit |
addFailure(test: Test!, t: AssertionFailedError!)Adds a failure to the list of failures. |
| open Unit |
addListener(listener: TestListener!)Registers a TestListener |
| open Unit |
Informs the result that a test was completed. |
| open Int |
Gets the number of detected errors. |
| open Enumeration<TestFailure!>! |
errors()Returns an Enumeration for the errors |
| open Int |
Gets the number of detected failures. |
| open Enumeration<TestFailure!>! |
failures()Returns an Enumeration for the failures |
| open Unit |
removeListener(listener: TestListener!)Unregisters a TestListener |
| open Int |
runCount()Gets the number of run tests. |
| open Unit |
runProtected(test: Test!, p: Protectable!)Runs a TestCase. |
| open Boolean |
Checks whether the test run should stop |
| open Unit |
Informs the result that a test will be started. |
| open Unit |
stop()Marks that the test run should stop. |
| open Boolean |
Returns whether the entire test was successful or not. |
Protected methods |
|
|---|---|
| open Unit |
Runs a TestCase. |
Properties |
|
|---|---|
| Vector<TestFailure!>! | |
| Vector<TestFailure!>! | |
| Vector<TestListener!>! | |
| Int | |
Public constructors
Public methods
addError
open fun addError(
test: Test!,
t: Throwable!
): Unit
Adds an error to the list of errors. The passed in exception caused the error.
addFailure
open fun addFailure(
test: Test!,
t: AssertionFailedError!
): Unit
Adds a failure to the list of failures. The passed in exception caused the failure.
addListener
open fun addListener(listener: TestListener!): Unit
Registers a TestListener
endTest
open fun endTest(test: Test!): Unit
Informs the result that a test was completed.
errors
open fun errors(): Enumeration<TestFailure!>!
Returns an Enumeration for the errors
failureCount
open fun failureCount(): Int
Gets the number of detected failures.
failures
open fun failures(): Enumeration<TestFailure!>!
Returns an Enumeration for the failures
removeListener
open fun removeListener(listener: TestListener!): Unit
Unregisters a TestListener
runProtected
open fun runProtected(
test: Test!,
p: Protectable!
): Unit
Runs a TestCase.
shouldStop
open fun shouldStop(): Boolean
Checks whether the test run should stop
startTest
open fun startTest(test: Test!): Unit
Informs the result that a test will be started.
wasSuccessful
open fun wasSuccessful(): Boolean
Returns whether the entire test was successful or not.