public abstract class StatementAdapter
extends org.junit.runners.model.Statement
Statement
that guarantees the execution of
afterAlways(java.util.List<java.lang.Throwable>)
even if an exception has been thrown from delegate
Statement
. This is much like AfterClass
or After
annotations but can be used with RuleChain
to guarantee the order of
execution.Modifier | Constructor and Description |
---|---|
protected |
StatementAdapter(org.junit.runners.model.Statement delegate) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterAlways(List<Throwable> errors)
Always called after the delegate
Statement , even if an exception
(or assumption failure) occurs. |
protected void |
afterIfSuccessful()
Called only if the delegate
Statement returned successfully. |
protected void |
before()
Always called before the delegate
Statement . |
void |
evaluate() |
protected StatementAdapter(org.junit.runners.model.Statement delegate)
public final void evaluate() throws Throwable
evaluate
in class org.junit.runners.model.Statement
Throwable
protected void before() throws Throwable
Statement
.Throwable
protected void afterAlways(List<Throwable> errors) throws Throwable
Statement
, even if an exception
(or assumption failure) occurs. Any exceptions thrown from the body of this
method will be chained using MultipleFailureException
.errors
- A list of errors received so far. The list is modifiable although
should only be extended with new potential exceptions.Throwable
Copyright © 2011–2015 Carrot Search s.c.. All rights reserved.