public class TimberTestRule
extends java.lang.Object
TestRule that plants a Timber.Tree before a test is executed,
and uproots the Timber.Tree afterwards.
This is useful as a planted Timber.Tree would exist between test classes, which may be
undesirable.
| Modifier and Type | Class and Description |
|---|---|
static class |
TimberTestRule.Rules
Defines a set of rules in which the
TimberTestRule's internal Timber tree must
adhere to when intercepting log messages. |
| Modifier and Type | Method and Description |
|---|---|
Statement |
apply(Statement base,
Description description) |
static TimberTestRule.Rules |
builder() |
static TimberTestRule |
logAllAlways() |
static TimberTestRule |
logAllWhenTestFails() |
static TimberTestRule |
logErrorsAlways() |
static TimberTestRule |
logErrorsWhenTestFails() |
public static TimberTestRule logAllAlways()
TimberTestRule that logs messages of any priority regardless of the
test outcomepublic static TimberTestRule logAllWhenTestFails()
TimberTestRule that logs all messages, regardless of their priority.public static TimberTestRule logErrorsAlways()
TimberTestRule that only logs error messages regardless of the test
outcome.public static TimberTestRule logErrorsWhenTestFails()
TimberTestRule that only logs error messages when a unit test fails.public static TimberTestRule.Rules builder()
TimberTestRule.Rules class which is used as a builder to create a TimberTestRule.public Statement apply(Statement base,
Description description)