Package org.apache.lucene.tests.index
Class BaseDocValuesFormatTestCase
- java.lang.Object
- 
- org.junit.Assert
- 
- org.apache.lucene.tests.util.LuceneTestCase
- 
- org.apache.lucene.tests.index.BaseDocValuesFormatTestCase
 
 
 
- 
- Direct Known Subclasses:
- BaseCompressingDocValuesFormatTestCase
 
 public abstract class BaseDocValuesFormatTestCase extends LuceneTestCase Abstract class to do basic tests for a docvalues format. NOTE: This test focuses on the docvalues impl, nothing else. The [stretch] goal is for this test to be so thorough in testing a new DocValuesFormat that if this test passes, then all Lucene/Solr tests should also pass. Ie, if there is some bug in a given DocValuesFormat that this test fails to catch then this test needs to be improved!
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.lucene.tests.util.LuceneTestCaseLuceneTestCase.AwaitsFix, LuceneTestCase.BadApple, LuceneTestCase.Monster, LuceneTestCase.Nightly, LuceneTestCase.SuppressCodecs, LuceneTestCase.SuppressFileSystems, LuceneTestCase.SuppressFsync, LuceneTestCase.SuppressReproduceLine, LuceneTestCase.SuppressSysoutChecks, LuceneTestCase.SuppressTempFileChecks, LuceneTestCase.ThrowingConsumer<T>, LuceneTestCase.ThrowingRunnable, LuceneTestCase.Weekly
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.lucene.tests.util.LuceneTestCaseassertsAreEnabled, 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_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_THROTTLING, TEST_WEEKLY, VERBOSE
 
- 
 - 
Constructor SummaryConstructors Constructor Description BaseDocValuesFormatTestCase()
 - 
Method Summary- 
Methods inherited from class org.apache.lucene.tests.util.LuceneTestCaseaddVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getDataInputStream, getDataPath, getJvmForkArguments, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newSearcher, newSnapshotIndexWriterConfig, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setupCPUCoreCount, setUpExecutorService, shutdownExecutorService, slowFileExists, usually, usually, wrapReader
 - 
Methods inherited from class org.junit.AssertassertArrayEquals, 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, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
 
- 
 
- 
- 
- 
Method Detail- 
addRandomFieldsprotected void addRandomFields(Document doc) Add random fields to the provided document.
 - 
testOneNumberpublic void testOneNumber() throws IOException- Throws:
- IOException
 
 - 
testOneFloatpublic void testOneFloat() throws IOException- Throws:
- IOException
 
 - 
testTwoNumberspublic void testTwoNumbers() throws IOException- Throws:
- IOException
 
 - 
testTwoBinaryValuespublic void testTwoBinaryValues() throws IOException- Throws:
- IOException
 
 - 
testVariouslyCompressibleBinaryValuespublic void testVariouslyCompressibleBinaryValues() throws IOException- Throws:
- IOException
 
 - 
testTwoFieldsMixedpublic void testTwoFieldsMixed() throws IOException- Throws:
- IOException
 
 - 
testThreeFieldsMixedpublic void testThreeFieldsMixed() throws IOException- Throws:
- IOException
 
 - 
testThreeFieldsMixed2public void testThreeFieldsMixed2() throws IOException- Throws:
- IOException
 
 - 
testTwoDocumentsNumericpublic void testTwoDocumentsNumeric() throws IOException- Throws:
- IOException
 
 - 
testTwoDocumentsMergedpublic void testTwoDocumentsMerged() throws IOException- Throws:
- IOException
 
 - 
testBigNumericRangepublic void testBigNumericRange() throws IOException- Throws:
- IOException
 
 - 
testBigNumericRange2public void testBigNumericRange2() throws IOException- Throws:
- IOException
 
 - 
testBytespublic void testBytes() throws IOException- Throws:
- IOException
 
 - 
testBytesTwoDocumentsMergedpublic void testBytesTwoDocumentsMerged() throws IOException- Throws:
- IOException
 
 - 
testBytesMergeAwayAllValuespublic void testBytesMergeAwayAllValues() throws IOException- Throws:
- IOException
 
 - 
testSortedBytespublic void testSortedBytes() throws IOException- Throws:
- IOException
 
 - 
testSortedBytesTwoDocumentspublic void testSortedBytesTwoDocuments() throws IOException- Throws:
- IOException
 
 - 
testSortedBytesThreeDocumentspublic void testSortedBytesThreeDocuments() throws IOException- Throws:
- IOException
 
 - 
