Package org.testframe.engine
Class TestResult
java.lang.Object
org.testframe.engine.TestResult
Holds the results of a test. Includes a
Throwable
if it was
provided to hold the stack trace.- Since:
- 1.0
- Author:
- Alonso del Arte
-
Constructor Summary
ConstructorDescriptionTestResult
(Method procedure, TestResultStatus status, Throwable information) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves theThrowable
that was provided to the constructor.Gets the test procedure the result is for.Gets the test result status.boolean
Tells whether the result has a stack trace or not.
-
Constructor Details
-
TestResult
Constructor.- Parameters:
procedure
- The test procedure the test result is for. Such as, for example,testNoDivisionByZero()
.status
- The test result status, one ofTestResultStatus.PASSED
,TestResultStatus.FAILED
,TestResultStatus.ERROR
orTestResultStatus.SKIPPED
.information
- An error or exception object presumably holding a stack trace pertinent to the test, or null if not applicable (such as ought to be the case for a passing or skipped test). For example, anArithmeticException
object with a stack trace that includes a line intestNoDivisionByZero()
.
-
-
Method Details
-
getProcedure
Gets the test procedure the result is for.- Returns:
- The test procedure the result is for. Such as, for example,
testNoDivisionByZero()
.
-
getStatus
Gets the test result status.- Returns:
- The test result status, one of
TestResultStatus.PASSED
,TestResultStatus.FAILED
,TestResultStatus.ERROR
orTestResultStatus.SKIPPED
.
-
hasStackTrace
public boolean hasStackTrace()Tells whether the result has a stack trace or not.- Returns:
- True if a
Throwable
object presumably holding a stack trace was provided to the constructor, false otherwise.
-
getInformation
Retrieves theThrowable
that was provided to the constructor.- Returns:
- A
Throwable
object that presumably holds a stack trace.
-