Companion
Types
What level of concurrency is supported by the searcher being created
Properties
The default (embedded resource) lines file.
Enables or disables dumping of InfoStream messages.
Random sample from enwiki used in tests. See help/tests.txt. gradle task downloading this data set: gradlew getEnWikiRandomLines.
Leave temporary files on disk, even on successful runs.
A QueryCachingPolicy that randomly caches.
A random multiplier which you should use when writing random tests: multiply it by the number of iterations to scale your tests (for nightly builds).
Gets the codec to run tests with.
Gets the directory to run tests with
Gets the docValuesFormat to run tests with
The line file used in tests (by LineFileDocs).
Whether or not monster tests should run.
Whether or not Nightly tests should run.
Gets the postingsFormat to run tests with.
Whether or not Weekly tests should run.
Functions
checks that docvalues across all fields are equivalent
checks that norms are the same across all fields
checks that reader-level statistics are the same
checks that two stored fields are equivalent
checks that stored fields of all documents are the same
Fields api equivalency
checks that term vectors across all fields are equivalent
Inspects stack trace if the given class called us.
Inspects stack trace to figure out if a method of a specific class called us.
Inspects stack trace to figure out if one of the given method names (no class restriction) called us.
Creates an empty, temporary folder (when the name of the folder is of no importance).
Creates an empty, temporary folder with the given name prefix.
Creates an empty temporary file.
Creates an empty file with the given prefix and suffix.
Compute the default value of the random multiplier (based on .TEST_NIGHTLY).
Checks a specific exception class is thrown by the given runnable, and returns it.
Checks that specific wrapped and outer exception classes are thrown by the given runnable, and returns the wrapped exception.
Checks that one of the specified wrapped and outer exception classes are thrown by the given runnable, and returns the outer exception.
Checks a specific exception class is thrown by the given runnable, and returns it.
Some tests expect the directory to contain a single segment, and want to do tests on that segment's reader. This is an utility method to help them.
Sometimes wrap the IndexReader as slow, parallel or filter reader (or combinations of that)
Creates a random empty BytesRef that sometimes uses a non-zero offset, and non-zero end-padding, to tickle latent bugs that fail to look at BytesRef.offset.
Creates a random BytesRef from the incoming bytes that sometimes uses a non-zero offset, and non-zero end-padding, to tickle latent bugs that fail to look at BytesRef.offset.
Creates a random empty BytesRef, with at least the requested length of bytes free, that sometimes uses a non-zero offset, and non-zero end-padding, to tickle latent bugs that fail to look at BytesRef.offset.
Creates a BytesRef holding UTF-8 bytes for the incoming String, that sometimes uses a non-zero offset, and non-zero end-padding, to tickle latent bugs that fail to look at BytesRef.offset.
Creates a copy of the incoming BytesRef that sometimes uses a non-zero offset, and non-zero end-padding, to tickle latent bugs that fail to look at BytesRef.offset.
Creates a copy of the incoming bytes slice that sometimes uses a non-zero offset, and non-zero end-padding, to tickle latent bugs that fail to look at BytesRef.offset.
Returns a new Directory instance. Use this when the test does not care about the specific Directory implementation (most tests).
Returns a new Directory instance, using the specified random. See .newDirectory for more information.
Returns a new Directory instance, with contents copied from the provided directory. See .newDirectory for more information.
Returns a new Directory instance, using the specified random with contents copied from the provided directory. See .newDirectory for more information.
Returns a new FSDirectory instance over the given file, which must be a folder.
create a new index writer config with random defaults
create a new index writer config with random defaults using the specified random
TODO: javadoc
Create a new searcher over the reader. This searcher might randomly use threads.
Create a new searcher over the reader. This searcher might randomly use threads. if maybeWrap is true, this searcher might wrap the reader with one that returns null for getSequentialSubReaders. If wrapWithAssertions is true, this searcher might be an AssertingIndexSearcher instance.
Create a new searcher over the reader. If maybeWrap is true, this searcher might wrap the reader with one that returns null for getSequentialSubReaders. If wrapWithAssertions is true, this searcher might be an AssertingIndexSearcher instance. The searcher will use threads if useThreads * is set to true.
create a new index writer config with a snapshot deletion policy
Access to the current {@link RandomizedContext}'s Random instance. It is safe to use this method from multiple threads, etc., but it should be called while within a runner's scope (so no static initializers). The returned {@link Random} instance will be different when this method is called inside a {@link BeforeClass} hook (static suite scope) and within {@link Before}/ {@link After} hooks or test methods.
Fills provided char[] with valid random unicode code unit sequence.
Returns random string, including full unicode range.
Returns a random string up to a certain length.
Returns true if the file exists (can be opened), false if it cannot be opened, and throws IOException if there's some unexpected error.