public final class RandomizedContext extends Object
RandomizedRunner
.Modifier and Type | Method and Description |
---|---|
<T extends Closeable> |
closeAtEnd(T resource,
LifecycleScope scope)
Dispose the given resource at the end of a given lifecycle scope.
|
static RandomizedContext |
current() |
com.carrotsearch.randomizedtesting.GroupEvaluator |
getGroupEvaluator()
Provide access to
GroupEvaluator . |
Random |
getRandom()
A shorthand for calling
getRandomness() and then Randomness.getRandom() . |
Randomness |
getRandomness()
Source of randomness for the context's thread.
|
RandomizedRunner |
getRunner()
Access to the runner governing this context.
|
String |
getRunnerSeedAsString()
Returns the runner's master seed, formatted.
|
Class<?> |
getTargetClass()
The class (suite) being tested.
|
boolean |
isNightly()
Return
true if tests are running in nightly mode. |
public Class<?> getTargetClass()
public String getRunnerSeedAsString()
public Randomness getRandomness()
public Random getRandom()
getRandomness()
and then Randomness.getRandom()
.public boolean isNightly()
true
if tests are running in nightly mode.public static RandomizedContext current()
IllegalStateException
if the thread is out of scope.IllegalStateException
- If context is not available.public RandomizedRunner getRunner()
public <T extends Closeable> T closeAtEnd(T resource, LifecycleScope scope)
Closeable
throws an exception, the test case or suite will end in a failure.resource
(for call chaining).public com.carrotsearch.randomizedtesting.GroupEvaluator getGroupEvaluator()
GroupEvaluator
.Copyright © 2011–2015 Carrot Search s.c.. All rights reserved.