InternalMultiBucketAggregationTestCase
, InternalSingleBucketAggregationTestCase
public abstract class InternalAggregationTestCase<T extends InternalAggregation> extends AbstractWireSerializingTestCase<T>
ESTestCase.GeohashGenerator, ESTestCase.TestAnalysis
org.apache.lucene.util.LuceneTestCase.AwaitsFix, org.apache.lucene.util.LuceneTestCase.BadApple, org.apache.lucene.util.LuceneTestCase.Monster, org.apache.lucene.util.LuceneTestCase.Nightly, org.apache.lucene.util.LuceneTestCase.Slow, org.apache.lucene.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.util.LuceneTestCase.SuppressFsync, org.apache.lucene.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.util.LuceneTestCase.Weekly
Modifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_MAX_BUCKETS |
|
protected static double |
TOLERANCE |
NUMBER_OF_TEST_RUNS
checkIndexFailed, deprecationLogger, failureAndSuccessEvents, logger
assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_BADAPPLES, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_WEEKLY, VERBOSE
Constructor | Description |
---|---|
InternalAggregationTestCase() |
Modifier and Type | Method | Description |
---|---|---|
protected abstract void |
assertFromXContent(T aggregation,
ParsedAggregation parsedAggregation) |
|
static void |
assertMultiBucketConsumer(Aggregation agg,
MultiBucketConsumerService.MultiBucketConsumer bucketConsumer) |
|
protected abstract void |
assertReduced(T reduced,
java.util.List<T> inputs) |
|
T |
createTestInstance() |
Creates a random test instance to use in the tests.
|
protected abstract T |
createTestInstance(java.lang.String name,
java.util.List<PipelineAggregator> pipelineAggregators,
java.util.Map<java.lang.String,java.lang.Object> metaData) |
|
protected T |
createUnmappedInstance(java.lang.String name) |
Return an instance on an unmapped field.
|
protected T |
createUnmappedInstance(java.lang.String name,
java.util.List<PipelineAggregator> pipelineAggregators,
java.util.Map<java.lang.String,java.lang.Object> metaData) |
Return an instance on an unmapped field.
|
protected java.util.function.Predicate<java.lang.String> |
excludePathsFromXContentInsertion() |
Overwrite this in your test if other than the basic xContent paths should be excluded during insertion of random fields
|
static java.util.List<NamedXContentRegistry.Entry> |
getDefaultNamedXContents() |
|
protected NamedWriteableRegistry |
getNamedWriteableRegistry() |
Get the
NamedWriteableRegistry to use when de-serializing the object. |
protected java.util.List<NamedXContentRegistry.Entry> |
getNamedXContents() |
|
protected ScriptService |
mockScriptService() |
overwrite in tests that need it
|
protected <P extends ParsedAggregation> |
parseAndAssert(InternalAggregation aggregation,
boolean shuffled,
boolean addRandomFields) |
|
protected static DocValueFormat |
randomNumericDocValueFormat() |
|
void |
testFromXContent() |
|
void |
testFromXContentWithRandomFields() |
|
void |
testReduceRandom() |
|
protected NamedXContentRegistry |
xContentRegistry() |
The
NamedXContentRegistry to use for this test. |
copyInstance
assertEqualInstances, assertSerialization, assertSerialization, copyInstance, instanceReader, mutateInstance, testEqualsAndHashcode, testSerialization
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
after, afterIfFailed, afterIfSuccessful, assertAllIndicesRemovedAndDeletionCompleted, assertArrayEquals, assertBusy, assertBusy, assertEquals, assertEqualsWithErrorMessageFromXContent, assertPathHasBeenCleared, assertSettingDeprecationsAndWarnings, assertSettingDeprecationsAndWarnings, assertWarnings, awaitBusy, awaitBusy, before, between, buildNewFakeTransportAddress, checkStaticState, copyStreamable, copyWriteable, copyWriteable, createParser, createParser, createParser, createParser, createParser, createTestAnalysis, createTestAnalysis, createTestAnalysis, enableWarningsCheck, ensureAllSearchContextsReleased, ensureCheckIndexPassed, frequently, generateRandomStringArray, generateRandomStringArray, getBwcIndicesPath, getDataPath, getSuiteFailureMarker, getTestTransportPlugin, getTestTransportType, iterations, maybeSet, mockScript, newNodeEnvironment, newNodeEnvironment, newTestIndicesModule, newTestScriptModule, randomAlphaOfLength, randomAlphaOfLengthBetween, randomBoolean, randomByte, randomByteArrayOfLength, randomDateTimeZone, randomDouble, randomDoubleBetween, randomFloat, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomGeohash, randomInt, randomInt, randomIntBetween, randomLong, randomLongBetween, randomNonNegativeLong, randomPositiveTimeValue, randomRealisticUnicodeOfCodepointLength, randomRealisticUnicodeOfCodepointLengthBetween, randomRealisticUnicodeOfLength, randomRealisticUnicodeOfLengthBetween, randomShort, randomSubsetOf, randomSubsetOf, randomSubsetOf, randomTimeValue, randomTimeValue, randomTimeValue, randomTimeZone, randomUnicodeOfCodepointLength, randomUnicodeOfCodepointLengthBetween, randomUnicodeOfLength, randomUnicodeOfLengthBetween, randomUnique, randomValueOtherThan, randomValueOtherThanMany, resetCheckIndexStatus, resetPortCounter, restoreContentType, restoreFileSystem, scaledRandomIntBetween, setContentType, setFileSystem, settings, setUseNio, shuffleMap, shuffleXContent, shuffleXContent, spinForAtLeastNMilliseconds, spinForAtLeastOneMillisecond, terminate, terminate, tmpPaths, toShuffledXContent, toShuffledXContent, writableRegistry
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertFieldsEquals, assertFieldStatisticsEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, expectThrows, expectThrows, getBaseTempDirForTestClass, getDataInputStream, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, restoreSpins, runWithRestrictedPermissions, setIndexWriterMaxDocs, setUp, setupCPUCoreCount, setupSpins, slowFileExists, tearDown, usually, usually, wrapReader
public static final int DEFAULT_MAX_BUCKETS
protected static final double TOLERANCE
public static java.util.List<NamedXContentRegistry.Entry> getDefaultNamedXContents()
protected java.util.List<NamedXContentRegistry.Entry> getNamedXContents()
protected abstract T createTestInstance(java.lang.String name, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
protected T createUnmappedInstance(java.lang.String name, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
public void testReduceRandom()
protected ScriptService mockScriptService()
public final T createTestInstance()
AbstractWireTestCase
createTestInstance
in class AbstractWireTestCase<T extends InternalAggregation>
protected final T createUnmappedInstance(java.lang.String name)
protected NamedWriteableRegistry getNamedWriteableRegistry()
AbstractWireTestCase
NamedWriteableRegistry
to use when de-serializing the object.
Override this method if you need to register NamedWriteable
s for the test object to de-serialize.
By default this will return a NamedWriteableRegistry
with no registered NamedWriteable
sgetNamedWriteableRegistry
in class AbstractWireTestCase<T extends InternalAggregation>
protected NamedXContentRegistry xContentRegistry()
ESTestCase
NamedXContentRegistry
to use for this test. Subclasses should override and use liberally.xContentRegistry
in class ESTestCase
public final void testFromXContent() throws java.io.IOException
java.io.IOException
public final void testFromXContentWithRandomFields() throws java.io.IOException
java.io.IOException
protected abstract void assertFromXContent(T aggregation, ParsedAggregation parsedAggregation) throws java.io.IOException
java.io.IOException
protected <P extends ParsedAggregation> P parseAndAssert(InternalAggregation aggregation, boolean shuffled, boolean addRandomFields) throws java.io.IOException
java.io.IOException
protected java.util.function.Predicate<java.lang.String> excludePathsFromXContentInsertion()
protected static DocValueFormat randomNumericDocValueFormat()
DocValueFormat
that can be used in aggregations which
compute numbers.public static void assertMultiBucketConsumer(Aggregation agg, MultiBucketConsumerService.MultiBucketConsumer bucketConsumer)