Package org.apache.batik.test
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: TestReport.java 1733416 2016-03-03 07:07:13Z gadams $
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Inner class for describing an information element in aTestReport
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Entry with the stack trace for a specific test error condition.static final String
Entry describing the class of the internal exception that caused the test's internal failurestatic final String
Entry describing the messages of the internal exception that caused the test's internal failurestatic final String
Entry with the stack trace for the internal exception that caused the test's internal failurestatic final String
Entry with the class of the exception that caused the test to fail.static final String
Entry with the message of the exception that caused the test to fail.static final String
Entry with the stack trace that caused the test to fail.static final String
Generic error code to report test assertion failures.static final String
Error code to be used when aTest
fails in its own operation (i.e., theTest
itself fails, not what it is testing.static final String
Very generic error code which can be used to report that the test failed. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescriptionEntry
(String key, Object value) Appendsentry
to the array of description entry.Returns an array ofEntry
objects describing the test result.Returns the error code.Returns the parent report in case thisTestReport
is part of aTestSuiteReport
.getTest()
Returns theTest
object that generated thisTestReport
boolean
Returns the overall test resultvoid
setParentReport
(TestSuiteReport parent) Set this report's parent.
-
Field Details
-
ERROR_INTERNAL_TEST_FAILURE
Error code to be used when aTest
fails in its own operation (i.e., theTest
itself 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 theTest
author 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 theTest
author 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 theTest
author 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 ofEntry
objects describing the test result. Accepted value types areString
objects,URL
objects,File
objects andTestReport
objects.File
objects should be considered as temporary files -
addDescriptionEntry
Appendsentry
to the array of description entry. -
getTest
Test getTest()Returns theTest
object that generated thisTestReport
-
getParentReport
TestSuiteReport getParentReport()Returns the parent report in case thisTestReport
is part of aTestSuiteReport
. This may be null. -
setParentReport
Set this report's parent.
-