testSortedBytesTwoDocumentsMergedpublic void testSortedBytesTwoDocumentsMerged() throws IOException- Throws:
- IOException
 
 - 
testSortedMergeAwayAllValuespublic void testSortedMergeAwayAllValues() throws IOException- Throws:
- IOException
 
 - 
testBytesWithNewlinepublic void testBytesWithNewline() throws IOException- Throws:
- IOException
 
 - 
testMissingSortedBytespublic void testMissingSortedBytes() throws IOException- Throws:
- IOException
 
 - 
testSortedTermsEnumpublic void testSortedTermsEnum() throws IOException- Throws:
- IOException
 
 - 
testEmptySortedBytespublic void testEmptySortedBytes() throws IOException- Throws:
- IOException
 
 - 
testEmptyBytespublic void testEmptyBytes() throws IOException- Throws:
- IOException
 
 - 
testVeryLargeButLegalBytespublic void testVeryLargeButLegalBytes() throws IOException- Throws:
- IOException
 
 - 
testVeryLargeButLegalSortedBytespublic void testVeryLargeButLegalSortedBytes() throws IOException- Throws:
- IOException
 
 - 
testCodecUsesOwnBytespublic void testCodecUsesOwnBytes() throws IOException- Throws:
- IOException
 
 - 
testCodecUsesOwnSortedBytespublic void testCodecUsesOwnSortedBytes() throws IOException- Throws:
- IOException
 
 - 
testDocValuesSimplepublic void testDocValuesSimple() throws IOException- Throws:
- IOException
 
 - 
testRandomSortedBytespublic void testRandomSortedBytes() throws IOException- Throws:
- IOException
 
 - 
assertDVIterateprotected void assertDVIterate(Directory dir) throws IOException - Throws:
- IOException
 
 - 
testBooleanNumericsVsStoredFieldspublic void testBooleanNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseBooleanNumericsVsStoredFieldspublic void testSparseBooleanNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testByteNumericsVsStoredFieldspublic void testByteNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseByteNumericsVsStoredFieldspublic void testSparseByteNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testShortNumericsVsStoredFieldspublic void testShortNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseShortNumericsVsStoredFieldspublic void testSparseShortNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testIntNumericsVsStoredFieldspublic void testIntNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseIntNumericsVsStoredFieldspublic void testSparseIntNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testLongNumericsVsStoredFieldspublic void testLongNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseLongNumericsVsStoredFieldspublic void testSparseLongNumericsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testBinaryFixedLengthVsStoredFieldspublic void testBinaryFixedLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseBinaryFixedLengthVsStoredFieldspublic void testSparseBinaryFixedLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testBinaryVariableLengthVsStoredFieldspublic void testBinaryVariableLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseBinaryVariableLengthVsStoredFieldspublic void testSparseBinaryVariableLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
doTestBinaryVariableLengthVsStoredFieldspublic void doTestBinaryVariableLengthVsStoredFields(double density) throws Exception- Throws:
- Exception
 
 - 
doTestSortedVsStoredFieldsprotected void doTestSortedVsStoredFields(int numDocs, double density, Supplier<byte[]> bytes) throws Exception- Throws:
- Exception
 
 - 
testSortedFixedLengthVsStoredFieldspublic void testSortedFixedLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseSortedFixedLengthVsStoredFieldspublic void testSparseSortedFixedLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedVariableLengthVsStoredFieldspublic void testSortedVariableLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSparseSortedVariableLengthVsStoredFieldspublic void testSparseSortedVariableLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
doTestSortedVsStoredFieldsprotected void doTestSortedVsStoredFields(int numDocs, double density, int minLength, int maxLength) throws Exception- Throws:
- Exception
 
 - 
testSortedSetOneValuepublic void testSortedSetOneValue() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTwoFieldspublic void testSortedSetTwoFields() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTwoDocumentsMergedpublic void testSortedSetTwoDocumentsMerged() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTwoValuespublic void testSortedSetTwoValues() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTwoValuesUnorderedpublic void testSortedSetTwoValuesUnordered() throws IOException- Throws:
- IOException
 
 - 
testSortedSetThreeValuesTwoDocspublic void testSortedSetThreeValuesTwoDocs() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTwoDocumentsLastMissingpublic void testSortedSetTwoDocumentsLastMissing() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTwoDocumentsLastMissingMergepublic void testSortedSetTwoDocumentsLastMissingMerge() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTwoDocumentsFirstMissingpublic void testSortedSetTwoDocumentsFirstMissing() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTwoDocumentsFirstMissingMergepublic void testSortedSetTwoDocumentsFirstMissingMerge() throws IOException- Throws:
- IOException
 
 - 
