Uses of Interface
org.junit.rules.TestRule
-
Packages that use TestRule Package Description org.junit.rules org.junit.runners Provides standardRunnerimplementations. -
-
Uses of TestRule in org.junit.rules
Classes in org.junit.rules that implement TestRule Modifier and Type Class Description classDisableOnDebugTheDisableOnDebugRule allows you to label certain rules to be disabled when debugging.classErrorCollectorThe 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):classExpectedExceptionTheExpectedExceptionrule allows you to verify that your code throws a specific exception.classExternalResourceA 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:classRuleChainThe RuleChain rule allows ordering of TestRules.classStopwatchThe Stopwatch Rule notifies one of its own protected methods of the time spent by a test.private classStopwatch.InternalWatcherclassTemporaryFolderThe TemporaryFolder Rule allows creation of files and folders that should be deleted when the test method finishes (whether it passes or fails).classTestNameThe TestName Rule makes the current test name available inside test methods:classTestWatcherTestWatcher is a base class for Rules that take note of the testing action, without modifying it.classTimeoutThe Timeout Rule applies the same timeout to all test methods in a class:classVerifierVerifier 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 TestRuleDisableOnDebug. ruleFields in org.junit.rules with type parameters of type TestRule Modifier and Type Field Description private java.util.List<TestRule>RuleChain. rulesStartingWithInnerMostMethods in org.junit.rules with parameters of type TestRule Modifier and Type Method Description RuleChainRuleChain. around(TestRule enclosedRule)Create a newRuleChain, which encloses thenextRulewith the rules of the currentRuleChain.static RuleChainRuleChain. outerRule(TestRule outerRule)Returns aRuleChainwith a singleTestRule.Method parameters in org.junit.rules with type arguments of type TestRule Modifier and Type Method Description private static StatementRunRules. 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 aDisableOnDebuginstance 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 StatementBlockJUnit4ClassRunner. withMethodRules(FrameworkMethod method, java.util.List<TestRule> testRules, java.lang.Object target, Statement result)private StatementBlockJUnit4ClassRunner. withTestRules(FrameworkMethod method, java.util.List<TestRule> testRules, Statement statement)
-