Modifier and Type | Method and Description |
---|---|
protected void |
after() |
protected void |
before() |
E |
executor()
|
static ExecutorRule<Executor> |
newRule()
Create an
ExecutorRule with a default executor. |
static ExecutorRule<Executor> |
withExecutor(java.util.function.Supplier<Executor> executorSupplier)
Create an
ExecutorRule with the specified executor . |
static ExecutorRule<Executor> |
withNamePrefix(java.lang.String namePrefix)
Create an
ExecutorRule with a default executor, configured to prefix thread names
with namePrefix . |
static ExecutorRule<TestExecutor> |
withTestExecutor()
Create an
ExecutorRule with a TestExecutor . |
public static ExecutorRule<Executor> newRule()
ExecutorRule
with a default executor.ExecutorRule
.public static ExecutorRule<TestExecutor> withTestExecutor()
ExecutorRule
with a TestExecutor
.
executor()
will return the TestExecutor
to allow controlling the executor in tests.ExecutorRule
.public static ExecutorRule<Executor> withExecutor(java.util.function.Supplier<Executor> executorSupplier)
ExecutorRule
with the specified executor
.executorSupplier
- The Executor
Supplier
to use.ExecutorRule
.public static ExecutorRule<Executor> withNamePrefix(java.lang.String namePrefix)
ExecutorRule
with a default executor, configured to prefix thread names
with namePrefix
.namePrefix
- the name to prefix thread names with.ExecutorRule
.public E executor()
protected void before()
before
in class org.junit.rules.ExternalResource
protected void after()
after
in class org.junit.rules.ExternalResource