public class DescriptionMapper extends Object
WrappingParameterizedRunner. It rewrites
descriptions such that they use the original test class instead of the
dynamically created (synthesized) extending test class so that test reports
refer back to the original test class. It also remembers the mappings done so
they can be re-applied later when the actual test runs report success or
failure. The Description.equals(Object) and
Description.hashCode() implementations suitably support using the
Description objects themselves directly as map keys.| Constructor and Description |
|---|
DescriptionMapper(Class<?> testClass) |
| Modifier and Type | Method and Description |
|---|---|
org.junit.runner.Description |
map(org.junit.runner.Description orig)
This is used to map "original" descriptions again in the same manner as
when they were rewritten earlier using
rewriteDescription(String, Description). |
org.junit.runner.Description |
rewriteDescription(String description,
org.junit.runner.Description orig)
Rewrites the description of a first-level runner child of the
WrappingParameterizedRunner runner, and recursively its children.
|
public DescriptionMapper(Class<?> testClass)
public org.junit.runner.Description rewriteDescription(String description, org.junit.runner.Description orig)
description - the new description text to use for this childorig - the original description object provided by the child runner.public org.junit.runner.Description map(org.junit.runner.Description orig)
rewriteDescription(String, Description). Any description object
given to the rewriteDescription(String, Description) or any
child, child's child etc inside it can be supplied to this method.orig - the original description objectrewriteDescription(String, Description).Copyright © 2014. All rights reserved.