testSortedSetMergeAwayAllValuespublic void testSortedSetMergeAwayAllValues() throws IOException- Throws:
- IOException
 
 - 
testSortedSetTermsEnumpublic void testSortedSetTermsEnum() throws IOException- Throws:
- IOException
 
 - 
doTestSortedSetVsStoredFieldsprotected void doTestSortedSetVsStoredFields(int numDocs, int minLength, int maxLength, int maxValuesPerDoc, int maxUniqueValues) throws Exception- Throws:
- Exception
 
 - 
testSortedSetFixedLengthVsStoredFieldspublic void testSortedSetFixedLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedNumericsSingleValuedVsStoredFieldspublic void testSortedNumericsSingleValuedVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedNumericsSingleValuedMissingVsStoredFieldspublic void testSortedNumericsSingleValuedMissingVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedNumericsMultipleValuesVsStoredFieldspublic void testSortedNumericsMultipleValuesVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedNumericsFewUniqueSetsVsStoredFieldspublic void testSortedNumericsFewUniqueSetsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedSetVariableLengthVsStoredFieldspublic void testSortedSetVariableLengthVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedSetFixedLengthSingleValuedVsStoredFieldspublic void testSortedSetFixedLengthSingleValuedVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedSetVariableLengthSingleValuedVsStoredFieldspublic void testSortedSetVariableLengthSingleValuedVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedSetFixedLengthFewUniqueSetsVsStoredFieldspublic void testSortedSetFixedLengthFewUniqueSetsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedSetVariableLengthFewUniqueSetsVsStoredFieldspublic void testSortedSetVariableLengthFewUniqueSetsVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedSetVariableLengthManyValuesPerDocVsStoredFieldspublic void testSortedSetVariableLengthManyValuesPerDocVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testSortedSetFixedLengthManyValuesPerDocVsStoredFieldspublic void testSortedSetFixedLengthManyValuesPerDocVsStoredFields() throws Exception- Throws:
- Exception
 
 - 
testTwoNumbersOneMissingpublic void testTwoNumbersOneMissing() throws IOException- Throws:
- IOException
 
 - 
testTwoNumbersOneMissingWithMergingpublic void testTwoNumbersOneMissingWithMerging() throws IOException- Throws:
- IOException
 
 - 
testThreeNumbersOneMissingWithMergingpublic void testThreeNumbersOneMissingWithMerging() throws IOException- Throws:
- IOException
 
 - 
testTwoBytesOneMissingpublic void testTwoBytesOneMissing() throws IOException- Throws:
- IOException
 
 - 
testTwoBytesOneMissingWithMergingpublic void testTwoBytesOneMissingWithMerging() throws IOException- Throws:
- IOException
 
 - 
testThreeBytesOneMissingWithMergingpublic void testThreeBytesOneMissingWithMerging() throws IOException- Throws:
- IOException
 
 - 
testThreadspublic void testThreads() throws ExceptionTests dv against stored fields with threads (binary/numeric/sorted, no missing)- Throws:
- Exception
 
 - 
testThreads2@Nightly public void testThreads2() throws Exception Tests dv against stored fields with threads (all types + missing)- Throws:
- Exception
 
 - 
testEmptyBinaryValueOnPageSizespublic void testEmptyBinaryValueOnPageSizes() throws Exception- Throws:
- Exception
 
 - 
testOneSortedNumberpublic void testOneSortedNumber() throws IOException- Throws:
- IOException
 
 - 
testOneSortedNumberOneMissingpublic void testOneSortedNumberOneMissing() throws IOException- Throws:
- IOException
 
 - 
testNumberMergeAwayAllValuespublic void testNumberMergeAwayAllValues() throws IOException- Throws:
- IOException
 
 - 
testTwoSortedNumberpublic void testTwoSortedNumber() throws IOException- Throws:
- IOException
 
 - 
testTwoSortedNumberSameValuepublic void testTwoSortedNumberSameValue() throws IOException- Throws:
- IOException
 
 - 
testTwoSortedNumberOneMissingpublic void testTwoSortedNumberOneMissing() throws IOException- Throws:
- IOException
 
 - 
testSortedNumberMergepublic void testSortedNumberMerge() throws IOException- Throws:
- IOException
 
 - 
testSortedNumberMergeAwayAllValuespublic void testSortedNumberMergeAwayAllValues() throws IOException- Throws:
- IOException
 
 - 
