public final class ReporterSupport
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
filterStackTrace(java.lang.Throwable throwable)
Modify a
Throwable 's stacktrace by removing any stack elements that are not relevant
to a test. |
static java.lang.String |
getDescription(Hook hook)
Get a short human-readable description for the given hook.
|
static java.lang.String |
getDescription(TestBlock testBlock)
Get a short human-readable description for the given test block.
|
static java.lang.String |
getFullDescription(Hook hook,
java.util.List<TestBlock> parents)
Get a full human-readable description for the given hook.
|
static java.lang.String |
getFullDescription(TestBlock testBlock,
java.util.List<TestBlock> parents)
Get a full human-readable description for the given test block.
|
static java.lang.String |
getFullDescription(Test test,
java.util.List<TestBlock> parents)
Get a full human-readable description for the given test.
|
public static java.lang.String getDescription(TestBlock testBlock)
This description is only suitable for display where there is sufficient context to uniquely identify the test block.
testBlock
- The test block.public static java.lang.String getDescription(Hook hook)
This description is only suitable for display where there is sufficient context to uniquely identify the hook.
hook
- The hook.public static java.lang.String getFullDescription(TestBlock testBlock, java.util.List<TestBlock> parents)
This description is verbose but is suitable for display where there is no context to help identify the test block.
testBlock
- The test block.parents
- The ancestor test blocks, starting with the root block and ending with the immediate parent.public static java.lang.String getFullDescription(Test test, java.util.List<TestBlock> parents)
This description is verbose but is suitable for display where there is no context to help identify the test.
test
- The test.parents
- The ancestor test blocks, starting with the root block and ending with the immediate parent.public static java.lang.String getFullDescription(Hook hook, java.util.List<TestBlock> parents)
This description is verbose but is suitable for display where there is no context to help identify the hook.
hook
- Test hook.parents
- The ancestor test blocks, starting with the root block and ending with the immediate parent.public static void filterStackTrace(java.lang.Throwable throwable)
Throwable
's stacktrace by removing any stack elements that are not relevant
to a test. If the Throwable
has a cause, it will also be modified. The modification
is applied to all transitive causes.throwable
- a throwable to modify.