Package | Description |
---|---|
org.junit.rules | |
org.junit.runners |
Provides standard
Runner implementations. |
Modifier and Type | Class and Description |
---|---|
class |
DisableOnDebug
The
DisableOnDebug Rule allows you to label certain rules to be
disabled when debugging. |
class |
ErrorCollector
The ErrorCollector rule allows execution of a test to continue after the
first problem is found (for example, to collect _all_ the incorrect rows in a
table, and report them all at once):
|
class |
ExpectedException
The
ExpectedException rule allows you to verify that your code
throws a specific exception. |
class |
ExternalResource
A base class for Rules (like TemporaryFolder) that set up an external
resource before a test (a file, socket, server, database connection, etc.),
and guarantee to tear it down afterward:
|
class |
RuleChain
The
RuleChain can be used for creating composite rules. |
class |
Stopwatch
The Stopwatch Rule notifies one of its own protected methods of the time spent by a test.
|
private class |
Stopwatch.InternalWatcher |
class |
TemporaryFolder
The TemporaryFolder Rule allows creation of files and folders that should
be deleted when the test method finishes (whether it passes or
fails).
|
class |
TestName
The TestName Rule makes the current test name available inside test methods:
|
class |
TestWatcher
TestWatcher is a base class for Rules that take note of the testing
action, without modifying it.
|
class |
Timeout
The Timeout Rule applies the same timeout to all test methods in a class:
|
class |
Verifier
Verifier is a base class for Rules like ErrorCollector, which can turn
otherwise passing test methods into failing tests if a verification check is
failed
|
Modifier and Type | Field and Description |
---|---|
private TestRule |
DisableOnDebug.rule |
Modifier and Type | Field and Description |
---|---|
private java.util.List<TestRule> |
RuleChain.rulesStartingWithInnerMost |
Modifier and Type | Method and Description |
---|---|
RuleChain |
RuleChain.around(TestRule enclosedRule)
|
static RuleChain |
RuleChain.outerRule(TestRule outerRule)
Returns a
RuleChain with a single TestRule . |
Modifier and Type | Method and Description |
---|---|
private static Statement |
RunRules.applyAll(Statement result,
java.lang.Iterable<TestRule> rules,
Description description) |
Constructor and Description |
---|
DisableOnDebug(TestRule rule)
Create a
DisableOnDebug instance with the timeout specified in
milliseconds. |
DisableOnDebug(TestRule rule,
java.util.List<java.lang.String> inputArguments)
Visible for testing purposes only.
|
Constructor and Description |
---|
RuleChain(java.util.List<TestRule> rules) |
RunRules(Statement base,
java.lang.Iterable<TestRule> rules,
Description description) |
Modifier and Type | Field and Description |
---|---|
private java.util.List<TestRule> |
RuleContainer.testRules |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<TestRule> |
ParentRunner.classRules() |
java.util.List<TestRule> |
ParentRunner.ClassRuleCollector.getOrderedRules() |
protected java.util.List<TestRule> |
BlockJUnit4ClassRunner.getTestRules(java.lang.Object target) |
Modifier and Type | Method and Description |
---|---|
void |
ParentRunner.ClassRuleCollector.accept(FrameworkMember<?> member,
TestRule value) |
void |
RuleContainer.add(TestRule testRule) |