testSortedEnumAdvanceIndependentlypublic void testSortedEnumAdvanceIndependently() throws IOException- Throws:
- IOException
 
 - 
testSortedSetEnumAdvanceIndependentlypublic void testSortedSetEnumAdvanceIndependently() throws IOException- Throws:
- IOException
 
 - 
doTestSortedSetEnumAdvanceIndependentlyprotected void doTestSortedSetEnumAdvanceIndependently(SortedSetDocValues dv) throws IOException - Throws:
- IOException
 
 - 
testSortedMergeAwayAllValuesLargeSegmentpublic void testSortedMergeAwayAllValuesLargeSegment() throws IOException- Throws:
- IOException
 
 - 
testSortedSetMergeAwayAllValuesLargeSegmentpublic void testSortedSetMergeAwayAllValuesLargeSegment() throws IOException- Throws:
- IOException
 
 - 
testNumericMergeAwayAllValuesLargeSegmentpublic void testNumericMergeAwayAllValuesLargeSegment() throws IOException- Throws:
- IOException
 
 - 
testSortedNumericMergeAwayAllValuesLargeSegmentpublic void testSortedNumericMergeAwayAllValuesLargeSegment() throws IOException- Throws:
- IOException
 
 - 
testBinaryMergeAwayAllValuesLargeSegmentpublic void testBinaryMergeAwayAllValuesLargeSegment() throws IOException- Throws:
- IOException
 
 - 
testRandomAdvanceNumericpublic void testRandomAdvanceNumeric() throws IOException- Throws:
- IOException
 
 - 
testRandomAdvanceBinarypublic void testRandomAdvanceBinary() throws IOException- Throws:
- IOException
 
 - 
testHighOrdsSortedSetDV@Nightly public void testHighOrdsSortedSetDV() throws Exception Tests where a DVField uses a high number of packed bits to store its ords. See: https://issues.apache.org/jira/browse/LUCENE-10159- Throws:
- Exception
 
 - 
codecAcceptsHugeBinaryValuesprotected boolean codecAcceptsHugeBinaryValues(String field) 
 - 
getCodecprotected abstract Codec getCodec() Returns the codec to run tests against
 - 
getCreatedVersionMajorprotected int getCreatedVersionMajor() Returns the major version that this codec is compatible with.
 - 
applyCreatedVersionMajorprotected final <D extends Directory> D applyCreatedVersionMajor(D d) throws IOException Set the created version of the givenDirectoryand return it.- Throws:
- IOException
 
 - 
setUppublic void setUp() throws ExceptionDescription copied from class:LuceneTestCaseFor subclasses to override. Overrides must callsuper.setUp().- Overrides:
- setUpin class- LuceneTestCase
- Throws:
- Exception
 
 - 
tearDownpublic void tearDown() throws ExceptionDescription copied from class:LuceneTestCaseFor subclasses to override. Overrides must callsuper.tearDown().- Overrides:
- tearDownin class- LuceneTestCase
- Throws:
- Exception
 
 - 
excludedExtensionsFromByteCountsprotected Collection<String> excludedExtensionsFromByteCounts() Return the list of extensions that should be excluded from byte counts when comparing indices that store the same content.
 - 
testMergeStabilitypublic void testMergeStability() throws ExceptionThe purpose of this test is to make sure that bulk merge doesn't accumulate useless data over runs.- Throws:
- Exception
 
 - 
mergeIsStableprotected boolean mergeIsStable() 
 - 
testMultiClosepublic void testMultiClose() throws IOExceptionCalls close multiple times on closeable codec apis- Throws:
- IOException
 
 - 
testRandomExceptionspublic void testRandomExceptions() throws ExceptionTests exception handling on write and openInput/createOutput- Throws:
- Exception
 
 - 
shouldTestMergeInstanceprotected boolean shouldTestMergeInstance() Returnsfalseif only the regular fields reader should be tested, andtrueif only the merge instance should be tested.
 - 
maybeWrapWithMergingReaderprotected final DirectoryReader maybeWrapWithMergingReader(DirectoryReader r) throws IOException - Throws:
- IOException
 
 - 
testCheckIntegrityReadsAllBytespublic void testCheckIntegrityReadsAllBytes() throws ExceptionThis test is a best effort at verifying that checkIntegrity doesn't miss any files. It tests that the combination of opening a reader and calling checkIntegrity on it reads all bytes of all files.- Throws:
- Exception
 
 
- 
 
-