Throwable
.
This class distinguishes between Throwables
that abort
and those that fail test execution. The latter take precedence over
the former, i.e. if both types of Throwables
were collected, the ones
that abort execution are reported as
suppressed Throwables
of the first Throwable
that failed execution.
OpenTest4JAwareThrowableCollector
Modifier and Type | Class and Description |
---|---|
public static interface | ThrowableCollector.
Functional interface for an executable block of code that may throw a
|
public static interface | ThrowableCollector.
Factory for |
Modifier and Type | Field and Description |
---|---|
private final Predicate | |
private Throwable |
Access | Constructor and Description |
---|---|
public | ThrowableCollector(Predicate<? super Throwable>
the predicate used to decide whether a
abortedExecutionPredicate)Throwable aborted execution; never null .Create a new |
Modifier and Type | Method and Description |
---|---|
private void | |
public void | |
public void | execute(ThrowableCollector.
the executableExecutable to executeExecute the supplied |
public Throwable | Returns: the first collectedThrowable or null if this
ThrowableCollector is emptyGet the first |
private boolean | |
public boolean | |
public boolean | isNotEmpty()
Determine if this |
public TestExecutionResult | Returns: aborted if the collectedThrowable aborted execution;
failed if it failed
execution; and successful
otherwiseConvert the collected |
abortedExecutionPredicate | back to summary |
---|---|
private final Predicate<? super Throwable> abortedExecutionPredicate |
throwable | back to summary |
---|---|
private Throwable throwable |
ThrowableCollector | back to summary |
---|---|
public ThrowableCollector(Predicate<? super Throwable> abortedExecutionPredicate) Create a new |
add | back to summary |
---|---|
private void add(Throwable t) Add the supplied
|
assertEmpty | back to summary |
---|---|
public void assertEmpty() Assert that this If this collector is not empty, the first collected |
execute | back to summary |
---|---|
public void execute(ThrowableCollector. Execute the supplied If the
|
getThrowable | back to summary |
---|---|
public Throwable getThrowable() Get the first If this collector is not empty, the first collected If the first collected
|
hasAbortedExecution | back to summary |
---|---|
private boolean hasAbortedExecution(Throwable t) |
isEmpty | back to summary |
---|---|
public boolean isEmpty() Determine if this |
isNotEmpty | back to summary |
---|---|
public boolean isNotEmpty() Determine if this |
toTestExecutionResult | back to summary |
---|---|
public TestExecutionResult toTestExecutionResult() Convert the collected
|
Throwable
.
Modifier and Type | Method and Description |
---|---|
public void |
execute | back to summary |
---|---|
public void execute() throws Throwable Execute this executable, potentially throwing a |
ThrowableCollector
instances.
Modifier and Type | Method and Description |
---|---|
public ThrowableCollector |
create | back to summary |
---|---|
public ThrowableCollector create() Create a new instance of a |