Interface TestReport
- All Known Subinterfaces:
TestSuiteReport
- All Known Implementing Classes:
DefaultTestReport, DefaultTestSuiteReport
public interface TestReport
Defines the interface of a
TestReport produced
by a Test case.- Version:
- $Id$
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classInner class for describing an information element in aTestReport -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEntry with the stack trace for a specific test error condition.static final StringEntry describing the class of the internal exception that caused the test's internal failurestatic final StringEntry describing the messages of the internal exception that caused the test's internal failurestatic final StringEntry with the stack trace for the internal exception that caused the test's internal failurestatic final StringEntry with the class of the exception that caused the test to fail.static final StringEntry with the message of the exception that caused the test to fail.static final StringEntry with the stack trace that caused the test to fail.static final StringGeneric error code to report test assertion failures.static final StringError code to be used when aTestfails in its own operation (i.e., theTestitself fails, not what it is testing.static final StringVery generic error code which can be used to report that the test failed. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDescriptionEntry(String key, Object value) Appendsentryto the array of description entry.Returns an array ofEntryobjects describing the test result.Returns the error code.Returns the parent report in case thisTestReportis part of aTestSuiteReport.getTest()Returns theTestobject that generated thisTestReportbooleanReturns the overall test resultvoidsetParentReport(TestSuiteReport parent) Set this report's parent.
-
Field Details
-
ERROR_INTERNAL_TEST_FAILURE
Error code to be used when aTestfails in its own operation (i.e., theTestitself fails, not what it is testing. An internal failure is reported when any type of exception occurs while running the test.- See Also:
-
ERROR_TEST_FAILED
Very generic error code which can be used to report that the test failed.- See Also:
-
ERROR_ASSERTION_FAILED
Generic error code to report test assertion failures.- See Also:
-
ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_CLASS
Entry describing the class of the internal exception that caused the test's internal failure- See Also:
-
ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_MESSAGE
Entry describing the messages of the internal exception that caused the test's internal failure- See Also:
-
ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_STACK_TRACE
Entry with the stack trace for the internal exception that caused the test's internal failure- See Also:
-
ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_CLASS
Entry with the class of the exception that caused the test to fail. Note that this is different from ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_CLASS, in which case, the test itself failed unexpectedly. In this case, the entry is used to describe an expected exception for which theTestauthor probably created a specific error code.- See Also:
-
ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_MESSAGE
Entry with the message of the exception that caused the test to fail. Note that this is different from ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_MESSAGE, in which case, the test itself failed unexpectedly. In this case, the entry is used to describe an expected exception for which theTestauthor probably created a specific error code.- See Also:
-
ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_STACK_TRACE
Entry with the stack trace that caused the test to fail. Note that this is different from ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_STACK_TRACE, in which case, the test itself failed unexpectedly. In this case, the entry is used to describe an expected exception for which theTestauthor probably created a specific error code.- See Also:
-
ENTRY_KEY_ERROR_CONDITION_STACK_TRACE
Entry with the stack trace for a specific test error condition.- See Also:
-
-
Method Details
-
hasPassed
boolean hasPassed()Returns the overall test result -
getErrorCode
String getErrorCode()Returns the error code. This should never be null if the test failed (i.e., if hasPassed returns false). -
getDescription
TestReport.Entry[] getDescription()Returns an array ofEntryobjects describing the test result. Accepted value types areStringobjects,URLobjects,Fileobjects andTestReportobjects.Fileobjects should be considered as temporary files -
addDescriptionEntry
-
getTest
Test getTest()Returns theTestobject that generated thisTestReport -
getParentReport
TestSuiteReport getParentReport()Returns the parent report in case thisTestReportis part of aTestSuiteReport. This may be null. -
setParentReport
Set this report's parent.
-