public static final class FailOnTimeout.Builder extends Object
FailOnTimeout
.Modifier and Type | Method and Description |
---|---|
FailOnTimeout |
build(org.junit.runners.model.Statement statement)
Builds a
FailOnTimeout instance using the values in this builder,
wrapping the given statement. |
FailOnTimeout.Builder |
withLookingForStuckThread(boolean enable)
Specifies whether to look for a stuck thread.
|
FailOnTimeout.Builder |
withTimeout(long timeout,
TimeUnit unit)
Specifies the time to wait before timing out the test.
|
public FailOnTimeout.Builder withTimeout(long timeout, TimeUnit unit)
If this is not called, or is called with a timeout
of
0
, the returned Statement
will wait forever for the
test to complete, however the test will still launch from a separate
thread. This can be useful for disabling timeouts in environments
where they are dynamically set based on some property.
timeout
- the maximum time to waitunit
- the time unit of the timeout
argumentthis
for method chaining.public FailOnTimeout.Builder withLookingForStuckThread(boolean enable)
enable
- true
to enable the featurethis
for method chaining.public FailOnTimeout build(org.junit.runners.model.Statement statement)
FailOnTimeout
instance using the values in this builder,
wrapping the given statement.statement
- Copyright © 2021 SPF4J. All rights reserved.