Uses of Interface
org.junit.rules.TestRule
-
Packages that use TestRule Package Description org.junit.rules org.junit.runners Provides standardRunner
implementations. -
-
Uses of TestRule in org.junit.rules
Classes in org.junit.rules that implement TestRule Modifier and Type Class Description class
DisableOnDebug
TheDisableOnDebug
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
TheExpectedException
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 rule allows ordering of TestRules.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 failedFields in org.junit.rules declared as TestRule Modifier and Type Field Description private TestRule
DisableOnDebug. rule
Fields in org.junit.rules with type parameters of type TestRule Modifier and Type Field Description private java.util.List<TestRule>
RuleChain. rulesStartingWithInnerMost
Methods in org.junit.rules with parameters of type TestRule Modifier and Type Method Description RuleChain
RuleChain. around(TestRule enclosedRule)
Create a newRuleChain
, which encloses thenextRule
with the rules of the currentRuleChain
.static RuleChain
RuleChain. outerRule(TestRule outerRule)
Returns aRuleChain
with a singleTestRule
.Method parameters in org.junit.rules with type arguments of type TestRule Modifier and Type Method Description private static Statement
RunRules. applyAll(Statement result, java.lang.Iterable<TestRule> rules, Description description)
Constructors in org.junit.rules with parameters of type TestRule Constructor Description DisableOnDebug(TestRule rule)
Create aDisableOnDebug
instance with the timeout specified in milliseconds.DisableOnDebug(TestRule rule, java.util.List<java.lang.String> inputArguments)
Visible for testing purposes only.Constructor parameters in org.junit.rules with type arguments of type TestRule Constructor Description RuleChain(java.util.List<TestRule> rules)
RunRules(Statement base, java.lang.Iterable<TestRule> rules, Description description)
-
Uses of TestRule in org.junit.runners
Methods in org.junit.runners that return types with arguments of type TestRule Modifier and Type Method Description protected java.util.List<TestRule>
ParentRunner. classRules()
protected java.util.List<TestRule>
BlockJUnit4ClassRunner. getTestRules(java.lang.Object target)
Method parameters in org.junit.runners with type arguments of type TestRule Modifier and Type Method Description private Statement
BlockJUnit4ClassRunner. withMethodRules(FrameworkMethod method, java.util.List<TestRule> testRules, java.lang.Object target, Statement result)
private Statement
BlockJUnit4ClassRunner. withTestRules(FrameworkMethod method, java.util.List<TestRule> testRules, Statement statement)
-