All Classes and Interfaces
Class
Description
A resettable InputStream that only serves zeros.
Tests for
XContent
filtering.Base class for test fixtures that requires a
HttpServer
to work.Represents an HTTP Request.
Represents an HTTP Response.
Abstract base class for tests against
IndicesClusterStateService
Standard test case for testing the wire serialization of subclasses of NamedWriteable.
Abstract test case for testing NXY significant term heuristics
Tests a query vector builder
this base class acts as a wrapper for testing different rerankers, and their behavior when exceptions are thrown
the main idea is that we:
- index some documents, with a rank feature field and a search field
- have a random initial scoring
- rerank the results based on the rank feature field (converting String -> Float)
- assert that the results are correctly reranked and that we properly close all resources
Abstract test case for testing significant term heuristics
Standard test case for testing the wire serialization of subclasses of Writeable.
Standard test case for testing wire serialization.
Tests converting to and from xcontent.
Test utilities for working with
ActionListener
s.Base class for testing
Aggregator
implementations.Alerts us if new analysis components are added to Lucene, so we don't miss them.
Marker class for components that have moved to the analysis-common modules.
Test case ordering to be used in conjunction with
TestCaseOrdering
.Wraps a
RecoveryTarget
to make all remote calls to be executed asynchronously using the provided executor
.Collection of tests that can be applied to both geographic and cartesian coordinate data.
Collection of tests that can be applied to both geographic and cartesian coordinate data.
Test utility class to suppress assertions about the integrity of the contents of a blobstore repository, in order to verify the
production behaviour on encountering invalid data.
Initializes natives and installs test security manager
(init'd early by base classes to ensure it happens regardless of which
test case happens to be first, test ordering, etc).
Utilities for copying and mutating Build instances in tests.
Equality matcher for
ByteSizeValue
that has a nice description of failures.Utility plugin that captures the invocation of an action on a node after the task has been registered with the
TaskManager
,
cancels it (e.g.A transport class that doesn't send anything but rather captures all requests for inspection from tests
Integration Test for CartesianCentroid metric aggregator
Test utilities for working with
CheckedFunction
s and CheckedSupplier
s.Utility for capturing and decoding the data logged by a
ChunkedLoggingStream
.An abstract test case to ensure correct behavior of Diffable.
Adapter to make one or more
TestCluster
instances compatible with things like try-with-resources blocks and IOUtils.Utilities for invoking
TransportClusterRerouteAction
in tests.Helper methods for generating cluster states
Utilities for running a
ClusterStateTaskExecutor
in tests.A base test case for cli tools.
This plugin is used to register the
SearchService.MINIMUM_DOCS_PER_SLICE
setting.CircuitBreakerService
that fails one twentieth of the time when you
add bytes.Allows configuring behavior of data generation components.
This class handles any decision performed during data generation that changes the output.
Some tests are specific to geographic test cases, notably those involving special behaviour
regarding the international data line.
Permits the testing of async processes by interleaving all the tasks on a single thread in a pseudo-random (deterministic) fashion,
letting each task spawn future tasks, and simulating the passage of time.
Utilities that simplify testing of diffable classes
An integration test case that allows mocking the disk usage per node.
Response type from
DisruptableMockTransport.getConnectionStatus(DiscoveryNode)
indicating whether, and how, messages should
be disrupted on this transport.When simulating sending requests to another node which might have rebooted, it's not realistic just to drop the action if the node
reboots; instead we need to simulate the error response that comes back.
A tuple of document id, sequence number, primary term, source and version of a document
Generator that generates a valid random document that follows the structure of provided
Template
.A transport request with an empty payload.
A test class which contains a singleton instance of the
SystemIndices
class that has been created with no
non-standard system indices defined except for those defined within the class itself.Enum serialization via
StreamOutput.writeEnum(E)
and StreamInput.readEnum(Class)
uses the enum value's ordinal on the wire.Utility class that encapsulates standard checks and assertions around testing the equals() and hashCode()
methods of objects that implement them.
A function that makes a copy of its input argument
A function that creates a copy of its input argument that is different from its
input in exactly one aspect (e.g.
Mocks behavior in ReplicaShardAllocator to remove delayed shards from list of unassigned shards so they don't get reassigned yet.
A lock
AllocationService
allowing tests to override timeExtends Lucene's BaseDirectoryTestCase with ES test behavior.
Integration tests for
BlobStoreRepository
implementations.Test harness for verifying
IndexInput
implementations.ESIntegTestCase
is an abstract base class to run integration
tests against a JVM private Elasticsearch Cluster.Defines a cluster scope for a
ESIntegTestCase
subclass.The scope of a test cluster used together with
ESIntegTestCase.ClusterScope
annotations on ESIntegTestCase
subclasses.If a test is annotated with
ESIntegTestCase.SuiteScopeTestCase
the checks and modifications that are applied to the used test cluster are only done after all tests
of this class are executed.Integration tests for
BlobStoreRepository
implementations rely on mock APIs that emulate cloud-based services.A
HttpHandler
that allows to list stored blobsHTTP handler that injects random service errors
Note: it is not a good idea to allow this handler to simulate too many errors as it would
slow down the test suite.
HTTP handler that allows collect request stats per request type.
Superclass for tests that interact with an external test cluster using Elasticsearch's
RestClient
.Helper class to check warnings in REST responses with sensitivity to versions
used in the target cluster.
A test that keep a singleton node started for all tests that can be used to get
references to Guice injectors in unit tests.
Base testcase for randomized unit testing with Elasticsearch
This cute helper class just holds all analysis building blocks that are used
to build IndexAnalyzers.
Marks a test suite or a test method that should run without security manager enabled.
Deprecated, for removal: This API element is subject to removal in a future version.
Query simulating serialization error on versions earlier than CURRENT
A transport that does nothing.
Utilities for parsing field_caps responses for test purposes.
Entity responsible for generating a valid value for a field.
Lists all leaf field types that are supported for data generation.
Base test case for subclasses of MappedFieldType
The GraalVM spawns extra threads, which causes our thread leak
detection to fail.
A HTTP "Content Range"
A base class for unit tests that need to create and shutdown
IndexShard
instances easily,
containing utilities for shard creation and recoveries.Utils for creating/retrieving/deleting ingest pipelines in a test cluster.
Adds an ingest processor to be used in tests.
An in-memory java source code compiler.
Enum with the different types for use as keys.
Implementors of this test case should be aware that the aggregation under test needs to be registered
in the test's namedWriteableRegistry.
InternalTestCluster manages a set of JVM private nodes and allows convenient access to them.
An abstract class that is called during
InternalTestCluster.rollingRestart(InternalTestCluster.RestartCallback)
and / or InternalTestCluster.fullRestart(InternalTestCluster.RestartCallback)
to execute actions at certain
stages of the restart.Represents a single log line in a json format.
Tests that extend this class verify that all json layout fields appear in the first few log lines after startup
Fields available upon process startup:
type
, timestamp
, level
, component
,
message
, node.name
, cluster.name
.Returns a stream of json log lines.
Provides access to all known index versions
Basic implementation of the Wing and Gong Graph Search Algorithm, following the descriptions in
Gavin Lowe: Testing for linearizability
Concurrency and Computation: Practice and Experience 29, 4 (2017).
Sequence of invocations and responses, recording the run of a concurrent system.
Sequential specification of a datatype that allows for keyed access,
providing compositional checking (see
LinearizabilityChecker.SequentialSpec.partition(List)
).This exception is thrown if the check could not be completed due to timeout or OOM (that could be caused by long event history)
Sequential specification of a datatype.
Matcher for
Lists
that reports all errors at once.A
RunListener
that allows changing the log level for a specific test method.Matcher for
Maps
that reports all errors at once.Test case that lets you easilly build
MapperService
based on some
mapping.Base class for testing
Mapper
s.This record encapsulates the test configuration for testing block loaders (used in ES|QL).
An example of a malformed value.
Contains generated mapping and supporting data.
Generator that generates a valid random mapping that follows the structure of provided
Template
.A base class to be used for the matching logic when comparing query results.
A single measurement from an
Instrument
.Maintains the method of writing cluster states to disk for versions prior to
Version.V_7_6_0
, preserved to test the classes that
read this state during an upgrade from these older versions.Container for registered Instruments (either
Instrument
or Otel's versions).A mocked script used for testing purposes.
A plugin to use
MockEngineFactory
.Support class to build MockEngines like
MockInternalEngine
since they need to subclass the actual engineGatewayMetaState
constructor accepts a lot of arguments.A dummy http transport used by tests when not wanting to actually bind to a real address.
Marker plugin used by
MockNode
to enable MockHttpTransport
.This is a testing plugin that registers a generic
MockIndexEventListener.TestEventListener
as a node level service
as well as a listener on every index.This is a marker plugin used to trigger MockNode to use this mock info service.
Some tests rely on the keyword tokenizer, but this tokenizer isn't part of lucene-core and therefor not available
in some modules.
Test appender that can be used to verify that certain events were logged correctly
Keeps track of whether the
LogEvent
instances it receives match the expected content.A node for testing which allows:
Overriding Version.CURRENT
Adding test plugins that exist on the classpath
Swapping in various mock services
Marker plugin used by
MockNode
to enable MockReadinessService
.A mocked script engine that can be used for testing purpose.
A non-typed compiler for a single custom context
A script plugin that uses
MockScriptEngine
as the script engine for tests.Marker plugin used by
MockNode
to enable MockScriptService
.Marker plugin used by
MockNode
to enable MockSearchService
.A mock implementation of secure settings for tests to use.
A mock task manager that allows adding listeners for events
Listener for task registration/unregistration
A terminal for tests which captures all output, and
can be plugged with fake input.
A basic transport implementation that allows to intercept requests that have been sent
A mock delegate service that allows to simulate different network topology failures.
Utilities for setting up Mockito mocks.
Base testcase for testing
Module
implementations.A formatter that allows named placeholders e.g.
Excludes threads started by
GlobalEventExecutor
which are static per-JVM and reused across test suits.Annotation used to set if internet network connectivity is required to run the test.
Network disruptions are modeled using two components:
1) the
NetworkDisruption.DisruptedLinks
represents the links in the network that are to be disrupted
2) the NetworkDisruption.NetworkLinkDisruptionType
represents the failure mode that is to be applied to the linksCreates two partitions with symmetric failures and a bridge node that can connect to both of the partitions
Represents a set of nodes with connections between nodes that are to be disrupted
Simulates slow or congested network.
Abstract class representing various types of network disruptions.
Creates two partitions with symmetric failures
Utility methods for creating
Settings
instances defining a set of DiscoveryNodeRole
.Client that always responds with
null
to every request.Client that always response with
null
to every request.Builds a message describing how two sets of values are unequal.
Holds an object and allows extraction of specific values from it, given their path
Exposes some package private stuff in PathUtils for framework purposes only!
Utility methods for testing plugins
Stores the posix attributes for a path and resets them on close.
A small set of privileged operations that can be executed by unprivileged test code.
Random geo generation utilities for randomized
geo_point
type testing
does not depend on jts or spatial4j.A
Client
that randomizes request parameters.Builds random search requests.
Utility class for checking that objects become unreachable when expected.
Helper test interface that provides basic socket connect functionality to
the readiness service for testing purposes
Recording versions of Elasticsearch
Instrument
s.A
MeterRegistry
that records all instrument invocations.Allows one node in an integ test to delay the application of cluster states on another node until a recovery starts, without unduly
delaying other cluster states.
Example usage:
assertThat(actualRectangle, RectangleMatcher.closeTo(expectedRectangle, 0.0001, PointType.CARTESIAN));
, or it
can be used as a parameter to WellKnownBinaryBytesRefMatcher
.A fake
RemoteClusterClient
which just runs actions on the local cluster, like a NodeClient
, for use in tests.Adapter to use a
RefCounted
in a try-with-resources block.The types of blobs in a
BlobStoreRepository
.A
RunListener
that emits a command you can use to re-run a failing test with the failing random seed to
System.err
.A common base class for Rest*ActionTests.
A mocked
NodeClient
which can be easily reconfigured to verify arbitrary verification
functions, and can be reset to allow reconfiguration partway through a test without having to construct a new object.A test case with access to internals of a RestClient.
A dummy repository for testing which just needs restore overridden
Adapts a
CheckedRunnable
to a JUnit TestRule
.A float encapsulation that dynamically accesses the score of a document.
A
MockMaker
that works with SecurityManager
.A wrapper around the default provider which itself just wraps
Instantiator
instances to play nice with SecurityManager
.generates random cartesian shapes
A helper class that allows access to package private APIs for testing.
An abstract test case to ensure correct behavior of Diffable.
An abstract test case to ensure correct behavior of Diffable.
Test rule to process skip_unavailable override annotations
Annotation to mark specific cluster in a test as not to be skipped when unavailable
This interface allows tests to abstract away which exact QueryBuilder is used in the tests.
Allows to cache the last obtained test response and or part of it within variables
that can be used as input values in following requests and assertions.
Wrapper around an
ExecutorService
which fakes responses to shutdown-related methods.Helper class to expose
CancellableTask.cancel(java.lang.String)
for use in tests.A template used to generate mapping and documents for a test.
Base test cluster that exposes the basis to run tests against any elasticsearch cluster, whose layout
(e.g.
When using shared test clusters we launch processes that persist across test suites.
Simplified version of
DocumentParserContext
to be used in tests.Provides a convenience method for tests to construct an Environment when the config path does not matter.
A gateway allocator implementation that keeps an in memory list of started shard allocation
that are used as replies to the, normally async, fetch data requests.
A utility class that simplifies the creation of
IndexNameExpressionResolver
instances in tests to avoid repetition of
creating the constructor arguments for a default instance.Construct ingest documents for testing purposes
Annotation used to set a custom log level when investigating test failures.
Annotation used to set a custom log level for controlling logging behavior in tests.
A
PlainActionFuture
which bypasses the deadlock-detection checks since we're only using this in tests.Processor used for testing, keeps track of how many times it is invoked and
accepts a
Consumer
of IngestDocument
to be called when executed.Test retriever is used to test parsing of retrievers in plugins where
generation of other random retrievers are not easily accessible through test code.
A helper that allows to create shard routing instances within tests, while not requiring to expose
different simplified constructors on the ShardRouting itself.
TelemetryPlugin that uses RecordingMeterRegistry to record meter calls
and exposes measurement getters.
Converts
%test_thread_info
in log4j patterns into information
based on the loggin thread's name.Provides functionality needed to test synthetic source support in text and text-like fields (e.g.
An FilterLeafReader that allows to throw exceptions if certain methods
are called on is.
Flags passed to
ThrowingLeafReaderWrapper.Thrower.maybeThrow(org.elasticsearch.test.engine.ThrowingLeafReaderWrapper.Flags)
when the corresponding method is called.A callback interface that allows to throw certain exceptions for
methods called on the IndexReader that is wrapped by
ThrowingLeafReaderWrapper
Wraps a Fields but with additional asserts
Wraps a Terms but with additional asserts
Utilities for selecting versions in tests
A wrapper for matching geometries encoded as WKB in a BytesRef.
generates random cartesian geometry; heavy reuse of
GeoTestUtil
A
BytesReference
of the given length which contains all zeroes.
ESIntegTestCase
for internal-cluster tests orESRestTestCase
otherwise.