From a94fbb79ac6e60c1ebfa76b24cab23fabcb60bbf Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Tue, 21 Dec 2021 20:30:45 +0100 Subject: [PATCH] LUCENE-10301: make the test-framework a proper module by moving all test classes to org.apache.lucene.tests.*. Also changes distribution layout (all modules are now under modules/). --- dev-tools/scripts/smokeTestRelease.py | 2 +- gradle/documentation/render-javadoc.gradle | 19 --- gradle/java/modules.gradle | 3 + gradle/testing/randomization.gradle | 4 +- .../randomization/policies/tests.policy | 3 - lucene/CHANGES.txt | 4 + lucene/MIGRATE.md | 7 + .../analysis/ar/TestArabicAnalyzer.java | 2 +- .../lucene/analysis/ar/TestArabicFilters.java | 2 +- .../ar/TestArabicNormalizationFilter.java | 4 +- .../analysis/ar/TestArabicStemFilter.java | 4 +- .../analysis/bg/TestBulgarianAnalyzer.java | 2 +- .../bg/TestBulgarianStemFilterFactory.java | 2 +- .../analysis/bg/TestBulgarianStemmer.java | 4 +- .../analysis/bn/TestBengaliAnalyzer.java | 2 +- .../analysis/bn/TestBengaliFilters.java | 2 +- .../analysis/bn/TestBengaliNormalizer.java | 4 +- .../analysis/bn/TestBengaliStemmer.java | 2 +- .../boost/TestDelimitedBoostTokenFilter.java | 2 +- .../analysis/br/TestBrazilianAnalyzer.java | 2 +- .../br/TestBrazilianStemFilterFactory.java | 4 +- .../analysis/ca/TestCatalanAnalyzer.java | 2 +- .../charfilter/TestHTMLStripCharFilter.java | 6 +- .../TestHTMLStripCharFilterFactory.java | 2 +- .../charfilter/TestMappingCharFilter.java | 6 +- .../TestMappingCharFilterFactory.java | 2 +- .../lucene/analysis/cjk/TestCJKAnalyzer.java | 4 +- .../analysis/cjk/TestCJKBigramFilter.java | 2 +- .../cjk/TestCJKBigramFilterFactory.java | 2 +- .../analysis/cjk/TestCJKWidthCharFilter.java | 4 +- .../cjk/TestCJKWidthCharFilterFactory.java | 2 +- .../analysis/cjk/TestCJKWidthFilter.java | 4 +- .../cjk/TestCJKWidthFilterFactory.java | 2 +- .../analysis/ckb/TestSoraniAnalyzer.java | 2 +- .../ckb/TestSoraniNormalizationFilter.java | 4 +- .../TestSoraniNormalizationFilterFactory.java | 2 +- .../analysis/ckb/TestSoraniStemFilter.java | 6 +- .../ckb/TestSoraniStemFilterFactory.java | 4 +- .../analysis/classic/TestClassicAnalyzer.java | 2 +- .../classic/TestClassicFactories.java | 2 +- .../commongrams/TestCommonGramsFilter.java | 4 +- .../TestCommonGramsFilterFactory.java | 4 +- .../TestCommonGramsQueryFilterFactory.java | 2 +- .../compound/TestCompoundWordTokenFilter.java | 4 +- ...tionaryCompoundWordTokenFilterFactory.java | 4 +- ...enationCompoundWordTokenFilterFactory.java | 4 +- .../core/TestAllAnalyzersHaveFactories.java | 28 ++-- .../lucene/analysis/core/TestAnalyzers.java | 2 +- .../analysis/core/TestBugInSomething.java | 10 +- .../analysis/core/TestCoreFactories.java | 2 +- .../analysis/core/TestDecimalDigitFilter.java | 6 +- .../core/TestDecimalDigitFilterFactory.java | 2 +- .../analysis/core/TestDuelingAnalyzers.java | 8 +- .../lucene/analysis/core/TestFactories.java | 6 +- .../analysis/core/TestFlattenGraphFilter.java | 8 +- .../analysis/core/TestKeywordAnalyzer.java | 4 +- .../analysis/core/TestKeywordTokenizer.java | 2 +- .../analysis/core/TestRandomChains.java | 16 +-- .../analysis/core/TestStopAnalyzer.java | 2 +- .../analysis/core/TestStopFilterFactory.java | 2 +- .../analysis/core/TestTypeTokenFilter.java | 4 +- .../core/TestTypeTokenFilterFactory.java | 4 +- .../core/TestUnicodeWhitespaceTokenizer.java | 2 +- .../analysis/core/TestWhitespaceAnalyzer.java | 2 +- .../analysis/custom/TestCustomAnalyzer.java | 2 +- .../lucene/analysis/cz/TestCzechAnalyzer.java | 2 +- .../cz/TestCzechStemFilterFactory.java | 4 +- .../lucene/analysis/cz/TestCzechStemmer.java | 4 +- .../analysis/da/TestDanishAnalyzer.java | 2 +- .../analysis/de/TestGermanAnalyzer.java | 2 +- .../de/TestGermanLightStemFilter.java | 6 +- .../de/TestGermanLightStemFilterFactory.java | 2 +- .../de/TestGermanMinimalStemFilter.java | 6 +- .../TestGermanMinimalStemFilterFactory.java | 4 +- .../de/TestGermanNormalizationFilter.java | 4 +- .../TestGermanNormalizationFilterFactory.java | 4 +- .../analysis/de/TestGermanStemFilter.java | 6 +- .../de/TestGermanStemFilterFactory.java | 4 +- .../lucene/analysis/el/TestGreekAnalyzer.java | 2 +- .../el/TestGreekLowerCaseFilterFactory.java | 2 +- .../el/TestGreekStemFilterFactory.java | 2 +- .../lucene/analysis/el/TestGreekStemmer.java | 2 +- .../email/TestUAX29URLEmailAnalyzer.java | 2 +- .../email/TestUAX29URLEmailTokenizer.java | 8 +- .../TestUAX29URLEmailTokenizerFactory.java | 2 +- .../analysis/en/TestEnglishAnalyzer.java | 2 +- .../en/TestEnglishMinimalStemFilter.java | 4 +- .../TestEnglishMinimalStemFilterFactory.java | 2 +- .../analysis/en/TestKStemFilterFactory.java | 2 +- .../lucene/analysis/en/TestKStemmer.java | 6 +- .../analysis/en/TestPorterStemFilter.java | 6 +- .../en/TestPorterStemFilterFactory.java | 2 +- .../analysis/es/TestSpanishAnalyzer.java | 2 +- .../es/TestSpanishLightStemFilter.java | 6 +- .../es/TestSpanishLightStemFilterFactory.java | 4 +- .../es/TestSpanishMinimalStemFilter.java | 4 +- .../TestSpanishMinimalStemFilterFactory.java | 4 +- .../es/TestSpanishPluralStemFilter.java | 6 +- .../TestSpanishPluralStemFilterFactory.java | 4 +- .../analysis/et/TestEstonianAnalyzer.java | 2 +- .../analysis/eu/TestBasqueAnalyzer.java | 2 +- .../analysis/fa/TestPersianAnalyzer.java | 2 +- .../analysis/fa/TestPersianCharFilter.java | 4 +- .../fa/TestPersianNormalizationFilter.java | 4 +- ...TestPersianNormalizationFilterFactory.java | 2 +- .../analysis/fi/TestFinnishAnalyzer.java | 2 +- .../fi/TestFinnishLightStemFilter.java | 6 +- .../fi/TestFinnishLightStemFilterFactory.java | 4 +- .../analysis/fr/TestFrenchAnalyzer.java | 2 +- .../fr/TestFrenchLightStemFilter.java | 6 +- .../fr/TestFrenchLightStemFilterFactory.java | 2 +- .../fr/TestFrenchMinimalStemFilter.java | 6 +- .../TestFrenchMinimalStemFilterFactory.java | 2 +- .../lucene/analysis/ga/TestIrishAnalyzer.java | 2 +- .../analysis/ga/TestIrishLowerCaseFilter.java | 2 +- .../ga/TestIrishLowerCaseFilterFactory.java | 2 +- .../analysis/gl/TestGalicianAnalyzer.java | 2 +- .../gl/TestGalicianMinimalStemFilter.java | 4 +- .../TestGalicianMinimalStemFilterFactory.java | 2 +- .../analysis/gl/TestGalicianStemFilter.java | 6 +- .../gl/TestGalicianStemFilterFactory.java | 2 +- .../lucene/analysis/hi/TestHindiAnalyzer.java | 2 +- .../lucene/analysis/hi/TestHindiFilters.java | 2 +- .../analysis/hi/TestHindiNormalizer.java | 2 +- .../lucene/analysis/hi/TestHindiStemmer.java | 2 +- .../analysis/hu/TestHungarianAnalyzer.java | 2 +- .../hu/TestHungarianLightStemFilter.java | 6 +- .../TestHungarianLightStemFilterFactory.java | 2 +- .../analysis/hunspell/StemmerTestBase.java | 2 +- .../analysis/hunspell/Test64kAffixes.java | 2 +- .../analysis/hunspell/TestAffixCondition.java | 2 +- .../hunspell/TestAllDictionaries.java | 8 +- .../analysis/hunspell/TestDictionary.java | 2 +- .../analysis/hunspell/TestHunspell.java | 2 +- .../hunspell/TestHunspellStemFilter.java | 4 +- .../TestHunspellStemFilterFactory.java | 2 +- .../analysis/hunspell/TestPerformance.java | 2 +- .../analysis/hunspell/TestSpellChecking.java | 2 +- .../hunspell/TestTrigramAutomaton.java | 2 +- .../analysis/hy/TestArmenianAnalyzer.java | 2 +- .../analysis/id/TestIndonesianAnalyzer.java | 2 +- .../id/TestIndonesianStemFilterFactory.java | 4 +- .../analysis/id/TestIndonesianStemmer.java | 4 +- .../analysis/in/TestIndicNormalizer.java | 4 +- .../analysis/it/TestItalianAnalyzer.java | 2 +- .../it/TestItalianLightStemFilter.java | 6 +- .../it/TestItalianLightStemFilterFactory.java | 2 +- .../analysis/lt/TestLithuanianAnalyzer.java | 2 +- .../analysis/lt/TestLithuanianStemming.java | 4 +- .../analysis/lv/TestLatvianAnalyzer.java | 2 +- .../lv/TestLatvianStemFilterFactory.java | 4 +- .../analysis/lv/TestLatvianStemmer.java | 4 +- .../analysis/minhash/TestMinHashFilter.java | 4 +- .../miscellaneous/TestASCIIFoldingFilter.java | 4 +- .../TestAsciiFoldingFilterFactory.java | 6 +- .../TestCapitalizationFilter.java | 4 +- .../TestCapitalizationFilterFactory.java | 2 +- .../TestCodepointCountFilter.java | 4 +- .../TestCodepointCountFilterFactory.java | 4 +- .../TestConcatenateGraphFilter.java | 4 +- .../TestConcatenateGraphFilterFactory.java | 4 +- .../TestConcatenatingTokenStream.java | 8 +- .../TestConditionalTokenFilter.java | 10 +- .../TestDateRecognizerFilter.java | 2 +- .../TestDateRecognizerFilterFactory.java | 2 +- ...TestDelimitedTermFrequencyTokenFilter.java | 2 +- .../TestDropIfFlaggedFilter.java | 6 +- .../TestDropIfFlaggedFilterFactory.java | 6 +- .../miscellaneous/TestEmptyTokenStream.java | 2 +- .../miscellaneous/TestFingerprintFilter.java | 4 +- .../TestFingerprintFilterFactory.java | 4 +- .../TestFixBrokenOffsetsFilter.java | 6 +- .../TestHyphenatedWordsFilter.java | 4 +- .../miscellaneous/TestKeepFilterFactory.java | 2 +- .../miscellaneous/TestKeepWordFilter.java | 4 +- .../TestKeywordMarkerFilter.java | 2 +- .../TestKeywordMarkerFilterFactory.java | 2 +- .../TestKeywordRepeatFilter.java | 2 +- .../miscellaneous/TestLengthFilter.java | 2 +- .../TestLengthFilterFactory.java | 4 +- .../TestLimitTokenCountAnalyzer.java | 6 +- .../TestLimitTokenCountFilter.java | 4 +- .../TestLimitTokenCountFilterFactory.java | 4 +- .../TestLimitTokenOffsetFilter.java | 4 +- .../TestLimitTokenOffsetFilterFactory.java | 4 +- .../TestLimitTokenPositionFilter.java | 4 +- .../TestLimitTokenPositionFilterFactory.java | 4 +- .../TestMiscellaneousFactories.java | 2 +- .../TestPerFieldAnalyzerWrapper.java | 6 +- .../TestProtectedTermFilter.java | 6 +- .../TestProtectedTermFilterFactory.java | 2 +- .../TestRemoveDuplicatesTokenFilter.java | 8 +- ...estRemoveDuplicatesTokenFilterFactory.java | 6 +- .../TestScandinavianFoldingFilter.java | 4 +- .../TestScandinavianFoldingFilterFactory.java | 2 +- .../TestScandinavianNormalizationFilter.java | 2 + ...candinavianNormalizationFilterFactory.java | 2 +- .../TestScandinavianNormalizer.java | 2 + .../TestStemmerOverrideFilter.java | 4 +- .../TestStemmerOverrideFilterFactory.java | 2 +- .../miscellaneous/TestTrimFilter.java | 8 +- .../miscellaneous/TestTrimFilterFactory.java | 2 +- .../TestTruncateTokenFilter.java | 2 +- .../TestTruncateTokenFilterFactory.java | 4 +- .../TestTypeAsSynonymFilter.java | 6 +- .../TestTypeAsSynonymFilterFactory.java | 6 +- .../TestWordDelimiterFilter.java | 8 +- .../TestWordDelimiterGraphFilter.java | 10 +- .../analysis/ne/TestNepaliAnalyzer.java | 2 +- .../ngram/TestEdgeNGramTokenFilter.java | 6 +- .../ngram/TestEdgeNGramTokenizer.java | 4 +- .../analysis/ngram/TestNGramFilters.java | 2 +- .../analysis/ngram/TestNGramTokenFilter.java | 6 +- .../analysis/ngram/TestNGramTokenizer.java | 4 +- .../lucene/analysis/nl/TestDutchAnalyzer.java | 2 +- .../analysis/no/TestNorwegianAnalyzer.java | 2 +- .../no/TestNorwegianLightStemFilter.java | 6 +- .../TestNorwegianLightStemFilterFactory.java | 2 +- .../no/TestNorwegianMinimalStemFilter.java | 6 +- ...TestNorwegianMinimalStemFilterFactory.java | 4 +- .../no/TestNorwegianNormalizationFilter.java | 2 + ...stNorwegianNormalizationFilterFactory.java | 2 +- .../path/TestPathHierarchyTokenizer.java | 2 +- .../TestReversePathHierarchyTokenizer.java | 2 +- .../TestPatternCaptureGroupTokenFilter.java | 4 +- .../pattern/TestPatternReplaceCharFilter.java | 6 +- .../TestPatternReplaceCharFilterFactory.java | 2 +- .../pattern/TestPatternReplaceFilter.java | 4 +- .../TestPatternReplaceFilterFactory.java | 2 +- .../pattern/TestPatternTokenizer.java | 2 +- .../pattern/TestPatternTokenizerFactory.java | 2 +- .../pattern/TestPatternTypingFilter.java | 6 +- .../TestPatternTypingFilterFactory.java | 6 +- .../TestSimplePatternSplitTokenizer.java | 4 +- .../pattern/TestSimplePatternTokenizer.java | 4 +- .../TestDelimitedPayloadTokenFilter.java | 2 +- ...estDelimitedPayloadTokenFilterFactory.java | 4 +- .../TestNumericPayloadTokenFilter.java | 4 +- .../TestTokenOffsetPayloadTokenFilter.java | 2 +- .../TestTypeAsPayloadTokenFilter.java | 2 +- .../analysis/pt/TestPortugueseAnalyzer.java | 2 +- .../pt/TestPortugueseLightStemFilter.java | 6 +- .../TestPortugueseLightStemFilterFactory.java | 4 +- .../pt/TestPortugueseMinimalStemFilter.java | 6 +- ...estPortugueseMinimalStemFilterFactory.java | 4 +- .../analysis/pt/TestPortugueseStemFilter.java | 6 +- .../pt/TestPortugueseStemFilterFactory.java | 2 +- .../query/TestQueryAutoStopWordAnalyzer.java | 3 + .../reverse/TestReverseStringFilter.java | 4 +- .../TestReverseStringFilterFactory.java | 2 +- .../analysis/ro/TestRomanianAnalyzer.java | 2 +- .../analysis/ru/TestRussianAnalyzer.java | 2 +- .../ru/TestRussianLightStemFilter.java | 6 +- .../ru/TestRussianLightStemFilterFactory.java | 2 +- .../shingle/TestFixedShingleFilter.java | 6 +- .../shingle/TestShingleAnalyzerWrapper.java | 6 +- .../analysis/shingle/TestShingleFilter.java | 8 +- .../shingle/TestShingleFilterFactory.java | 2 +- .../sinks/TestTeeSinkTokenFilter.java | 8 +- .../analysis/snowball/TestSnowball.java | 4 +- .../TestSnowballPorterFilterFactory.java | 2 +- .../analysis/snowball/TestSnowballVocab.java | 4 +- .../analysis/sr/TestSerbianAnalyzer.java | 2 +- .../sr/TestSerbianNormalizationFilter.java | 4 +- ...TestSerbianNormalizationFilterFactory.java | 4 +- ...TestSerbianNormalizationRegularFilter.java | 4 +- .../analysis/sv/TestSwedishAnalyzer.java | 2 +- .../sv/TestSwedishLightStemFilter.java | 6 +- .../sv/TestSwedishLightStemFilterFactory.java | 2 +- .../sv/TestSwedishMinimalStemFilter.java | 4 +- .../synonym/BaseSynonymParserTestCase.java | 2 +- .../synonym/TestMultiWordSynonyms.java | 2 +- .../synonym/TestSolrSynonymParser.java | 4 +- .../synonym/TestSynonymFilterFactory.java | 2 +- .../synonym/TestSynonymGraphFilter.java | 14 +- .../synonym/TestSynonymMapFilter.java | 10 +- .../synonym/TestWordnetSynonymParser.java | 6 +- .../lucene/analysis/ta/TestTamilAnalyzer.java | 2 +- .../analysis/te/TestTeluguAnalyzer.java | 2 +- .../lucene/analysis/te/TestTeluguFilters.java | 2 +- .../analysis/te/TestTeluguNormalizer.java | 2 +- .../lucene/analysis/te/TestTeluguStemmer.java | 2 +- .../lucene/analysis/th/TestThaiAnalyzer.java | 2 +- .../analysis/th/TestThaiTokenizerFactory.java | 2 +- .../analysis/tr/TestApostropheFilter.java | 2 +- .../tr/TestApostropheFilterFactory.java | 4 +- .../analysis/tr/TestTurkishAnalyzer.java | 2 +- .../tr/TestTurkishLowerCaseFilter.java | 2 +- .../tr/TestTurkishLowerCaseFilterFactory.java | 4 +- .../analysis/util/TestCharArrayIterator.java | 4 +- .../analysis/util/TestCharTokenizers.java | 2 +- .../lucene/analysis/util/TestElision.java | 2 +- .../util/TestElisionFilterFactory.java | 4 +- .../util/TestFilesystemResourceLoader.java | 2 +- .../analysis/util/TestRollingCharBuffer.java | 4 +- .../util/TestSegmentingTokenizerBase.java | 2 +- .../wikipedia/TestWikipediaTokenizer.java | 2 +- .../TestWikipediaTokenizerFactory.java | 2 +- .../TestCollationDocValuesField.java | 6 +- .../collation/TestCollationKeyAnalyzer.java | 2 +- .../icu/TestICUCollationDocValuesField.java | 6 +- .../icu/TestICUCollationKeyAnalyzer.java | 2 +- .../analysis/icu/TestICUFoldingFilter.java | 4 +- .../icu/TestICUFoldingFilterFactory.java | 2 +- .../icu/TestICUNormalizer2CharFilter.java | 6 +- .../TestICUNormalizer2CharFilterFactory.java | 2 +- .../icu/TestICUNormalizer2Filter.java | 4 +- .../icu/TestICUNormalizer2FilterFactory.java | 2 +- .../analysis/icu/TestICUTransformFilter.java | 4 +- .../icu/TestICUTransformFilterFactory.java | 2 +- .../segmentation/TestCharArrayIterator.java | 2 +- .../icu/segmentation/TestICUTokenizer.java | 2 +- .../icu/segmentation/TestICUTokenizerCJK.java | 4 +- .../segmentation/TestICUTokenizerFactory.java | 2 +- .../icu/segmentation/TestMyanmarSyllable.java | 2 +- .../segmentation/TestWithCJKBigramFilter.java | 2 +- .../lucene/analysis/ja/TestCSVUtil.java | 2 +- .../lucene/analysis/ja/TestExtendedMode.java | 4 +- .../lucene/analysis/ja/TestFactories.java | 6 +- .../analysis/ja/TestJapaneseAnalyzer.java | 2 +- .../ja/TestJapaneseBaseFormFilter.java | 2 +- .../ja/TestJapaneseBaseFormFilterFactory.java | 2 +- .../ja/TestJapaneseCompletionAnalyzer.java | 2 +- .../ja/TestJapaneseCompletionFilter.java | 2 +- .../TestJapaneseCompletionFilterFactory.java | 2 +- .../TestJapaneseIterationMarkCharFilter.java | 4 +- ...apaneseIterationMarkCharFilterFactory.java | 4 +- .../ja/TestJapaneseKatakanaStemFilter.java | 4 +- ...TestJapaneseKatakanaStemFilterFactory.java | 2 +- .../analysis/ja/TestJapaneseNumberFilter.java | 2 +- .../ja/TestJapaneseNumberFilterFactory.java | 2 +- ...JapanesePartOfSpeechStopFilterFactory.java | 2 +- .../ja/TestJapaneseReadingFormFilter.java | 2 +- .../TestJapaneseReadingFormFilterFactory.java | 2 +- .../analysis/ja/TestJapaneseTokenizer.java | 6 +- .../ja/TestJapaneseTokenizerFactory.java | 2 +- .../lucene/analysis/ja/TestSearchMode.java | 2 +- .../ja/completion/TestKatakanaRomanizer.java | 2 +- .../ja/dict/TestTokenInfoDictionary.java | 2 +- .../analysis/ja/dict/TestUserDictionary.java | 2 +- .../analysis/ja/util/TestToStringUtil.java | 2 +- .../ja/util/TestUnknownDictionary.java | 2 +- .../morfologik/TestMorfologikAnalyzer.java | 2 +- .../TestMorfologikFilterFactory.java | 2 +- .../analysis/uk/TestUkrainianAnalyzer.java | 2 +- .../analysis/ko/TestKoreanAnalyzer.java | 2 +- .../analysis/ko/TestKoreanNumberFilter.java | 2 +- .../ko/TestKoreanNumberFilterFactory.java | 2 +- ...stKoreanPartOfSpeechStopFilterFactory.java | 2 +- .../ko/TestKoreanReadingFormFilter.java | 2 +- .../TestKoreanReadingFormFilterFactory.java | 2 +- .../analysis/ko/TestKoreanTokenizer.java | 4 +- .../ko/TestKoreanTokenizerFactory.java | 2 +- .../ko/dict/TestTokenInfoDictionary.java | 2 +- .../analysis/ko/dict/TestUserDictionary.java | 2 +- .../ko/util/TestUnknownDictionary.java | 2 +- .../TestOpenNLPChunkerFilterFactory.java | 2 +- .../TestOpenNLPLemmatizerFilterFactory.java | 2 +- .../opennlp/TestOpenNLPPOSFilterFactory.java | 2 +- .../TestOpenNLPSentenceBreakIterator.java | 2 +- .../opennlp/TestOpenNLPTokenizerFactory.java | 2 +- .../phonetic/TestBeiderMorseFilter.java | 4 +- .../TestBeiderMorseFilterFactory.java | 2 +- .../TestDaitchMokotoffSoundexFilter.java | 4 +- ...estDaitchMokotoffSoundexFilterFactory.java | 4 +- .../phonetic/TestDoubleMetaphoneFilter.java | 6 +- .../TestDoubleMetaphoneFilterFactory.java | 2 +- .../analysis/phonetic/TestPhoneticFilter.java | 4 +- .../phonetic/TestPhoneticFilterFactory.java | 2 +- .../smart/TestHMMChineseTokenizerFactory.java | 2 +- .../cn/smart/TestSmartChineseAnalyzer.java | 2 +- .../analysis/pl/TestPolishAnalyzer.java | 2 +- .../TestStempelPolishStemFilterFactory.java | 2 +- .../test/org/egothor/stemmer/TestCompile.java | 2 +- .../test/org/egothor/stemmer/TestStemmer.java | 2 +- .../lucene50/TestBlockPostingsFormat.java | 8 +- .../lucene50/TestBlockPostingsFormat2.java | 10 +- .../lucene50/TestBlockPostingsFormat3.java | 18 +-- .../backward_codecs/lucene50/TestForUtil.java | 4 +- .../lucene50/TestLucene50CompoundFormat.java | 4 +- .../lucene50/TestLucene50LiveDocsFormat.java | 4 +- .../TestLucene50StoredFieldsFormat.java | 4 +- ...ne50StoredFieldsFormatHighCompression.java | 4 +- ...cene50StoredFieldsFormatMergeInstance.java | 2 +- .../TestLucene50TermVectorsFormat.java | 4 +- .../TestLucene60FieldInfosFormat.java | 4 +- .../lucene60/TestLucene60PointsFormat.java | 8 +- .../TestLucene70SegmentInfoFormat.java | 4 +- .../BaseLucene80DocValuesFormatTestCase.java | 10 +- ...estCompressionLucene80DocValuesFormat.java | 4 +- .../TestBestSpeedLucene80DocValuesFormat.java | 4 +- .../lucene80/TestDocValuesCompression.java | 6 +- .../lucene80/TestIndexedDISI.java | 6 +- .../lucene80/TestLucene80NormsFormat.java | 4 +- .../TestLucene80NormsFormatMergeInstance.java | 2 +- .../lucene84/TestForDeltaUtil.java | 6 +- .../backward_codecs/lucene84/TestForUtil.java | 6 +- .../lucene84/TestLucene84PostingsFormat.java | 8 +- .../lucene84/TestPForUtil.java | 6 +- .../lucene86/TestLucene86PointsFormat.java | 8 +- .../TestLucene86SegmentInfoFormat.java | 4 +- .../TestLucene87StoredFieldsFormat.java | 4 +- ...ne87StoredFieldsFormatHighCompression.java | 4 +- ...cene87StoredFieldsFormatMergeInstance.java | 2 +- .../packed/TestLegacyDirectMonotonic.java | 6 +- .../packed/TestLegacyDirectPacked.java | 6 +- .../packed/TestLegacyPackedInts.java | 8 +- .../store/EndiannessReverserTestCase.java | 4 +- ...tEndiannessReverserCheckSumIndexInput.java | 2 +- .../TestEndiannessReverserIndexInput.java | 2 +- .../TestBackwardsCompatibility.java | 12 +- .../TestIndexWriterOnOldIndex.java | 4 +- .../TestManyPointsInOldIndex.java | 6 +- .../lucene/benchmark/BenchmarkTestCase.java | 4 +- .../benchmark/byTask/TestPerfTasksLogic.java | 8 +- .../benchmark/byTask/TestPerfTasksParse.java | 4 +- .../byTask/feeds/TestEnwikiContentSource.java | 2 +- .../byTask/feeds/TestHtmlParser.java | 2 +- .../byTask/feeds/TestTrecContentSource.java | 4 +- .../benchmark/byTask/utils/TestConfig.java | 2 +- .../ClassificationTestBase.java | 6 +- .../Test20NewsgroupsClassification.java | 4 +- .../classification/TestBM25NBClassifier.java | 2 +- .../TestBooleanPerceptronClassifier.java | 2 +- .../TestCachingNaiveBayesClassifier.java | 2 +- .../TestKNearestFuzzyClassifier.java | 2 +- .../TestKNearestNeighborClassifier.java | 2 +- .../TestSimpleNaiveBayesClassifier.java | 2 +- .../DocumentClassificationTestBase.java | 2 +- .../utils/TestConfusionMatrixGenerator.java | 2 +- .../utils/TestDataSplitter.java | 10 +- .../utils/TestDocToDoubleVectorUtils.java | 4 +- .../TestFixedGapPostingsFormat.java | 5 +- ...stVarGapDocFreqIntervalPostingsFormat.java | 5 +- ...TestVarGapFixedIntervalPostingsFormat.java | 5 +- .../blocktreeords/TestOrdsBlockTree.java | 8 +- .../codecs/bloom/TestBloomPostingsFormat.java | 5 +- .../memory/TestDirectPostingsFormat.java | 4 +- .../codecs/memory/TestFSTPostingsFormat.java | 4 +- .../TestSimpleTextCompoundFormat.java | 2 +- .../TestSimpleTextDocValuesFormat.java | 2 +- .../TestSimpleTextFieldInfoFormat.java | 2 +- .../TestSimpleTextKnnVectorsFormat.java | 2 +- .../TestSimpleTextLiveDocsFormat.java | 2 +- .../simpletext/TestSimpleTextNormsFormat.java | 2 +- .../TestSimpleTextPointsFormat.java | 2 +- .../TestSimpleTextPostingsFormat.java | 4 +- .../TestSimpleTextSegmentInfoFormat.java | 2 +- .../TestSimpleTextStoredFieldsFormat.java | 2 +- .../TestSimpleTextTermVectorsFormat.java | 2 +- .../codecs/uniformsplit/TestBlockWriter.java | 2 +- .../uniformsplit/TestFSTDictionary.java | 3 +- .../codecs/uniformsplit/TestTermBytes.java | 2 +- .../uniformsplit/TestTermBytesComparator.java | 2 +- .../TestUniformSplitPostingFormat.java | 5 +- .../sharedterms/TestSTBlockReader.java | 2 +- .../TestSTUniformSplitPostingFormat.java | 1 + lucene/core/src/java/module-info.java | 5 + .../apache/lucene/analysis/TokenFilter.java | 8 +- .../org/apache/lucene/analysis/Tokenizer.java | 4 +- .../apache/lucene/analysis/package-info.java | 2 +- .../apache/lucene/geo/XYEncodingUtils.java | 8 +- .../org/apache/lucene/index/CheckIndex.java | 5 + .../index/ConcurrentMergeScheduler.java | 12 ++ .../apache/lucene/index/FilterLeafReader.java | 9 +- .../lucene/index/FilterMergePolicy.java | 8 +- .../org/apache/lucene/index/IndexReader.java | 10 +- .../org/apache/lucene/index/IndexWriter.java | 87 +++++++++++- .../apache/lucene/index/SegmentReader.java | 14 +- .../lucene/index/StandardDirectoryReader.java | 2 +- .../tests/ConcurrentMergeSchedulerAccess.java | 29 ++++ .../internal/tests/IndexPackageAccess.java | 44 ++++++ .../internal/tests/IndexWriterAccess.java | 44 ++++++ .../internal/tests/SegmentReaderAccess.java | 33 +++++ .../lucene/internal/tests/TestSecrets.java | 128 ++++++++++++++++++ .../lucene/internal/tests/package-info.java | 23 ++++ .../apache/lucene/search/FilterScorer.java | 8 +- .../apache/lucene/search/IndexSearcher.java | 10 ++ .../apache/lucene/store/FilterDirectory.java | 5 + .../apache/lucene/util/RamUsageEstimator.java | 2 +- .../lucene/util/automaton/Automaton.java | 2 +- .../lucene/util/automaton/Operations.java | 2 +- .../org/apache/lucene/TestAssertions.java | 2 +- .../src/test/org/apache/lucene/TestDemo.java | 2 +- .../org/apache/lucene/TestExternalCodecs.java | 10 +- .../lucene/TestMergeSchedulerExternal.java | 6 +- .../test/org/apache/lucene/TestSearch.java | 3 +- .../lucene/TestSearchForDuplicates.java | 4 +- .../analysis/TestAbstractAnalysisFactory.java | 2 +- .../analysis/TestAnalysisSPILoader.java | 2 +- .../lucene/analysis/TestAnalyzerWrapper.java | 3 +- .../analysis/TestAutomatonToTokenStream.java | 1 + .../analysis/TestCachingTokenFilter.java | 4 +- .../lucene/analysis/TestCharArrayMap.java | 2 +- .../lucene/analysis/TestCharArraySet.java | 2 +- .../lucene/analysis/TestCharFilter.java | 2 +- .../lucene/analysis/TestCharacterUtils.java | 4 +- .../TestDelegatingAnalyzerWrapper.java | 5 +- .../lucene/analysis/TestGraphTokenFilter.java | 3 + .../lucene/analysis/TestGraphTokenizers.java | 9 +- .../analysis/TestReusableStringReader.java | 2 +- .../lucene/analysis/TestStopFilter.java | 4 +- .../lucene/analysis/TestWordlistLoader.java | 2 +- .../standard/TestStandardAnalyzer.java | 8 +- .../standard/TestStandardFactories.java | 2 +- .../tokenattributes/TestBytesRefAttImpl.java | 2 +- .../TestCharTermAttributeImpl.java | 4 +- .../TestPackedTokenAttributeImpl.java | 6 +- .../TestSimpleAttributeImpl.java | 4 +- .../apache/lucene/codecs/TestCodecUtil.java | 2 +- .../TestCompetitiveFreqNormAccumulator.java | 2 +- .../AbstractTestCompressionMode.java | 4 +- .../lucene/codecs/lucene90/TestForUtil.java | 4 +- .../codecs/lucene90/TestIndexedDISI.java | 4 +- .../lucene90/TestLucene90CompoundFormat.java | 4 +- .../lucene90/TestLucene90DocValuesFormat.java | 10 +- .../TestLucene90FieldInfosFormat.java | 4 +- .../TestLucene90HnswVectorsFormat.java | 4 +- .../lucene90/TestLucene90LiveDocsFormat.java | 4 +- .../lucene90/TestLucene90NormsFormat.java | 4 +- .../lucene90/TestLucene90PointsFormat.java | 6 +- .../lucene90/TestLucene90PostingsFormat.java | 6 +- .../TestLucene90SegmentInfoFormat.java | 4 +- .../TestLucene90StoredFieldsFormat.java | 4 +- ...ne90StoredFieldsFormatHighCompression.java | 2 +- .../TestLucene90TermVectorsFormat.java | 4 +- .../lucene/codecs/lucene90/TestPForUtil.java | 4 +- .../TestCompressingStoredFieldsFormat.java | 6 +- .../TestCompressingTermVectorsFormat.java | 8 +- .../compressing/TestStoredFieldsInt.java | 4 +- .../perfield/TestPerFieldDocValuesFormat.java | 10 +- .../TestPerFieldKnnVectorsFormat.java | 10 +- .../perfield/TestPerFieldPostingsFormat.java | 4 +- .../perfield/TestPerFieldPostingsFormat2.java | 12 +- .../document/BaseLatLonPointTestCase.java | 6 +- .../document/BaseLatLonShapeTestCase.java | 6 +- .../document/BaseLatLonSpatialTestCase.java | 8 +- .../document/BaseShapeEncodingTestCase.java | 2 +- .../lucene/document/BaseSpatialTestCase.java | 4 +- .../lucene/document/BaseXYShapeTestCase.java | 4 +- .../lucene/document/TestBinaryDocument.java | 4 +- .../apache/lucene/document/TestDateTools.java | 2 +- .../apache/lucene/document/TestDocument.java | 6 +- .../lucene/document/TestDoubleRange.java | 2 +- .../document/TestFeatureDoubleValues.java | 4 +- .../lucene/document/TestFeatureField.java | 6 +- .../lucene/document/TestFeatureSort.java | 8 +- .../org/apache/lucene/document/TestField.java | 8 +- .../apache/lucene/document/TestFieldType.java | 2 +- .../lucene/document/TestFloatRange.java | 2 +- .../lucene/document/TestInetAddressPoint.java | 4 +- .../apache/lucene/document/TestIntRange.java | 2 +- .../document/TestLatLonDocValuesField.java | 2 +- .../document/TestLatLonLineShapeQueries.java | 2 +- .../lucene/document/TestLatLonPoint.java | 2 +- .../TestLatLonPointDistanceFeatureQuery.java | 8 +- .../document/TestLatLonPointDistanceSort.java | 8 +- .../document/TestLatLonPointShapeQueries.java | 2 +- .../lucene/document/TestLatLonShape.java | 8 +- .../document/TestLatLonShapeEncoding.java | 2 +- .../TestLongDistanceFeatureQuery.java | 8 +- .../apache/lucene/document/TestLongRange.java | 2 +- .../document/TestPerFieldConsistency.java | 2 +- .../document/TestXYLineShapeQueries.java | 2 +- .../TestXYMultiPointShapeQueries.java | 2 +- .../TestXYMultiPolygonShapeQueries.java | 2 +- .../document/TestXYPointShapeQueries.java | 2 +- .../apache/lucene/document/TestXYShape.java | 8 +- .../lucene/document/TestXYShapeEncoding.java | 2 +- .../org/apache/lucene/geo/TestCircle.java | 3 +- .../org/apache/lucene/geo/TestCircle2D.java | 4 +- .../lucene/geo/TestGeoEncodingUtils.java | 4 +- .../org/apache/lucene/geo/TestGeoUtils.java | 4 +- .../org/apache/lucene/geo/TestLine2D.java | 3 +- .../test/org/apache/lucene/geo/TestPoint.java | 2 +- .../org/apache/lucene/geo/TestPoint2D.java | 3 +- .../org/apache/lucene/geo/TestPolygon.java | 2 +- .../org/apache/lucene/geo/TestPolygon2D.java | 15 +- .../apache/lucene/geo/TestRectangle2D.java | 3 +- .../lucene/geo/TestSimpleWKTShapeParsing.java | 2 +- .../apache/lucene/geo/TestTessellator.java | 5 +- .../org/apache/lucene/geo/TestXYCircle.java | 3 +- .../org/apache/lucene/geo/TestXYLine.java | 3 +- .../org/apache/lucene/geo/TestXYPoint.java | 3 +- .../org/apache/lucene/geo/TestXYPolygon.java | 3 +- .../apache/lucene/geo/TestXYRectangle.java | 5 +- .../lucene/index/Test2BBinaryDocValues.java | 18 +-- .../org/apache/lucene/index/Test2BDocs.java | 18 +-- .../lucene/index/Test2BNumericDocValues.java | 18 +-- .../org/apache/lucene/index/Test2BPoints.java | 10 +- .../apache/lucene/index/Test2BPositions.java | 14 +- .../apache/lucene/index/Test2BPostings.java | 12 +- .../lucene/index/Test2BPostingsBytes.java | 16 +-- .../Test2BSortedDocValuesFixedSorted.java | 18 +-- .../index/Test2BSortedDocValuesOrds.java | 18 +-- .../org/apache/lucene/index/Test2BTerms.java | 18 +-- .../lucene/index/Test4GBStoredFields.java | 12 +- .../apache/lucene/index/TestAddIndexes.java | 14 +- .../index/TestAllFilesCheckIndexHeader.java | 15 +- .../index/TestAllFilesDetectBitFlips.java | 15 +- .../index/TestAllFilesDetectTruncation.java | 15 +- .../index/TestAllFilesHaveChecksumFooter.java | 9 +- .../index/TestAllFilesHaveCodecHeader.java | 9 +- .../index/TestApproximatePriorityQueue.java | 2 +- .../apache/lucene/index/TestAtomicUpdate.java | 9 +- .../lucene/index/TestBagOfPositions.java | 10 +- .../lucene/index/TestBagOfPostings.java | 10 +- .../index/TestBinaryDocValuesUpdates.java | 13 +- .../apache/lucene/index/TestBinaryTerms.java | 3 +- .../lucene/index/TestBufferedUpdates.java | 2 +- .../lucene/index/TestByteSliceReader.java | 4 +- .../apache/lucene/index/TestCheckIndex.java | 7 +- .../lucene/index/TestCodecHoldsOpenFiles.java | 7 +- .../org/apache/lucene/index/TestCodecs.java | 6 +- .../index/TestConcurrentMergeScheduler.java | 11 +- .../index/TestConsistentFieldNumbers.java | 6 +- .../org/apache/lucene/index/TestCrash.java | 7 +- .../index/TestCrashCausesCorruptIndex.java | 4 +- .../apache/lucene/index/TestCustomNorms.java | 9 +- .../lucene/index/TestCustomTermFreq.java | 4 +- .../lucene/index/TestDeletionPolicy.java | 6 +- .../index/TestDemoParallelLeafReader.java | 8 +- .../lucene/index/TestDirectoryReader.java | 22 +-- .../index/TestDirectoryReaderReopen.java | 10 +- .../test/org/apache/lucene/index/TestDoc.java | 6 +- .../org/apache/lucene/index/TestDocCount.java | 5 +- .../apache/lucene/index/TestDocIDMerger.java | 4 +- .../TestDocInverterPerFieldErrorInfo.java | 4 +- .../apache/lucene/index/TestDocValues.java | 2 +- .../index/TestDocValuesFieldUpdates.java | 2 +- .../lucene/index/TestDocValuesIndexing.java | 27 ++-- .../lucene/index/TestDocsAndPositions.java | 7 +- .../lucene/index/TestDocsWithFieldSet.java | 4 +- .../lucene/index/TestDocumentWriter.java | 9 +- .../index/TestDocumentsWriterDeleteQueue.java | 2 +- .../TestDocumentsWriterPerThreadPool.java | 2 +- .../TestDocumentsWriterStallControl.java | 2 +- .../lucene/index/TestDuelingCodecs.java | 12 +- .../index/TestDuelingCodecsAtNight.java | 4 +- .../lucene/index/TestExceedMaxTermLength.java | 6 +- .../index/TestExitableDirectoryReader.java | 4 +- .../apache/lucene/index/TestFieldInfos.java | 12 +- .../lucene/index/TestFieldInvertState.java | 10 +- .../apache/lucene/index/TestFieldReuse.java | 6 +- .../lucene/index/TestFieldUpdatesBuffer.java | 4 +- .../apache/lucene/index/TestFieldsReader.java | 5 +- .../lucene/index/TestFilterCodecReader.java | 4 +- .../index/TestFilterDirectoryReader.java | 2 +- .../lucene/index/TestFilterLeafReader.java | 7 +- .../lucene/index/TestFilterMergePolicy.java | 2 +- .../org/apache/lucene/index/TestFlex.java | 10 +- .../index/TestFlushByRamOrCountsPolicy.java | 10 +- .../lucene/index/TestForTooMuchCloning.java | 9 +- .../lucene/index/TestForceMergeForever.java | 10 +- .../index/TestFrozenBufferedUpdates.java | 4 +- .../apache/lucene/index/TestIndexCommit.java | 2 +- .../lucene/index/TestIndexFileDeleter.java | 9 +- .../apache/lucene/index/TestIndexInput.java | 4 +- .../lucene/index/TestIndexManyDocuments.java | 4 +- .../apache/lucene/index/TestIndexOptions.java | 2 +- .../lucene/index/TestIndexReaderClose.java | 8 +- .../apache/lucene/index/TestIndexSorting.java | 21 +-- .../lucene/index/TestIndexTooManyDocs.java | 2 +- .../apache/lucene/index/TestIndexWriter.java | 54 ++++---- .../lucene/index/TestIndexWriterCommit.java | 10 +- .../lucene/index/TestIndexWriterConfig.java | 5 +- .../lucene/index/TestIndexWriterDelete.java | 18 +-- .../index/TestIndexWriterExceptions.java | 17 +-- .../index/TestIndexWriterExceptions2.java | 20 +-- .../index/TestIndexWriterForceMerge.java | 10 +- .../index/TestIndexWriterFromReader.java | 2 +- .../index/TestIndexWriterLockRelease.java | 4 +- .../lucene/index/TestIndexWriterMaxDocs.java | 12 +- .../index/TestIndexWriterMergePolicy.java | 18 +-- .../lucene/index/TestIndexWriterMerging.java | 4 +- .../index/TestIndexWriterNRTIsCurrent.java | 8 +- .../index/TestIndexWriterOnDiskFull.java | 8 +- .../index/TestIndexWriterOnJRECrash.java | 4 +- .../index/TestIndexWriterOnVMError.java | 16 +-- .../TestIndexWriterOutOfFileDescriptors.java | 10 +- .../lucene/index/TestIndexWriterReader.java | 84 ++++++------ .../TestIndexWriterThreadsToSegments.java | 7 +- .../lucene/index/TestIndexWriterUnicode.java | 7 +- .../index/TestIndexWriterWithThreads.java | 16 ++- .../lucene/index/TestIndexableField.java | 5 +- .../index/TestIndexingSequenceNumbers.java | 5 +- .../apache/lucene/index/TestInfoStream.java | 2 +- .../apache/lucene/index/TestIntBlockPool.java | 2 +- .../apache/lucene/index/TestIsCurrent.java | 3 +- .../org/apache/lucene/index/TestKnnGraph.java | 2 +- .../lucene/index/TestLazyProxSkipping.java | 8 +- .../lucene/index/TestLogMergePolicy.java | 1 + .../apache/lucene/index/TestLongPostings.java | 9 +- .../apache/lucene/index/TestManyFields.java | 4 +- .../apache/lucene/index/TestMaxPosition.java | 6 +- .../lucene/index/TestMaxTermFrequency.java | 9 +- .../apache/lucene/index/TestMergePolicy.java | 4 +- .../lucene/index/TestMergeRateLimiter.java | 3 +- .../apache/lucene/index/TestMixedCodecs.java | 7 +- .../index/TestMixedDocValuesUpdates.java | 20 +-- .../lucene/index/TestMultiDocValues.java | 5 +- .../apache/lucene/index/TestMultiFields.java | 12 +- .../lucene/index/TestMultiLevelSkipList.java | 7 +- .../lucene/index/TestMultiTermsEnum.java | 4 +- .../lucene/index/TestNRTReaderCleanup.java | 9 +- .../index/TestNRTReaderWithThreads.java | 11 +- .../apache/lucene/index/TestNRTThreads.java | 11 +- .../apache/lucene/index/TestNeverDelete.java | 9 +- .../lucene/index/TestNewestSegment.java | 4 +- .../lucene/index/TestNoDeletionPolicy.java | 4 +- .../lucene/index/TestNoMergePolicy.java | 1 + .../lucene/index/TestNoMergeScheduler.java | 2 +- .../org/apache/lucene/index/TestNorms.java | 7 +- .../index/TestNumericDocValuesUpdates.java | 13 +- .../apache/lucene/index/TestOmitNorms.java | 4 +- .../lucene/index/TestOmitPositions.java | 7 +- .../org/apache/lucene/index/TestOmitTf.java | 5 +- .../TestOneMergeWrappingMergePolicy.java | 4 +- .../apache/lucene/index/TestOrdinalMap.java | 11 +- .../index/TestParallelCompositeReader.java | 4 +- .../lucene/index/TestParallelLeafReader.java | 6 +- .../index/TestParallelReaderEmptyIndex.java | 4 +- .../lucene/index/TestParallelTermEnum.java | 6 +- .../org/apache/lucene/index/TestPayloads.java | 13 +- .../lucene/index/TestPayloadsOnVectors.java | 11 +- .../lucene/index/TestPendingDeletes.java | 4 +- .../lucene/index/TestPendingSoftDeletes.java | 2 +- .../lucene/index/TestPerSegmentDeletes.java | 13 +- .../TestPersistentSnapshotDeletionPolicy.java | 2 +- .../apache/lucene/index/TestPointValues.java | 9 +- .../lucene/index/TestPostingsOffsets.java | 17 +-- .../lucene/index/TestPrefixCodedTerms.java | 4 +- .../lucene/index/TestReadOnlyIndex.java | 5 +- .../apache/lucene/index/TestReaderClosed.java | 10 +- .../apache/lucene/index/TestReaderPool.java | 4 +- .../index/TestReaderWrapperDVTypeCheck.java | 7 +- .../org/apache/lucene/index/TestRollback.java | 5 +- .../lucene/index/TestRollingUpdates.java | 6 +- .../index/TestSameTokenSamePosition.java | 3 +- .../apache/lucene/index/TestSegmentInfos.java | 8 +- .../lucene/index/TestSegmentMerger.java | 5 +- .../lucene/index/TestSegmentReader.java | 5 +- .../lucene/index/TestSegmentTermDocs.java | 7 +- .../lucene/index/TestSegmentTermEnum.java | 6 +- .../index/TestSegmentToThreadMapping.java | 3 +- .../index/TestSizeBoundedForceMerge.java | 2 +- .../index/TestSnapshotDeletionPolicy.java | 4 +- ...TestSoftDeletesDirectoryReaderWrapper.java | 2 +- .../TestSoftDeletesRetentionMergePolicy.java | 34 ++--- .../lucene/index/TestSortedSetDocValues.java | 2 +- .../lucene/index/TestSortingCodecReader.java | 5 +- .../lucene/index/TestStressAdvance.java | 5 +- .../lucene/index/TestStressDeletes.java | 8 +- .../lucene/index/TestStressIndexing.java | 6 +- .../lucene/index/TestStressIndexing2.java | 9 +- .../apache/lucene/index/TestStressNRT.java | 7 +- .../apache/lucene/index/TestSumDocFreq.java | 5 +- .../lucene/index/TestSwappedIndexFiles.java | 13 +- .../org/apache/lucene/index/TestTerm.java | 2 +- .../apache/lucene/index/TestTermStates.java | 3 +- .../apache/lucene/index/TestTermVectors.java | 11 +- .../lucene/index/TestTermVectorsReader.java | 6 +- .../lucene/index/TestTermVectorsWriter.java | 13 +- .../apache/lucene/index/TestTermdocPerf.java | 4 +- .../org/apache/lucene/index/TestTerms.java | 7 +- .../apache/lucene/index/TestTermsEnum.java | 12 +- .../apache/lucene/index/TestTermsEnum2.java | 12 +- .../lucene/index/TestTermsHashPerField.java | 2 +- .../lucene/index/TestThreadedForceMerge.java | 8 +- .../lucene/index/TestTieredMergePolicy.java | 11 +- .../index/TestTragicIndexWriterDeadlock.java | 5 +- .../lucene/index/TestTransactionRollback.java | 4 +- .../apache/lucene/index/TestTransactions.java | 8 +- .../apache/lucene/index/TestTryDelete.java | 4 +- .../lucene/index/TestTwoPhaseCommitTool.java | 2 +- .../lucene/index/TestUniqueTermCount.java | 9 +- .../index/TestUpgradeIndexMergePolicy.java | 3 +- .../internal/tests/TestTestSecrets.java | 40 ++++++ .../TestApproximationSearchEquivalence.java | 2 + .../lucene/search/TestAutomatonQuery.java | 10 +- .../search/TestAutomatonQueryUnicode.java | 4 +- .../lucene/search/TestBaseRangeFilter.java | 8 +- .../lucene/search/TestBlendedTermQuery.java | 5 +- .../search/TestBlockMaxConjunction.java | 8 +- .../apache/lucene/search/TestBoolean2.java | 10 +- .../search/TestBoolean2ScorerSupplier.java | 4 +- .../search/TestBooleanMinShouldMatch.java | 6 +- .../apache/lucene/search/TestBooleanOr.java | 9 +- .../lucene/search/TestBooleanQuery.java | 9 +- .../TestBooleanQueryVisitSubscorers.java | 7 +- .../lucene/search/TestBooleanRewrites.java | 6 +- .../lucene/search/TestBooleanScorer.java | 5 +- .../apache/lucene/search/TestBoostQuery.java | 2 +- .../lucene/search/TestCachingCollector.java | 2 +- .../lucene/search/TestCollectorManager.java | 4 +- .../search/TestComplexExplanations.java | 1 + .../TestComplexExplanationsOfNonMatches.java | 2 + .../lucene/search/TestConjunctionDISI.java | 4 +- .../lucene/search/TestConjunctions.java | 6 +- .../lucene/search/TestConstantScoreQuery.java | 5 +- .../search/TestConstantScoreScorer.java | 6 +- .../TestControlledRealTimeReopenThread.java | 10 +- .../lucene/search/TestCustomSearcherSort.java | 4 +- .../apache/lucene/search/TestDateSort.java | 4 +- .../search/TestDisjunctionMaxQuery.java | 8 +- ...sjunctionScoreBlockBoundaryPropagator.java | 2 +- .../lucene/search/TestDocIdSetIterator.java | 2 +- .../search/TestDocValuesFieldExistsQuery.java | 6 +- .../lucene/search/TestDocValuesQueries.java | 7 +- .../search/TestDocValuesRewriteMethod.java | 14 +- .../search/TestDoubleRangeFieldQueries.java | 3 +- .../lucene/search/TestDoubleValuesSource.java | 9 +- .../lucene/search/TestEarlyTermination.java | 4 +- .../search/TestElevationComparator.java | 4 +- .../search/TestFieldCacheRewriteMethod.java | 2 + .../lucene/search/TestFilterWeight.java | 2 +- .../search/TestFloatRangeFieldQueries.java | 3 +- .../apache/lucene/search/TestFuzzyQuery.java | 10 +- .../search/TestFuzzyTermOnShortTerms.java | 8 +- .../search/TestIndexOrDocValuesQuery.java | 4 +- .../lucene/search/TestIndexSearcher.java | 6 +- .../lucene/search/TestIndriAndQuery.java | 10 +- .../search/TestInetAddressRangeQueries.java | 3 +- .../search/TestIntRangeFieldQueries.java | 5 +- .../lucene/search/TestKnnVectorQuery.java | 4 +- .../lucene/search/TestLRUQueryCache.java | 10 +- .../search/TestLatLonDocValuesQueries.java | 2 +- .../lucene/search/TestLatLonPointQueries.java | 2 +- .../lucene/search/TestLiveFieldValues.java | 6 +- .../search/TestLongRangeFieldQueries.java | 5 +- .../lucene/search/TestLongValuesSource.java | 9 +- .../lucene/search/TestMatchAllDocsQuery.java | 4 +- .../lucene/search/TestMatchNoDocsQuery.java | 5 +- .../lucene/search/TestMatchesIterator.java | 2 + .../lucene/search/TestMaxClauseLimit.java | 2 +- .../search/TestMaxScoreAccumulator.java | 2 +- .../search/TestMaxScoreSumPropagator.java | 4 +- .../lucene/search/TestMinShouldMatch2.java | 7 +- .../lucene/search/TestMultiCollector.java | 6 +- .../search/TestMultiCollectorManager.java | 4 +- .../lucene/search/TestMultiPhraseEnum.java | 2 +- .../lucene/search/TestMultiPhraseQuery.java | 8 +- .../lucene/search/TestMultiSliceMerge.java | 5 +- .../search/TestMultiTermConstantScore.java | 7 +- .../search/TestMultiTermQueryRewrites.java | 6 +- .../search/TestMultiThreadTermVectors.java | 6 +- .../apache/lucene/search/TestMultiset.java | 2 +- .../lucene/search/TestNGramPhraseQuery.java | 4 +- .../apache/lucene/search/TestNeedsScores.java | 4 +- .../search/TestNormsFieldExistsQuery.java | 6 +- .../org/apache/lucene/search/TestNot.java | 4 +- .../lucene/search/TestPhrasePrefixQuery.java | 4 +- .../apache/lucene/search/TestPhraseQuery.java | 18 +-- .../lucene/search/TestPointQueries.java | 8 +- .../lucene/search/TestPositionIncrement.java | 4 +- .../TestPositiveScoresOnlyCollector.java | 4 +- .../search/TestPrefixInBooleanQuery.java | 4 +- .../apache/lucene/search/TestPrefixQuery.java | 6 +- .../lucene/search/TestPrefixRandom.java | 11 +- .../lucene/search/TestQueryRescorer.java | 7 +- .../lucene/search/TestQueryVisitor.java | 2 +- .../search/TestRangeFieldsDocValuesQuery.java | 4 +- .../apache/lucene/search/TestRegexpQuery.java | 4 +- .../lucene/search/TestRegexpRandom.java | 8 +- .../lucene/search/TestRegexpRandom2.java | 13 +- .../lucene/search/TestReqExclBulkScorer.java | 4 +- .../lucene/search/TestReqOptSumScorer.java | 6 +- .../search/TestSameScoresWithThreads.java | 10 +- .../TestScoreCachingWrappingScorer.java | 4 +- .../apache/lucene/search/TestScorerPerf.java | 4 +- .../apache/lucene/search/TestSearchAfter.java | 8 +- .../lucene/search/TestSearchWithThreads.java | 4 +- .../lucene/search/TestSearcherManager.java | 12 +- .../lucene/search/TestSegmentCacheables.java | 2 +- .../lucene/search/TestShardSearching.java | 5 +- .../apache/lucene/search/TestSimilarity.java | 6 +- .../lucene/search/TestSimilarityProvider.java | 6 +- .../lucene/search/TestSimpleExplanations.java | 1 + .../TestSimpleExplanationsOfNonMatches.java | 2 + .../TestSimpleExplanationsWithFillerDocs.java | 4 +- .../search/TestSimpleSearchEquivalence.java | 2 + .../lucene/search/TestSloppyPhraseQuery.java | 12 +- .../lucene/search/TestSloppyPhraseQuery2.java | 3 +- .../org/apache/lucene/search/TestSort.java | 4 +- .../lucene/search/TestSortOptimization.java | 4 +- .../apache/lucene/search/TestSortRandom.java | 6 +- .../lucene/search/TestSortRescorer.java | 6 +- .../search/TestSortedNumericSortField.java | 4 +- .../lucene/search/TestSortedSetSelector.java | 6 +- .../lucene/search/TestSortedSetSortField.java | 4 +- .../lucene/search/TestSubScorerFreqs.java | 7 +- .../lucene/search/TestSynonymQuery.java | 8 +- .../lucene/search/TestTermInSetQuery.java | 9 +- .../apache/lucene/search/TestTermQuery.java | 7 +- .../lucene/search/TestTermRangeQuery.java | 6 +- .../apache/lucene/search/TestTermScorer.java | 9 +- .../search/TestTimeLimitingCollector.java | 10 +- .../lucene/search/TestTopDocsCollector.java | 7 +- .../lucene/search/TestTopDocsMerge.java | 6 +- .../lucene/search/TestTopFieldCollector.java | 7 +- ...TestTopFieldCollectorEarlyTermination.java | 11 +- .../search/TestTotalHitCountCollector.java | 4 +- .../apache/lucene/search/TestTotalHits.java | 2 +- .../TestUsageTrackingFilterCachingPolicy.java | 4 +- .../apache/lucene/search/TestWANDScorer.java | 7 +- .../apache/lucene/search/TestWildcard.java | 6 +- .../lucene/search/TestWildcardRandom.java | 8 +- .../lucene/search/TestXYDocValuesQueries.java | 2 +- .../search/TestXYPointDistanceSort.java | 8 +- .../lucene/search/TestXYPointQueries.java | 2 +- .../similarities/AxiomaticTestCase.java | 1 + .../similarities/BasicModelTestCase.java | 1 + .../similarities/DistributionTestCase.java | 1 + .../similarities/TestAxiomaticSimilarity.java | 2 +- .../similarities/TestBM25Similarity.java | 1 + .../similarities/TestBooleanSimilarity.java | 5 +- .../similarities/TestClassicSimilarity.java | 3 +- .../TestIndependenceChiSquared.java | 1 + .../TestIndependenceSaturated.java | 1 + .../TestIndependenceStandardized.java | 1 + .../TestIndriDirichletSimilarity.java | 1 + .../TestLMDirichletSimilarity.java | 1 + .../TestLMJelinekMercerSimilarity.java | 1 + .../search/similarities/TestSimilarity2.java | 6 +- .../similarities/TestSimilarityBase.java | 6 +- .../lucene/store/BaseDataOutputTestCase.java | 2 +- .../lucene/store/TestBufferedChecksum.java | 2 +- .../lucene/store/TestBufferedIndexInput.java | 2 +- .../lucene/store/TestByteArrayDataInput.java | 2 +- .../store/TestByteBuffersDataInput.java | 2 +- .../store/TestByteBuffersDataOutput.java | 4 +- .../store/TestByteBuffersDirectory.java | 5 +- .../lucene/store/TestChecksumIndexInput.java | 4 +- .../apache/lucene/store/TestDirectory.java | 4 +- .../lucene/store/TestFileSwitchDirectory.java | 10 +- .../lucene/store/TestFilterDirectory.java | 1 + .../store/TestIndexOutputAlignment.java | 2 +- .../store/TestInputStreamDataInput.java | 4 +- .../apache/lucene/store/TestLockFactory.java | 5 +- .../lucene/store/TestMmapDirectory.java | 1 + .../store/TestMultiByteBuffersDirectory.java | 1 + .../apache/lucene/store/TestMultiMMap.java | 1 + .../lucene/store/TestNIOFSDirectory.java | 7 +- .../lucene/store/TestNRTCachingDirectory.java | 9 +- .../lucene/store/TestNativeFSLockFactory.java | 7 +- .../store/TestOutputStreamIndexOutput.java | 2 +- .../apache/lucene/store/TestRateLimiter.java | 4 +- .../lucene/store/TestSimpleFSLockFactory.java | 1 + .../store/TestSingleInstanceLockFactory.java | 3 +- .../lucene/store/TestSleepingLockWrapper.java | 3 +- .../lucene/store/TestStressLockFactories.java | 2 +- .../store/TestTrackingDirectoryWrapper.java | 1 + .../apache/lucene/util/BaseSortTestCase.java | 2 + .../apache/lucene/util/Test2BPagedBytes.java | 8 +- .../org/apache/lucene/util/TestArrayUtil.java | 2 + .../lucene/util/TestAttributeSource.java | 3 +- .../apache/lucene/util/TestByteBlockPool.java | 2 + .../org/apache/lucene/util/TestBytesRef.java | 3 + .../apache/lucene/util/TestBytesRefArray.java | 2 + .../apache/lucene/util/TestBytesRefHash.java | 2 + .../org/apache/lucene/util/TestCharsRef.java | 2 + .../lucene/util/TestCharsRefBuilder.java | 3 + .../lucene/util/TestClassLoaderUtils.java | 1 + .../lucene/util/TestCloseableThreadLocal.java | 2 + .../lucene/util/TestCollectionUtil.java | 1 + .../lucene/util/TestDocIdSetBuilder.java | 2 + .../lucene/util/TestFilterIterator.java | 1 + .../lucene/util/TestFixedBitDocIdSet.java | 1 + .../apache/lucene/util/TestFixedBitSet.java | 2 + .../util/TestFixedLengthBytesRefArray.java | 2 + .../util/TestFrequencyTrackingRingBuffer.java | 2 + .../org/apache/lucene/util/TestIOUtils.java | 5 +- .../lucene/util/TestIntArrayDocIdSet.java | 1 + .../apache/lucene/util/TestIntroSelector.java | 2 + .../org/apache/lucene/util/TestIntsRef.java | 2 + .../lucene/util/TestLSBRadixSorter.java | 2 + .../apache/lucene/util/TestLongBitSet.java | 2 + .../org/apache/lucene/util/TestLongHeap.java | 2 + .../org/apache/lucene/util/TestLongsRef.java | 2 + .../lucene/util/TestMSBRadixSorter.java | 2 + .../org/apache/lucene/util/TestMathUtil.java | 1 + .../lucene/util/TestMergedIterator.java | 1 + .../lucene/util/TestNamedSPILoader.java | 2 + .../apache/lucene/util/TestNotDocIdSet.java | 1 + .../apache/lucene/util/TestNumericUtils.java | 2 + .../apache/lucene/util/TestOfflineSorter.java | 4 +- .../apache/lucene/util/TestPagedBytes.java | 7 +- .../apache/lucene/util/TestPriorityQueue.java | 2 + .../apache/lucene/util/TestQueryBuilder.java | 9 +- .../apache/lucene/util/TestRadixSelector.java | 2 + .../lucene/util/TestRamUsageEstimator.java | 3 +- .../util/TestRecyclingByteBlockAllocator.java | 1 + .../util/TestRecyclingIntBlockAllocator.java | 1 + .../lucene/util/TestRoaringDocIdSet.java | 1 + .../apache/lucene/util/TestRollingBuffer.java | 1 + .../lucene/util/TestSentinelIntSet.java | 1 + .../org/apache/lucene/util/TestSetOnce.java | 1 + .../apache/lucene/util/TestSloppyMath.java | 3 +- .../apache/lucene/util/TestSmallFloat.java | 2 + .../util/TestSparseFixedBitDocIdSet.java | 1 + .../lucene/util/TestSparseFixedBitSet.java | 2 + .../lucene/util/TestStableMSBRadixSorter.java | 2 + .../util/TestStressRamUsageEstimator.java | 2 + .../apache/lucene/util/TestStringHelper.java | 2 + .../lucene/util/TestStringMSBRadixSorter.java | 2 + .../org/apache/lucene/util/TestTimSorter.java | 1 + .../lucene/util/TestTimSorterWorstCase.java | 3 +- .../apache/lucene/util/TestUnicodeUtil.java | 2 + .../apache/lucene/util/TestVectorUtil.java | 1 + .../org/apache/lucene/util/TestVersion.java | 1 + .../apache/lucene/util/TestVirtualMethod.java | 2 + .../lucene/util/TestWeakIdentityMap.java | 1 + .../lucene/util/automaton/TestAutomaton.java | 7 +- .../util/automaton/TestCompiledAutomaton.java | 4 +- .../TestDaciukMihovAutomatonBuilder.java | 2 +- .../util/automaton/TestDeterminism.java | 3 +- .../automaton/TestDeterminizeLexicon.java | 4 +- .../automaton/TestFiniteStringsIterator.java | 5 +- .../lucene/util/automaton/TestIntSet.java | 2 +- .../automaton/TestLevenshteinAutomata.java | 2 +- .../TestLimitedFiniteStringsIterator.java | 5 +- .../lucene/util/automaton/TestMinimize.java | 3 +- .../util/automaton/TestNFARunAutomaton.java | 7 +- .../lucene/util/automaton/TestOperations.java | 3 + .../lucene/util/automaton/TestRegExp.java | 2 +- .../util/automaton/TestRegExpParsing.java | 2 +- .../util/automaton/TestUTF32ToUTF8.java | 5 +- .../lucene/util/bkd/Test2BBKDPoints.java | 4 +- .../org/apache/lucene/util/bkd/TestBKD.java | 10 +- .../lucene/util/bkd/TestBKDRadixSelector.java | 4 +- .../lucene/util/bkd/TestBKDRadixSort.java | 4 +- .../apache/lucene/util/bkd/TestBKDUtil.java | 4 +- .../lucene/util/bkd/TestDocIdsWriter.java | 4 +- .../bkd/TestMutablePointTreeReaderUtils.java | 4 +- .../lucene/util/compress/LZ4TestCase.java | 4 +- .../TestLowercaseAsciiCompression.java | 4 +- .../org/apache/lucene/util/fst/Test2BFST.java | 4 +- .../lucene/util/fst/TestBitTableUtil.java | 2 +- .../lucene/util/fst/TestBytesStore.java | 4 +- .../util/fst/TestFSTDirectAddressing.java | 2 +- .../org/apache/lucene/util/fst/TestFSTs.java | 21 +-- .../org/apache/lucene/util/fst/TestUtil.java | 2 +- .../TestGraphTokenStreamFiniteStrings.java | 6 +- .../lucene/util/hnsw/MockVectorValues.java | 2 +- .../lucene/util/hnsw/TestHnswGraph.java | 2 +- .../lucene/util/hnsw/TestNeighbors.java | 2 +- .../lucene/util/hppc/TestIntIntHashMap.java | 2 +- .../util/mutable/TestMutableValues.java | 2 +- .../util/packed/TestDirectMonotonic.java | 4 +- .../lucene/util/packed/TestDirectPacked.java | 4 +- .../lucene/util/packed/TestPackedInts.java | 6 +- .../test/org/apache/lucene/demo/TestDemo.java | 2 +- .../facet/TestAssociationsFacetsExample.java | 2 +- .../demo/facet/TestDistanceFacetsExample.java | 2 +- ...estExpressionAggregationFacetsExample.java | 2 +- .../TestMultiCategoryListsFacetsExample.java | 2 +- .../demo/facet/TestRangeFacetsExample.java | 2 +- .../demo/facet/TestSimpleFacetsExample.java | 2 +- .../TestSimpleSortedSetFacetsExample.java | 2 +- .../lucene/demo/knn/TestDemoEmbeddings.java | 2 +- .../lucene/demo/knn/TestKnnVectorDict.java | 2 +- .../lucene/distribution/TestModularLayer.java | 25 +++- lucene/distribution/binary-release.gradle | 17 +-- .../expressions/TestDemoExpressions.java | 4 +- .../expressions/TestExpressionRescorer.java | 4 +- .../expressions/TestExpressionSortField.java | 2 +- .../expressions/TestExpressionSorts.java | 10 +- .../expressions/TestExpressionValidation.java | 2 +- .../TestExpressionValueSource.java | 6 +- .../expressions/js/TestCustomFunctions.java | 2 +- .../expressions/js/TestExpressionMath.java | 2 +- .../js/TestJavascriptCompiler.java | 2 +- .../js/TestJavascriptFunction.java | 2 +- .../js/TestJavascriptOperations.java | 2 +- .../expressions/js/TestVariableContext.java | 2 +- .../apache/lucene/facet/FacetTestCase.java | 4 +- .../lucene/facet/TestDrillDownQuery.java | 8 +- .../lucene/facet/TestDrillSideways.java | 6 +- .../apache/lucene/facet/TestFacetQuery.java | 6 +- .../apache/lucene/facet/TestFacetUtils.java | 4 +- .../apache/lucene/facet/TestFacetsConfig.java | 4 +- .../facet/TestLongValueFacetCounts.java | 6 +- .../lucene/facet/TestMultipleIndexFields.java | 6 +- .../TestRandomSamplingFacetsCollector.java | 2 +- .../facet/TestStringValueFacetCounts.java | 4 +- .../facet/range/TestRangeFacetCounts.java | 4 +- .../TestSortedSetDocValuesFacets.java | 6 +- .../lucene/facet/taxonomy/TestFacetLabel.java | 2 +- .../TestOrdinalMappingLeafReader.java | 2 +- .../taxonomy/TestSearcherTaxonomyManager.java | 6 +- .../facet/taxonomy/TestTaxonomyCombined.java | 2 +- .../TestTaxonomyFacetAssociations.java | 2 +- .../taxonomy/TestTaxonomyFacetCounts.java | 6 +- .../taxonomy/TestTaxonomyFacetCounts2.java | 2 +- .../taxonomy/TestTaxonomyFacetLabels.java | 2 +- .../TestTaxonomyFacetSumValueSource.java | 6 +- .../taxonomy/directory/TestAddTaxonomy.java | 4 +- .../TestDirectoryTaxonomyReader.java | 2 +- .../TestDirectoryTaxonomyWriter.java | 4 +- .../writercache/Test2GBCharBlockArray.java | 6 +- .../TestUTF8TaxonomyWriterCache.java | 2 +- .../grouping/AbstractGroupingTestCase.java | 8 +- .../grouping/BaseGroupSelectorTestCase.java | 2 +- .../grouping/TestAllGroupHeadsCollector.java | 8 +- .../grouping/TestAllGroupsCollector.java | 6 +- .../search/grouping/TestBlockGrouping.java | 2 +- .../grouping/TestDistinctValuesCollector.java | 4 +- .../grouping/TestDoubleRangeFactory.java | 2 +- .../grouping/TestGroupFacetCollector.java | 6 +- .../lucene/search/grouping/TestGrouping.java | 8 +- .../search/grouping/TestGroupingSearch.java | 6 +- .../search/grouping/TestLongRangeFactory.java | 2 +- .../lucene/search/grouping/TestTopGroups.java | 2 +- .../search/highlight/TestHighlighter.java | 16 +-- .../highlight/TestHighlighterPhrase.java | 10 +- .../lucene/search/highlight/TestMisses.java | 6 +- .../highlight/TestOffsetLimitTokenFilter.java | 2 + .../search/highlight/TestTokenSources.java | 14 +- .../custom/TestHighlightCustomQuery.java | 10 +- .../search/matchhighlight/IndexBuilder.java | 2 +- .../matchhighlight/TestMatchHighlighter.java | 2 +- .../TestMatchRegionRetriever.java | 2 +- .../matchhighlight/TestPassageSelector.java | 2 +- .../TestCustomSeparatorBreakIterator.java | 2 +- .../TestDefaultPassageFormatter.java | 2 +- .../TestLengthGoalBreakIterator.java | 6 +- .../TestSplittingBreakIterator.java | 2 +- .../uhighlight/TestUnifiedHighlighter.java | 8 +- .../uhighlight/TestUnifiedHighlighterMTQ.java | 10 +- .../TestUnifiedHighlighterRanking.java | 10 +- .../TestUnifiedHighlighterReanalysis.java | 8 +- .../TestUnifiedHighlighterStrictPhrases.java | 8 +- .../TestUnifiedHighlighterTermIntervals.java | 8 +- .../TestUnifiedHighlighterTermVec.java | 8 +- .../uhighlight/TestWholeBreakIterator.java | 2 +- .../TestUnifiedHighlighterExtensibility.java | 4 +- .../vectorhighlight/AbstractTestCase.java | 4 +- .../TestBreakIteratorBoundaryScanner.java | 2 +- .../TestFastVectorHighlighter.java | 12 +- .../vectorhighlight/TestFieldPhraseList.java | 2 +- .../vectorhighlight/TestFieldTermStack.java | 2 +- .../vectorhighlight/TestIndexTimeSynonym.java | 1 + .../TestSimpleBoundaryScanner.java | 2 +- .../TestSimpleFragmentsBuilder.java | 6 +- .../lucene/search/join/TestBlockJoin.java | 11 +- .../search/join/TestBlockJoinScorer.java | 4 +- .../search/join/TestBlockJoinSelector.java | 2 +- .../search/join/TestBlockJoinSorting.java | 6 +- .../search/join/TestBlockJoinValidation.java | 6 +- .../search/join/TestCheckJoinIndex.java | 6 +- .../lucene/search/join/TestJoinUtil.java | 10 +- .../TestParentChildrenBlockJoinQuery.java | 4 +- .../search/join/TestQueryBitSetProducer.java | 4 +- .../util/inifile/TestSimpleIniFile.java | 2 +- .../models/analysis/TestAnalysisImpl.java | 2 +- .../luke/models/commits/TestCommitsImpl.java | 8 +- .../models/documents/DocumentsTestBase.java | 4 +- .../documents/TestDocValuesAdapter.java | 4 +- .../models/documents/TestDocumentsImpl.java | 2 +- .../documents/TestTermVectorsAdapter.java | 2 +- .../models/overview/OverviewTestBase.java | 6 +- .../luke/models/search/TestSearchImpl.java | 4 +- .../lucene/index/memory/TestMemoryIndex.java | 8 +- .../TestMemoryIndexAgainstDirectory.java | 16 +-- .../apache/lucene/misc/TestHighFreqTerms.java | 8 +- .../lucene/misc/TestIndexMergeTool.java | 2 +- .../lucene/misc/TestSweetSpotSimilarity.java | 2 +- .../misc/document/TestLazyDocument.java | 3 +- .../misc/index/TestIndexRearranger.java | 2 +- .../lucene/misc/index/TestIndexSplitter.java | 8 +- .../index/TestMultiPassIndexSplitter.java | 4 +- .../misc/index/TestPKIndexSplitter.java | 6 +- .../TestDiversifiedTopDocsCollector.java | 4 +- .../search/TestDocValuesStatsCollector.java | 4 +- .../TestMemoryAccountingBitsetCollector.java | 4 +- .../misc/store/TestDirectIODirectory.java | 3 +- .../TestHardLinkCopyDirectoryWrapper.java | 6 +- .../lucene/misc/store/TestRAFDirectory.java | 2 +- .../misc/store/TestWindowsDirectory.java | 2 +- .../misc/util/TestCollectorMemoryTracker.java | 2 +- .../lucene/misc/util/fst/TestFSTsMisc.java | 8 +- .../monitor/ConcurrentMatcherTestBase.java | 2 +- .../lucene/monitor/MonitorTestBase.java | 2 +- .../monitor/TestBooleanClauseWeightings.java | 2 +- .../monitor/TestBooleanTermExtractor.java | 2 +- .../lucene/monitor/TestDocumentBatch.java | 2 +- .../apache/lucene/monitor/TestExtractors.java | 2 +- .../monitor/TestForceNoBulkScoringQuery.java | 2 +- .../lucene/monitor/TestQueryAnalyzer.java | 2 +- .../monitor/TestQueryTermComparators.java | 2 +- .../lucene/monitor/TestQueryTermFilter.java | 2 +- .../monitor/TestRegexpQueryHandler.java | 2 +- .../lucene/monitor/TestSpanExtractors.java | 2 +- .../monitor/TestSuffixingNGramTokenizer.java | 2 +- .../monitor/TestTermsEnumTokenFilter.java | 2 +- .../lucene/queries/TestCommonTermsQuery.java | 12 +- .../queries/function/FunctionTestSetup.java | 8 +- .../function/TestDocValuesFieldSources.java | 8 +- .../queries/function/TestFieldScoreQuery.java | 2 +- .../function/TestFunctionMatchQuery.java | 2 +- .../TestFunctionQueryExplanations.java | 2 +- .../function/TestFunctionQuerySort.java | 4 +- .../TestFunctionScoreExplanations.java | 2 +- .../function/TestFunctionScoreQuery.java | 2 +- .../function/TestIndexReaderFunctions.java | 8 +- .../function/TestLongNormValueSource.java | 8 +- .../function/TestSortedSetFieldSource.java | 2 +- .../queries/function/TestValueSources.java | 8 +- .../docvalues/TestBoolValOfNumericDVs.java | 2 +- .../queries/intervals/TestComplexMatches.java | 2 +- .../intervals/TestDisjunctionRewrites.java | 2 +- .../intervals/TestIntervalBuilder.java | 6 +- .../queries/intervals/TestIntervalQuery.java | 8 +- .../queries/intervals/TestIntervals.java | 4 +- .../TestPayloadFilteredInterval.java | 10 +- .../intervals/TestSimplifications.java | 2 +- .../lucene/queries/mlt/TestMoreLikeThis.java | 12 +- .../queries/payloads/PayloadHelper.java | 7 +- .../payloads/TestPayloadCheckQuery.java | 14 +- .../payloads/TestPayloadExplanations.java | 2 +- .../payloads/TestPayloadScoreQuery.java | 10 +- .../payloads/TestPayloadSpanPositions.java | 6 +- .../queries/payloads/TestPayloadSpans.java | 6 +- .../payloads/TestPayloadTermQuery.java | 12 +- .../spans/BaseSpanExplanationTestCase.java | 2 +- .../lucene/queries/spans/SpanTestUtil.java | 2 +- .../lucene/queries/spans/TestBasics.java | 12 +- .../spans/TestFieldMaskingSpanQuery.java | 10 +- .../lucene/queries/spans/TestFilterSpans.java | 2 +- .../queries/spans/TestNearSpansOrdered.java | 8 +- .../spans/TestQueryRescorerWithSpans.java | 4 +- .../queries/spans/TestSpanCollection.java | 6 +- .../queries/spans/TestSpanContainQuery.java | 8 +- .../TestSpanExplanationsOfNonMatches.java | 2 +- .../queries/spans/TestSpanFirstQuery.java | 8 +- .../lucene/queries/spans/TestSpanMatches.java | 2 +- .../spans/TestSpanMultiTermQueryWrapper.java | 4 +- .../queries/spans/TestSpanNearQuery.java | 6 +- .../queries/spans/TestSpanNotQuery.java | 6 +- .../lucene/queries/spans/TestSpanOrQuery.java | 4 +- .../queries/spans/TestSpanQueryVisitor.java | 2 +- .../spans/TestSpanSearchEquivalence.java | 2 +- .../queries/spans/TestSpanSimilarity.java | 4 +- .../queries/spans/TestSpanTermQuery.java | 6 +- .../lucene/queries/spans/TestSpans.java | 8 +- .../lucene/queries/spans/TestSpansEnum.java | 12 +- .../classic/TestMultiAnalyzer.java | 4 +- .../classic/TestMultiFieldQueryParser.java | 8 +- .../classic/TestMultiPhraseQueryParsing.java | 2 +- .../queryparser/classic/TestQueryParser.java | 12 +- .../complexPhrase/TestComplexPhraseQuery.java | 6 +- .../ext/TestExtendableQueryParser.java | 4 +- .../queryparser/ext/TestExtensions.java | 2 +- .../core/builders/TestQueryTreeBuilder.java | 2 +- .../flexible/core/nodes/TestQueryNode.java | 2 +- .../flexible/messages/TestNLS.java | 2 +- .../precedence/TestPrecedenceQueryParser.java | 5 +- .../flexible/spans/TestSpanQueryParser.java | 2 +- .../TestSpanQueryParserSimpleSample.java | 2 +- .../standard/TestMultiAnalyzerQPHelper.java | 3 +- .../standard/TestMultiFieldQPHelper.java | 3 +- .../standard/TestPointQueryParser.java | 2 +- .../flexible/standard/TestQPHelper.java | 8 +- .../flexible/standard/TestStandardQP.java | 4 +- .../standard/TestStandardQPEnhancements.java | 4 +- .../simple/TestSimpleQueryParser.java | 8 +- .../surround/query/SingleFieldTestDb.java | 4 +- .../surround/query/Test01Exceptions.java | 2 +- .../surround/query/Test02Boolean.java | 2 +- .../surround/query/Test03Distance.java | 2 +- .../surround/query/TestSrndQuery.java | 4 +- .../queryparser/util/QueryParserTestBase.java | 10 +- .../xml/CoreParserTestIndexData.java | 2 +- .../queryparser/xml/TestCoreParser.java | 8 +- lucene/replicator/src/java/module-info.java | 1 + .../lucene/replicator/ReplicatorTestCase.java | 2 +- ...TestIndexAndTaxonomyReplicationClient.java | 4 +- .../TestIndexReplicationClient.java | 4 +- .../replicator/nrt/SimplePrimaryNode.java | 6 +- .../replicator/nrt/SimpleReplicaNode.java | 4 +- .../replicator/nrt/TestNRTReplication.java | 12 +- .../replicator/nrt/TestSimpleServer.java | 10 +- .../nrt/TestStressNRTReplication.java | 14 +- .../lucene/payloads/TestPayloadSpanUtil.java | 6 +- .../TestIDVersionPostingsFormat.java | 14 +- .../sandbox/document/TestBigIntegerPoint.java | 4 +- .../document/TestDoubleRangeField.java | 2 +- .../TestFloatPointNearestNeighbor.java | 6 +- .../sandbox/document/TestHalfFloatPoint.java | 6 +- .../queries/TestFuzzyLikeThisQuery.java | 6 +- .../search/TestCombinedFieldQuery.java | 6 +- .../sandbox/search/TestCoveringQuery.java | 4 +- .../search/TestDocValuesNumbersQuery.java | 6 +- .../search/TestDocValuesTermsQuery.java | 6 +- .../search/TestFieldCacheTermsFilter.java | 4 +- ...xSortSortedNumericDocValuesRangeQuery.java | 10 +- .../TestLargeNumHitsTopDocsCollector.java | 6 +- .../search/TestLatLonBoundingBoxQueries.java | 6 +- .../sandbox/search/TestLongHashSet.java | 2 +- .../sandbox/search/TestMultiRangeQueries.java | 8 +- .../lucene/sandbox/search/TestNearest.java | 8 +- .../search/TestPhraseWildcardQuery.java | 4 +- .../sandbox/search/TestProfilerCollector.java | 6 +- .../TestQueryProfilerIndexSearcher.java | 8 +- .../search/TestQueryProfilerScorer.java | 2 +- .../search/TestTermAutomatonQuery.java | 14 +- .../lucene/spatial/SpatialTestCase.java | 8 +- .../spatial/TestQueryEqualsHashCode.java | 2 +- .../lucene/spatial/TestSpatialArgs.java | 2 +- .../lucene/spatial/TestSpatialExample.java | 2 +- .../lucene/spatial/TestTestFramework.java | 2 +- .../TestRecursivePrefixTreeStrategy.java | 2 +- .../prefix/tree/TestDateRangePrefixTree.java | 2 +- .../spatial/prefix/tree/TestS2PrefixTree.java | 2 +- .../spatial/query/TestSpatialArgsParser.java | 2 +- .../spatial4j/RandomizedShapeTestCase.java | 2 +- .../lucene/spatial/spatial4j/TestGeo3d.java | 2 +- .../lucene/spatial3d/TestGeo3DDocValues.java | 4 +- .../lucene/spatial3d/TestGeo3DPoint.java | 8 +- .../TestCompositeGeoPolygonRelationships.java | 2 +- .../lucene/spatial3d/geom/TestGeoBBox.java | 2 +- .../lucene/spatial3d/geom/TestGeoCircle.java | 2 +- .../spatial3d/geom/TestGeoConvexPolygon.java | 2 +- .../spatial3d/geom/TestGeoExactCircle.java | 2 +- .../lucene/spatial3d/geom/TestGeoModel.java | 2 +- .../lucene/spatial3d/geom/TestGeoPath.java | 2 +- .../lucene/spatial3d/geom/TestGeoPoint.java | 2 +- .../lucene/spatial3d/geom/TestGeoPolygon.java | 2 +- .../lucene/spatial3d/geom/TestPlane.java | 2 +- .../spatial3d/geom/TestRandomBinaryCodec.java | 2 +- .../spatial3d/geom/TestRandomGeoPolygon.java | 2 +- .../geom/TestRandomGeoShapeRelationship.java | 2 +- .../spatial3d/geom/TestRandomPlane.java | 2 +- .../TestSimpleGeoPolygonRelationships.java | 2 +- .../lucene/spatial3d/geom/TestXYZSolid.java | 2 +- .../search/spell/TestDirectSpellChecker.java | 10 +- .../search/spell/TestJaroWinklerDistance.java | 2 +- .../search/spell/TestLevenshteinDistance.java | 2 +- .../search/spell/TestLuceneDictionary.java | 6 +- .../search/spell/TestNGramDistance.java | 2 +- .../search/spell/TestPlainTextDictionary.java | 2 +- .../lucene/search/spell/TestSpellChecker.java | 6 +- .../spell/TestWordBreakSpellChecker.java | 12 +- .../suggest/TestDocumentDictionary.java | 6 +- .../TestDocumentValueSourceDictionary.java | 6 +- .../search/suggest/TestFileDictionary.java | 4 +- .../suggest/TestHighFrequencyDictionary.java | 4 +- .../search/suggest/TestInputIterator.java | 4 +- .../search/suggest/TestLookupBenchmark.java | 6 +- .../search/suggest/TestPersistence.java | 4 +- .../TestAnalyzingInfixSuggester.java | 8 +- .../analyzing/TestAnalyzingSuggester.java | 22 +-- .../analyzing/TestBlendedInfixSuggester.java | 8 +- .../analyzing/TestFreeTextSuggester.java | 10 +- .../suggest/analyzing/TestFuzzySuggester.java | 14 +- .../analyzing/TestSuggestStopFilter.java | 4 +- .../TestSuggestStopFilterFactory.java | 2 +- .../suggest/document/TestContextQuery.java | 8 +- .../document/TestContextSuggestField.java | 8 +- .../document/TestFuzzyCompletionQuery.java | 6 +- .../document/TestPrefixCompletionQuery.java | 10 +- .../document/TestRegexCompletionQuery.java | 6 +- .../suggest/document/TestSuggestField.java | 12 +- .../suggest/fst/TestBytesRefSorters.java | 2 +- .../search/suggest/fst/TestFSTCompletion.java | 2 + .../suggest/fst/TestWFSTCompletion.java | 4 +- lucene/test-framework/build.gradle | 10 +- .../test-framework/src/java/module-info.java | 73 ++++++++++ .../org/apache/lucene/analysis/package.html | 42 ------ .../lucene/analysis/standard/package.html | 26 ---- .../lucene/codecs/MissingOrdRemapper.java | 120 ---------------- .../lucene/codecs/blockterms/package.html | 26 ---- .../apache/lucene/codecs/bloom/package.html | 26 ---- .../lucene/codecs/compressing/package.html | 26 ---- .../org/apache/lucene/codecs/package.html | 26 ---- .../lucene/codecs/uniformsplit/package.html | 43 ------ .../uniformsplit/sharedterms/package.html | 43 ------ .../java/org/apache/lucene/geo/package.html | 26 ---- .../index/IndexWriterMaxDocsChanger.java | 48 ------- .../java/org/apache/lucene/index/package.html | 32 ----- .../org/apache/lucene/search/package.html | 32 ----- .../lucene/search/similarities/package.html | 31 ----- .../java/org/apache/lucene/store/package.html | 29 ---- .../BaseTokenStreamFactoryTestCase.java | 6 +- .../analysis/BaseTokenStreamTestCase.java | 15 +- .../analysis/CannedBinaryTokenStream.java | 3 +- .../analysis/CannedTokenStream.java | 3 +- .../analysis/CollationTestBase.java | 8 +- .../analysis/CrankyTokenFilter.java | 4 +- .../analysis/LookaheadTokenFilter.java | 4 +- .../{ => tests}/analysis/MockAnalyzer.java | 7 +- .../analysis/MockBytesAnalyzer.java | 4 +- .../{ => tests}/analysis/MockCharFilter.java | 3 +- .../MockFixedLengthPayloadFilter.java | 4 +- .../analysis/MockGraphTokenFilter.java | 5 +- .../MockHoleInjectingTokenFilter.java | 6 +- .../analysis/MockLowerCaseFilter.java | 5 +- .../analysis/MockPayloadAnalyzer.java | 6 +- .../MockRandomLookaheadTokenFilter.java | 3 +- .../analysis/MockReaderWrapper.java | 4 +- .../analysis/MockSynonymAnalyzer.java | 4 +- .../analysis/MockSynonymFilter.java | 4 +- .../{ => tests}/analysis/MockTokenFilter.java | 4 +- .../{ => tests}/analysis/MockTokenizer.java | 5 +- .../analysis/MockUTF16TermAttributeImpl.java | 2 +- .../MockVariableLengthPayloadFilter.java | 4 +- .../analysis/SimplePayloadFilter.java | 4 +- .../lucene/{ => tests}/analysis/Token.java | 2 +- .../analysis/TokenStreamToDot.java | 3 +- .../analysis/ValidatingTokenFilter.java | 6 +- .../analysis/VocabularyAssert.java | 7 +- .../lucene/tests/analysis/package-info.java | 39 ++++++ .../EmojiTokenizationTestUnicode_12_1.java | 4 +- .../standard/WordBreakTestUnicode_12_1_0.java | 4 +- .../standard/generateEmojiTokenizationTest.pl | 2 +- .../generateJavaUnicodeWordBreakTest.pl | 2 +- .../tests/analysis/standard/package-info.java | 22 +++ .../codecs/asserting/AssertingCodec.java | 4 +- .../asserting/AssertingDocValuesFormat.java | 6 +- .../asserting/AssertingKnnVectorsFormat.java | 4 +- .../asserting/AssertingLiveDocsFormat.java | 4 +- .../asserting/AssertingNormsFormat.java | 6 +- .../asserting/AssertingPointsFormat.java | 6 +- .../asserting/AssertingPostingsFormat.java | 6 +- .../AssertingStoredFieldsFormat.java | 4 +- .../asserting/AssertingTermVectorsFormat.java | 6 +- .../codecs/asserting/package-info.java | 2 +- .../codecs/blockterms/LuceneFixedGap.java | 8 +- .../LuceneVarGapDocFreqInterval.java | 9 +- .../blockterms/LuceneVarGapFixedInterval.java | 9 +- .../tests/codecs/blockterms/package-info.java | 19 +++ .../TestBloomFilteredLucenePostings.java | 7 +- .../tests/codecs/bloom/package-info.java | 22 +++ .../cheapbastard/CheapBastardCodec.java | 4 +- .../codecs/cheapbastard/package-info.java | 2 +- .../codecs/compressing/CompressingCodec.java | 7 +- .../DeflateWithPresetCompressingCodec.java | 2 +- .../compressing/FastCompressingCodec.java | 4 +- .../FastDecompressionCompressingCodec.java | 4 +- .../HighCompressionCompressingCodec.java | 4 +- .../LZ4WithPresetCompressingCodec.java | 2 +- .../dummy/DummyCompressingCodec.java | 4 +- .../compressing/dummy/package-info.java | 2 +- .../codecs/compressing/package-info.java | 22 +++ .../codecs/cranky/CrankyCodec.java | 2 +- .../codecs/cranky/CrankyCompoundFormat.java | 2 +- .../codecs/cranky/CrankyDocValuesFormat.java | 2 +- .../codecs/cranky/CrankyFieldInfosFormat.java | 2 +- .../codecs/cranky/CrankyLiveDocsFormat.java | 2 +- .../codecs/cranky/CrankyNormsFormat.java | 2 +- .../codecs/cranky/CrankyPointsFormat.java | 2 +- .../codecs/cranky/CrankyPostingsFormat.java | 2 +- .../cranky/CrankySegmentInfoFormat.java | 2 +- .../cranky/CrankyStoredFieldsFormat.java | 2 +- .../cranky/CrankyTermVectorsFormat.java | 2 +- .../codecs/cranky/package-info.java | 2 +- .../mockrandom/MockRandomPostingsFormat.java | 6 +- .../codecs/mockrandom/package-info.java | 2 +- .../lucene/tests/codecs/package-info.java | 19 +++ .../codecs/ramonly/RAMOnlyPostingsFormat.java | 2 +- .../codecs/ramonly/package-info.java | 2 +- .../uniformsplit/Rot13CypherTestUtil.java | 4 +- .../UniformSplitRot13PostingsFormat.java | 8 +- .../codecs/uniformsplit/package-info.java | 22 +++ .../STUniformSplitRot13PostingsFormat.java | 7 +- .../sharedterms/package-info.java | 22 +++ .../{ => tests}/geo/BaseGeoPointTestCase.java | 26 ++-- .../{ => tests}/geo/BaseXYPointTestCase.java | 16 ++- .../lucene/{ => tests}/geo/EarthDebugger.java | 4 +- .../lucene/{ => tests}/geo/GeoTestUtil.java | 10 +- .../lucene/{ => tests}/geo/ShapeTestUtil.java | 13 +- .../apache/lucene/tests/geo/package-info.java | 19 +++ .../index/AlcoholicMergePolicy.java | 6 +- .../index/AllDeletedFilterReader.java | 4 +- .../index/AssertingDirectoryReader.java | 5 +- .../index/AssertingLeafReader.java | 27 +++- .../index/BaseCompoundFormatTestCase.java | 10 +- ...aseCompressingDocValuesFormatTestCase.java | 8 +- .../index/BaseDocValuesFormatTestCase.java | 24 +++- .../index/BaseFieldInfoFormatTestCase.java | 66 +++++---- .../index/BaseIndexFileFormatTestCase.java | 40 ++++-- .../index/BaseKnnVectorsFormatTestCase.java | 39 ++++-- .../index/BaseLiveDocsFormatTestCase.java | 9 +- .../index/BaseMergePolicyTestCase.java | 28 ++-- .../index/BaseNormsFormatTestCase.java | 20 ++- .../index/BasePointsFormatTestCase.java | 30 +++- .../index/BasePostingsFormatTestCase.java | 30 ++-- .../index/BaseSegmentInfoFormatTestCase.java | 13 +- .../index/BaseStoredFieldsFormatTestCase.java | 27 +++- .../index/BaseTermVectorsFormatTestCase.java | 19 ++- .../{ => tests}/index/BaseTestCheckIndex.java | 13 +- .../lucene/{ => tests}/index/DocHelper.java | 14 +- .../index/FieldFilterLeafReader.java | 14 +- .../{ => tests}/index/ForceMergePolicy.java | 6 +- .../tests}/index/MergeReaderWrapper.java | 18 ++- .../{ => tests}/index/MergingCodecReader.java | 4 +- .../index/MergingDirectoryReaderWrapper.java | 6 +- .../index/MismatchedDirectoryReader.java | 5 +- .../index/MismatchedLeafReader.java | 7 +- .../index/MockIndexWriterEventListener.java | 5 +- .../index/MockRandomMergePolicy.java | 13 +- .../index/OwnCacheKeyMultiReader.java | 9 +- .../{ => tests}/index/PerThreadPKLookup.java | 7 +- .../{ => tests}/index/PointsStackTracker.java | 2 +- .../lucene/{ => tests}/index/RandomCodec.java | 28 ++-- .../{ => tests}/index/RandomIndexWriter.java | 41 ++++-- .../index/RandomPostingsTester.java | 35 +++-- .../SuppressingConcurrentMergeScheduler.java | 4 +- .../ThreadedIndexingAndSearchingTestCase.java | 48 +++++-- .../lucene/tests/index/package-info.java | 30 ++++ .../{ => tests}/mockfile/DisableFsyncFS.java | 2 +- .../lucene/{ => tests}/mockfile/ExtrasFS.java | 2 +- .../FilterAsynchronousFileChannel.java | 2 +- .../mockfile/FilterDirectoryStream.java | 2 +- .../mockfile/FilterFileChannel.java | 2 +- .../{ => tests}/mockfile/FilterFileStore.java | 2 +- .../mockfile/FilterFileSystem.java | 2 +- .../mockfile/FilterFileSystemProvider.java | 2 +- .../mockfile/FilterInputStream2.java | 2 +- .../mockfile/FilterOutputStream2.java | 2 +- .../{ => tests}/mockfile/FilterPath.java | 2 +- .../mockfile/FilterSeekableByteChannel.java | 2 +- .../{ => tests}/mockfile/HandleLimitFS.java | 2 +- .../mockfile/HandleTrackingFS.java | 2 +- .../lucene/{ => tests}/mockfile/LeakFS.java | 2 +- .../mockfile/MockFileSystemTestCase.java | 6 +- .../{ => tests}/mockfile/ShuffleFS.java | 2 +- .../{ => tests}/mockfile/VerboseFS.java | 2 +- .../{ => tests}/mockfile/VirusCheckingFS.java | 4 +- .../{ => tests}/mockfile/WindowsFS.java | 2 +- .../{ => tests}/mockfile/package-info.java | 19 +-- .../search/AssertingBulkScorer.java | 6 +- .../search/AssertingCollector.java | 6 +- .../search/AssertingIndexSearcher.java | 7 +- .../search/AssertingLeafCollector.java | 6 +- .../{ => tests}/search/AssertingMatches.java | 9 +- .../search/AssertingMatchesIterator.java | 4 +- .../{ => tests}/search/AssertingQuery.java | 7 +- .../{ => tests}/search/AssertingScorable.java | 9 +- .../{ => tests}/search/AssertingScorer.java | 8 +- .../{ => tests}/search/AssertingWeight.java | 11 +- .../search/BaseExplanationTestCase.java | 13 +- .../search/BaseRangeFieldQueryTestCase.java | 10 +- .../search/BlockScoreQueryWrapper.java | 10 +- .../search/BulkScorerWrapperScorer.java | 8 +- .../lucene/{ => tests}/search/CheckHits.java | 29 +++- .../{ => tests}/search/MatchesTestBase.java | 42 +++--- .../lucene/{ => tests}/search/QueryUtils.java | 16 ++- .../search/RandomApproximationQuery.java | 13 +- .../search/ScorerIndexSearcher.java | 9 +- .../search/SearchEquivalenceTestBase.java | 22 ++- .../search/ShardSearchingTestBase.java | 23 +++- .../lucene/tests/search/package-info.java | 30 ++++ .../similarities/AssertingSimilarity.java | 3 +- .../similarities/BaseSimilarityTestCase.java | 12 +- .../search/similarities/RandomSimilarity.java | 39 +++++- .../search/similarities/package-info.java | 26 ++++ .../store/BaseChunkedDirectoryTestCase.java | 14 +- .../store/BaseDirectoryTestCase.java | 16 ++- .../store/BaseDirectoryWrapper.java | 6 +- .../store/BaseLockFactoryTestCase.java | 12 +- .../store/CorruptingIndexOutput.java | 6 +- .../store/MockDirectoryWrapper.java | 15 +- .../store/MockIndexInputWrapper.java | 3 +- .../store/MockIndexOutputWrapper.java | 7 +- .../store/RawDirectoryWrapper.java | 10 +- .../SlowClosingMockIndexInputWrapper.java | 3 +- .../SlowOpeningMockIndexInputWrapper.java | 3 +- .../lucene/tests/store/package-info.java | 24 ++++ .../util/AbstractBeforeAfterRule.java | 2 +- .../{ => tests}/util/BaseBitSetTestCase.java | 9 +- .../util/BaseDocIdSetTestCase.java | 5 +- .../{ => tests}/util/CloseableDirectory.java | 4 +- .../lucene/{ => tests}/util/English.java | 2 +- .../util/FailOnNonBulkMergesInfoStream.java | 3 +- .../{ => tests}/util/FailureMarker.java | 2 +- .../lucene/{ => tests}/util/LineFileDocs.java | 5 +- .../util/LuceneJUnit3MethodProvider.java | 2 +- .../{ => tests}/util/LuceneTestCase.java | 42 ++++-- .../{ => tests}/util/NullInfoStream.java | 3 +- .../util/QuickPatchThreadsFilter.java | 3 +- .../{ => tests}/util/RamUsageTester.java | 5 +- .../{ => tests}/util/RemoveUponClose.java | 3 +- .../lucene/{ => tests}/util/Rethrow.java | 2 +- .../util/RunListenerPrintReproduceInfo.java | 5 +- .../util/TestRuleAssertionsRequired.java | 2 +- .../{ => tests}/util/TestRuleDelegate.java | 2 +- .../util/TestRuleIgnoreAfterMaxFailures.java | 2 +- .../util/TestRuleIgnoreTestSuites.java | 2 +- .../util/TestRuleLimitSysouts.java | 6 +- .../{ => tests}/util/TestRuleMarkFailure.java | 2 +- .../util/TestRuleRestoreSystemProperties.java | 2 +- .../util/TestRuleSetupAndRestoreClassEnv.java | 46 ++++--- .../TestRuleSetupAndRestoreInstanceEnv.java | 2 +- .../util/TestRuleSetupTeardownChained.java | 2 +- .../util/TestRuleStoreClassName.java | 2 +- .../util/TestRuleTemporaryFilesCleanup.java | 24 ++-- .../util/TestRuleThreadAndTestName.java | 2 +- .../{ => tests}/util/TestSecurityManager.java | 7 +- .../lucene/{ => tests}/util/TestUtil.java | 19 ++- .../util/ThrottledIndexOutput.java | 3 +- .../lucene/{ => tests}/util/TimeUnits.java | 2 +- .../util/VerifyTestClassNamingConvention.java | 2 +- .../util/automaton/AutomatonTestUtil.java | 9 +- .../tests/util/automaton/package-info.java | 23 ++++ .../{ => tests}/util/fst/FSTTester.java | 33 +++-- .../lucene/tests/util/fst/package-info.java | 19 +++ .../lucene/tests/util/package-info.java | 22 +++ .../apache/lucene/util/automaton/package.html | 27 ---- .../org/apache/lucene/util/fst/package.html | 26 ---- .../java/org/apache/lucene/util/package.html | 27 ---- .../services/org.apache.lucene.codecs.Codec | 16 +-- .../org.apache.lucene.codecs.DocValuesFormat | 2 +- .../org.apache.lucene.codecs.KnnVectorsFormat | 2 +- .../org.apache.lucene.codecs.PostingsFormat | 18 +-- .../lucene/{ => tests}/geo/lucene-9251.wkt.gz | Bin .../{ => tests}/geo/lucene-9417.geojson.gz | Bin .../geo/lucene-9538-invalid.geojson.gz | Bin .../{ => tests}/util/europarl.lines.txt.gz | Bin .../{ => tests}/util/europarl.lines.txt.seek | 0 .../analysis/TestLookaheadTokenFilter.java | 5 +- .../analysis/TestMockAnalyzer.java | 13 +- .../analysis/TestMockCharFilter.java | 4 +- .../analysis/TestMockSynonymFilter.java | 3 +- .../{ => tests}/analysis/TestPosition.java | 2 +- .../{ => tests}/analysis/TestToken.java | 8 +- .../analysis/TrivialLookaheadFilter.java | 3 +- .../TestAssertingDocValuesFormat.java | 4 +- .../asserting/TestAssertingNormsFormat.java | 4 +- .../asserting/TestAssertingPointsFormat.java | 4 +- .../TestAssertingPostingsFormat.java | 4 +- .../TestAssertingStoredFieldsFormat.java | 4 +- .../TestAssertingTermVectorsFormat.java | 4 +- .../index/TestAssertingLeafReader.java | 10 +- .../index/TestForceMergePolicy.java | 6 +- .../mockfile/TestDisableFsyncFS.java | 2 +- .../{ => tests}/mockfile/TestExtrasFS.java | 2 +- .../mockfile/TestHandleLimitFS.java | 2 +- .../mockfile/TestHandleTrackingFS.java | 2 +- .../{ => tests}/mockfile/TestLeakFS.java | 2 +- .../{ => tests}/mockfile/TestShuffleFS.java | 2 +- .../{ => tests}/mockfile/TestVerboseFS.java | 2 +- .../mockfile/TestVirusCheckingFS.java | 2 +- .../{ => tests}/mockfile/TestWindowsFS.java | 2 +- .../search/TestBaseExplanationTestCase.java | 9 +- .../store/TestMockDirectoryWrapper.java | 11 +- .../lucene/{ => tests}/util/SorePoint.java | 2 +- .../lucene/{ => tests}/util/SoreType.java | 2 +- .../util/TestBeforeAfterOverrides.java | 2 +- .../{ => tests}/util/TestCodecReported.java | 4 +- .../util/TestExceptionInBeforeClassHooks.java | 2 +- .../{ => tests}/util/TestExpectThrows.java | 2 +- .../util/TestFailIfDirectoryNotClosed.java | 4 +- .../util/TestFailIfUnreferencedFiles.java | 6 +- .../{ => tests}/util/TestGroupFiltering.java | 2 +- .../{ => tests}/util/TestJUnitRuleOrder.java | 2 +- .../lucene/{ => tests}/util/TestJvmInfo.java | 2 +- .../{ => tests}/util/TestMaxFailuresRule.java | 6 +- .../{ => tests}/util/TestPleaseFail.java | 2 +- .../util/TestRamUsageTesterOnWildAnimals.java | 2 +- .../util/TestReproduceMessage.java | 2 +- .../TestReproduceMessageWithRepeated.java | 2 +- .../TestRunWithRestrictedPermissions.java | 2 +- .../util/TestSeedFromUncaught.java | 2 +- .../util/TestSetupTeardownChaining.java | 2 +- .../{ => tests}/util/TestSysoutsLimits.java | 2 +- .../util/TestWorstCaseTestBehavior.java | 2 +- .../{ => tests}/util/WithNestedTests.java | 5 +- 1668 files changed, 5775 insertions(+), 4334 deletions(-) create mode 100644 lucene/core/src/java/org/apache/lucene/internal/tests/ConcurrentMergeSchedulerAccess.java create mode 100644 lucene/core/src/java/org/apache/lucene/internal/tests/IndexPackageAccess.java create mode 100644 lucene/core/src/java/org/apache/lucene/internal/tests/IndexWriterAccess.java create mode 100644 lucene/core/src/java/org/apache/lucene/internal/tests/SegmentReaderAccess.java create mode 100644 lucene/core/src/java/org/apache/lucene/internal/tests/TestSecrets.java create mode 100644 lucene/core/src/java/org/apache/lucene/internal/tests/package-info.java rename lucene/{test-framework => core}/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingStoredFieldsFormat.java (98%) rename lucene/{test-framework => core}/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingTermVectorsFormat.java (95%) create mode 100644 lucene/core/src/test/org/apache/lucene/internal/tests/TestTestSecrets.java create mode 100644 lucene/test-framework/src/java/module-info.java delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/analysis/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/analysis/standard/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/codecs/MissingOrdRemapper.java delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/codecs/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/geo/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/index/IndexWriterMaxDocsChanger.java delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/index/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/search/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/search/similarities/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/store/package.html rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/BaseTokenStreamFactoryTestCase.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/BaseTokenStreamTestCase.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/CannedBinaryTokenStream.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/CannedTokenStream.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/CollationTestBase.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/CrankyTokenFilter.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/LookaheadTokenFilter.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockAnalyzer.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockBytesAnalyzer.java (91%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockCharFilter.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockFixedLengthPayloadFilter.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockGraphTokenFilter.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockHoleInjectingTokenFilter.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockLowerCaseFilter.java (88%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockPayloadAnalyzer.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockRandomLookaheadTokenFilter.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockReaderWrapper.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockSynonymAnalyzer.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockSynonymFilter.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockTokenFilter.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockTokenizer.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockUTF16TermAttributeImpl.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/MockVariableLengthPayloadFilter.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/SimplePayloadFilter.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/Token.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/TokenStreamToDot.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/ValidatingTokenFilter.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/VocabularyAssert.java (94%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/analysis/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/standard/EmojiTokenizationTestUnicode_12_1.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/standard/WordBreakTestUnicode_12_1_0.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/standard/generateEmojiTokenizationTest.pl (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/analysis/standard/generateJavaUnicodeWordBreakTest.pl (99%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingCodec.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingDocValuesFormat.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingKnnVectorsFormat.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingLiveDocsFormat.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingNormsFormat.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingPointsFormat.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingPostingsFormat.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingStoredFieldsFormat.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/AssertingTermVectorsFormat.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/asserting/package-info.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/blockterms/LuceneFixedGap.java (89%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/blockterms/LuceneVarGapDocFreqInterval.java (89%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/blockterms/LuceneVarGapFixedInterval.java (88%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/bloom/TestBloomFilteredLucenePostings.java (91%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/codecs/bloom/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cheapbastard/CheapBastardCodec.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cheapbastard/package-info.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/compressing/CompressingCodec.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/compressing/DeflateWithPresetCompressingCodec.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/compressing/FastCompressingCodec.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/compressing/FastDecompressionCompressingCodec.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/compressing/HighCompressionCompressingCodec.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/compressing/LZ4WithPresetCompressingCodec.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/compressing/dummy/DummyCompressingCodec.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/compressing/dummy/package-info.java (93%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyCodec.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyCompoundFormat.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyDocValuesFormat.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyFieldInfosFormat.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyLiveDocsFormat.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyNormsFormat.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyPointsFormat.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyPostingsFormat.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankySegmentInfoFormat.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyStoredFieldsFormat.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/CrankyTermVectorsFormat.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/cranky/package-info.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/mockrandom/MockRandomPostingsFormat.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/mockrandom/package-info.java (94%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/codecs/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/ramonly/RAMOnlyPostingsFormat.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/ramonly/package-info.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/uniformsplit/Rot13CypherTestUtil.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/uniformsplit/UniformSplitRot13PostingsFormat.java (92%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/codecs/uniformsplit/sharedterms/STUniformSplitRot13PostingsFormat.java (87%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/sharedterms/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/geo/BaseGeoPointTestCase.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/geo/BaseXYPointTestCase.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/geo/EarthDebugger.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/geo/GeoTestUtil.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/geo/ShapeTestUtil.java (96%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/geo/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/AlcoholicMergePolicy.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/AllDeletedFilterReader.java (91%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/AssertingDirectoryReader.java (89%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/AssertingLeafReader.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseCompoundFormatTestCase.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseCompressingDocValuesFormatTestCase.java (95%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseDocValuesFormatTestCase.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseFieldInfoFormatTestCase.java (89%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseIndexFileFormatTestCase.java (95%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseKnnVectorsFormatTestCase.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseLiveDocsFormatTestCase.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseMergePolicyTestCase.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseNormsFormatTestCase.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BasePointsFormatTestCase.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BasePostingsFormatTestCase.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseSegmentInfoFormatTestCase.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseStoredFieldsFormatTestCase.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseTermVectorsFormatTestCase.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/BaseTestCheckIndex.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/DocHelper.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/FieldFilterLeafReader.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/ForceMergePolicy.java (86%) mode change 100755 => 100644 rename lucene/{core/src/java/org/apache/lucene => test-framework/src/java/org/apache/lucene/tests}/index/MergeReaderWrapper.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/MergingCodecReader.java (95%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/MergingDirectoryReaderWrapper.java (88%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/MismatchedDirectoryReader.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/MismatchedLeafReader.java (95%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/MockIndexWriterEventListener.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/MockRandomMergePolicy.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/OwnCacheKeyMultiReader.java (84%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/PerThreadPKLookup.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/PointsStackTracker.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/RandomCodec.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/RandomIndexWriter.java (91%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/RandomPostingsTester.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/SuppressingConcurrentMergeScheduler.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/index/ThreadedIndexingAndSearchingTestCase.java (94%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/index/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/DisableFsyncFS.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/ExtrasFS.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterAsynchronousFileChannel.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterDirectoryStream.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterFileChannel.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterFileStore.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterFileSystem.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterFileSystemProvider.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterInputStream2.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterOutputStream2.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterPath.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/FilterSeekableByteChannel.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/HandleLimitFS.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/HandleTrackingFS.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/LeakFS.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/MockFileSystemTestCase.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/ShuffleFS.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/VerboseFS.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/VirusCheckingFS.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/WindowsFS.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/mockfile/package-info.java (57%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingBulkScorer.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingCollector.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingIndexSearcher.java (91%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingLeafCollector.java (89%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingMatches.java (83%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingMatchesIterator.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingQuery.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingScorable.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingScorer.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/AssertingWeight.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/BaseExplanationTestCase.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/BaseRangeFieldQueryTestCase.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/BlockScoreQueryWrapper.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/BulkScorerWrapperScorer.java (91%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/CheckHits.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/MatchesTestBase.java (89%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/QueryUtils.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/RandomApproximationQuery.java (91%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/ScorerIndexSearcher.java (88%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/SearchEquivalenceTestBase.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/ShardSearchingTestBase.java (96%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/search/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/similarities/AssertingSimilarity.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/similarities/BaseSimilarityTestCase.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/search/similarities/RandomSimilarity.java (65%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/BaseChunkedDirectoryTestCase.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/BaseDirectoryTestCase.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/BaseDirectoryWrapper.java (92%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/BaseLockFactoryTestCase.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/CorruptingIndexOutput.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/MockDirectoryWrapper.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/MockIndexInputWrapper.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/MockIndexOutputWrapper.java (95%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/RawDirectoryWrapper.java (90%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/SlowClosingMockIndexInputWrapper.java (95%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/store/SlowOpeningMockIndexInputWrapper.java (95%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/store/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/AbstractBeforeAfterRule.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/BaseBitSetTestCase.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/BaseDocIdSetTestCase.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/CloseableDirectory.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/English.java (99%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/FailOnNonBulkMergesInfoStream.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/FailureMarker.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/LineFileDocs.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/LuceneJUnit3MethodProvider.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/LuceneTestCase.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/NullInfoStream.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/QuickPatchThreadsFilter.java (94%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/RamUsageTester.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/RemoveUponClose.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/Rethrow.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/RunListenerPrintReproduceInfo.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleAssertionsRequired.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleDelegate.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleIgnoreAfterMaxFailures.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleIgnoreTestSuites.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleLimitSysouts.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleMarkFailure.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleRestoreSystemProperties.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleSetupAndRestoreClassEnv.java (86%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleSetupAndRestoreInstanceEnv.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleSetupTeardownChained.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleStoreClassName.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleTemporaryFilesCleanup.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestRuleThreadAndTestName.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestSecurityManager.java (93%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TestUtil.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/ThrottledIndexOutput.java (97%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/TimeUnits.java (96%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/VerifyTestClassNamingConvention.java (98%) rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/automaton/AutomatonTestUtil.java (97%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/util/automaton/package-info.java rename lucene/test-framework/src/java/org/apache/lucene/{ => tests}/util/fst/FSTTester.java (97%) create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/util/fst/package-info.java create mode 100644 lucene/test-framework/src/java/org/apache/lucene/tests/util/package-info.java delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/util/automaton/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/util/fst/package.html delete mode 100644 lucene/test-framework/src/java/org/apache/lucene/util/package.html rename lucene/test-framework/src/resources/org/apache/lucene/{ => tests}/geo/lucene-9251.wkt.gz (100%) rename lucene/test-framework/src/resources/org/apache/lucene/{ => tests}/geo/lucene-9417.geojson.gz (100%) rename lucene/test-framework/src/resources/org/apache/lucene/{ => tests}/geo/lucene-9538-invalid.geojson.gz (100%) rename lucene/test-framework/src/resources/org/apache/lucene/{ => tests}/util/europarl.lines.txt.gz (100%) rename lucene/test-framework/src/resources/org/apache/lucene/{ => tests}/util/europarl.lines.txt.seek (100%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/analysis/TestLookaheadTokenFilter.java (95%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/analysis/TestMockAnalyzer.java (96%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/analysis/TestMockCharFilter.java (93%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/analysis/TestMockSynonymFilter.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/analysis/TestPosition.java (96%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/analysis/TestToken.java (96%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/analysis/TrivialLookaheadFilter.java (97%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/codecs/asserting/TestAssertingDocValuesFormat.java (90%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/codecs/asserting/TestAssertingNormsFormat.java (90%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/codecs/asserting/TestAssertingPointsFormat.java (90%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/codecs/asserting/TestAssertingPostingsFormat.java (91%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/codecs/asserting/TestAssertingStoredFieldsFormat.java (90%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/codecs/asserting/TestAssertingTermVectorsFormat.java (91%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/index/TestAssertingLeafReader.java (85%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/index/TestForceMergePolicy.java (85%) mode change 100755 => 100644 rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestDisableFsyncFS.java (97%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestExtrasFS.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestHandleLimitFS.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestHandleTrackingFS.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestLeakFS.java (99%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestShuffleFS.java (99%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestVerboseFS.java (99%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestVirusCheckingFS.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/mockfile/TestWindowsFS.java (99%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/search/TestBaseExplanationTestCase.java (92%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/store/TestMockDirectoryWrapper.java (94%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/SorePoint.java (96%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/SoreType.java (95%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestBeforeAfterOverrides.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestCodecReported.java (96%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestExceptionInBeforeClassHooks.java (99%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestExpectThrows.java (99%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestFailIfDirectoryNotClosed.java (94%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestFailIfUnreferencedFiles.java (94%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestGroupFiltering.java (97%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestJUnitRuleOrder.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestJvmInfo.java (97%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestMaxFailuresRule.java (97%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestPleaseFail.java (97%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestRamUsageTesterOnWildAnimals.java (97%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestReproduceMessage.java (99%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestReproduceMessageWithRepeated.java (97%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestRunWithRestrictedPermissions.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestSeedFromUncaught.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestSetupTeardownChaining.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestSysoutsLimits.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/TestWorstCaseTestBehavior.java (98%) rename lucene/test-framework/src/test/org/apache/lucene/{ => tests}/util/WithNestedTests.java (97%) diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py index ad350990de7..a1acc879318 100755 --- a/dev-tools/scripts/smokeTestRelease.py +++ b/dev-tools/scripts/smokeTestRelease.py @@ -588,7 +588,7 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs): if len(in_lucene_folder) > 0: raise RuntimeError('lucene: unexpected files/dirs in artifact %s lucene/ folder: %s' % (artifact, in_lucene_folder)) else: - is_in_list(in_root_folder, ['bin', 'docs', 'licenses', 'modules', 'modules-test-framework', 'modules-thirdparty']) + is_in_list(in_root_folder, ['bin', 'docs', 'licenses', 'modules', 'modules-thirdparty']) if len(in_root_folder) > 0: raise RuntimeError('lucene: unexpected files/dirs in artifact %s: %s' % (artifact, in_root_folder)) diff --git a/gradle/documentation/render-javadoc.gradle b/gradle/documentation/render-javadoc.gradle index e4a4f28e293..7bedb0ca112 100644 --- a/gradle/documentation/render-javadoc.gradle +++ b/gradle/documentation/render-javadoc.gradle @@ -226,22 +226,6 @@ configure(project(":lucene:core")) { } } -// Fix for Java 11 Javadoc tool that cannot handle split packages between modules correctly. -// (by removing all the packages which are part of lucene-core) -// See: https://issues.apache.org/jira/browse/LUCENE-8738?focusedCommentId=16818106&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16818106 -// LUCENE-9499: This workaround should be applied only to test-framework (we have no split package in other modules). -configure(project(":lucene:test-framework")) { - project.tasks.withType(RenderJavadocTask) { - doLast { - Set luceneCorePackages = file("${project(':lucene:core').tasks[name].outputDir}/element-list").readLines('UTF-8').toSet(); - File elementFile = file("${outputDir}/element-list"); - List elements = elementFile.readLines('UTF-8'); - elements.removeAll(luceneCorePackages) - elementFile.write(elements.join('\n').concat('\n'), 'UTF-8'); - } - } -} - configure(project(':lucene:demo')) { project.tasks.withType(RenderJavadocTask) { // For the demo, we link the example source in the javadocs, as it's ref'ed elsewhere @@ -415,9 +399,6 @@ class RenderJavadocTask extends DefaultTask { // - find all (enabled) tasks this tasks depends on (with same name), calling findRenderTasksInDependencies() // - sort the tasks preferring those whose project name equals 'core', then lexigraphical by path // - for each task get output dir to create relative or absolute link - // NOTE: explicitly exclude solr/test-framework, or attempting to link to lucene-test-framework because if we did javadoc would - // attempt to link class refs in in org.apache.lucene, causing broken links. (either broken links to things like "Directory" if - // lucene-test-framework was first, or broken links to things like LuceneTestCase if lucene-core was first) findRenderTasksInDependencies() .sort(false, Comparator.comparing { (it.project.name != 'core') as Boolean }.thenComparing(Comparator.comparing { it.path })) .each { otherTask -> diff --git a/gradle/java/modules.gradle b/gradle/java/modules.gradle index 94604b99009..0855423c983 100644 --- a/gradle/java/modules.gradle +++ b/gradle/java/modules.gradle @@ -17,6 +17,9 @@ // Configure miscellaneous aspects required for supporting the java module system layer. +// Debugging utilities. +apply from: buildscript.sourceFile.toPath().resolveSibling("modules-debugging.gradle") + allprojects { plugins.withType(JavaPlugin) { // We won't be using gradle's built-in automatic module finder. diff --git a/gradle/testing/randomization.gradle b/gradle/testing/randomization.gradle index 938ca396db2..90406f4adcd 100644 --- a/gradle/testing/randomization.gradle +++ b/gradle/testing/randomization.gradle @@ -167,10 +167,10 @@ allprojects { if (project.path.endsWith(".tests")) { // LUCENE-10301: for now, do not use the security manager for modular tests (test framework is not available). } else if (project.path == ":lucene:replicator") { - systemProperty 'java.security.manager', "org.apache.lucene.util.TestSecurityManager" + systemProperty 'java.security.manager', "org.apache.lucene.tests.util.TestSecurityManager" systemProperty 'java.security.policy', file("${resources}/policies/replicator-tests.policy") } else if (project.path.startsWith(":lucene")) { - systemProperty 'java.security.manager', "org.apache.lucene.util.TestSecurityManager" + systemProperty 'java.security.manager', "org.apache.lucene.tests.util.TestSecurityManager" systemProperty 'java.security.policy', file("${resources}/policies/tests.policy") } diff --git a/gradle/testing/randomization/policies/tests.policy b/gradle/testing/randomization/policies/tests.policy index 71dc7991fdb..c32ae6cedd2 100644 --- a/gradle/testing/randomization/policies/tests.policy +++ b/gradle/testing/randomization/policies/tests.policy @@ -57,10 +57,7 @@ grant { permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; // needed by cyberneko usage by benchmarks on J9 permission java.lang.RuntimePermission "accessClassInPackage.org.apache.xerces.util"; - // needed by org.apache.logging.log4j - permission java.lang.RuntimePermission "getenv.*"; permission java.lang.RuntimePermission "getClassLoader"; - permission java.lang.RuntimePermission "setContextClassLoader"; // Needed for loading native library (lucene:misc:native) in lucene:misc permission java.lang.RuntimePermission "getFileStoreAttributes"; diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index f1071e57ae1..4003e888ef4 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -46,6 +46,10 @@ API Changes * LUCENE-10197: UnifiedHighlighter now has a Builder to construct it. The UH's setters are now deprecated. (Animesh Pandey, David Smiley) +* LUCENE-10301: the test framework is now a module. All the classes have been moved from + org.apache.lucene.* to org.apache.lucene.tests.* to avoid package name conflicts with the + core module. (Dawid Weiss) + New Features --------------------- diff --git a/lucene/MIGRATE.md b/lucene/MIGRATE.md index d61b9fb5ccf..7862c887ab0 100644 --- a/lucene/MIGRATE.md +++ b/lucene/MIGRATE.md @@ -27,6 +27,13 @@ behind the scenes. It is the responsibility of the caller to to call ## Migration from Lucene 9.0 to Lucene 9.1 +### Test framework package migration and module (LUCENE-10301) + +The test framework is now a module. All the classes have been moved from +`org.apache.lucene.*` to `org.apache.lucene.tests.*` to avoid package name conflicts +with the core module. If you were using the Lucene test framework, the migration should be +fairly automatic (package prefix). + ### Minor syntactical changes in StandardQueryParser (LUCENE-10223) Added interval functions and min-should-match support to `StandardQueryParser`. This diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicAnalyzer.java index a4591d0a8a9..6d3c7b967ba 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicAnalyzer.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.ar; import java.io.IOException; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test the Arabic Analyzer */ public class TestArabicAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java index 246210e76f6..c4f409d899b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicFilters.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.ar; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Arabic filter Factories are working. */ public class TestArabicFilters extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicNormalizationFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicNormalizationFilter.java index d833b3047c3..9ac351b420b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicNormalizationFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicNormalizationFilter.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.ar; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test the Arabic Normalization Filter */ public class TestArabicNormalizationFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicStemFilter.java index 403a1af20ea..f00d9fa3a61 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ar/TestArabicStemFilter.java @@ -18,12 +18,12 @@ package org.apache.lucene.analysis.ar; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test the Arabic Normalization Filter */ public class TestArabicStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianAnalyzer.java index 52411fc131c..c37052eb0c5 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.bg; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test the Bulgarian analyzer */ public class TestBulgarianAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java index 35e8a4ba059..7e34b4c85d2 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.bg; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Bulgarian stem filter factory is working. */ public class TestBulgarianStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemmer.java index d55fe0c7c89..e90a1422d87 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bg/TestBulgarianStemmer.java @@ -19,12 +19,12 @@ package org.apache.lucene.analysis.bg; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test the Bulgarian Stemmer */ public class TestBulgarianStemmer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliAnalyzer.java index d199dfeb6b6..148b9f147ac 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliAnalyzer.java @@ -17,7 +17,7 @@ package org.apache.lucene.analysis.bn; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Tests the BengaliAnalyzer */ public class TestBengaliAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliFilters.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliFilters.java index 54a06618079..c652aace321 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliFilters.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliFilters.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.bn; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Test Bengali Filter Factory */ public class TestBengaliFilters extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliNormalizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliNormalizer.java index 841859c0ac4..eda8775a024 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliNormalizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliNormalizer.java @@ -18,11 +18,11 @@ package org.apache.lucene.analysis.bn; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Test BengaliNormalizer */ public class TestBengaliNormalizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliStemmer.java index 756008a173d..8e7063e9d88 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/bn/TestBengaliStemmer.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.bn; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test Codes for BengaliStemmer */ public class TestBengaliStemmer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/boost/TestDelimitedBoostTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/boost/TestDelimitedBoostTokenFilter.java index 17b5c151018..3a4774c465a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/boost/TestDelimitedBoostTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/boost/TestDelimitedBoostTokenFilter.java @@ -16,10 +16,10 @@ */ package org.apache.lucene.analysis.boost; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.search.BoostAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestDelimitedBoostTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianAnalyzer.java index b1f7adac47c..7bf8da847c3 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianAnalyzer.java @@ -19,13 +19,13 @@ package org.apache.lucene.analysis.br; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.core.LetterTokenizer; import org.apache.lucene.analysis.core.LowerCaseFilter; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** * Test the Brazilian Stem Filter, which only modifies the term text. diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java index 81dd93b6cd7..0a7e2a2c6ea 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/br/TestBrazilianStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.br; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Brazilian stem filter factory is working. */ public class TestBrazilianStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ca/TestCatalanAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ca/TestCatalanAnalyzer.java index 444eef3d641..048e08e3d55 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ca/TestCatalanAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ca/TestCatalanAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ca; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestCatalanAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilter.java index d91baa657e5..de07c9d9878 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilter.java @@ -26,10 +26,10 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; public class TestHTMLStripCharFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java index 8c28f442b0d..72eddd3083d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestHTMLStripCharFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.charfilter; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure this factory is working */ public class TestHTMLStripCharFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilter.java index 79a8a44b616..07b8f6a560a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilter.java @@ -26,12 +26,12 @@ import java.util.Map; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; public class TestMappingCharFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java index eb14290920d..240daebb119 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/TestMappingCharFilterFactory.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.analysis.charfilter; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; public class TestMappingCharFilterFactory extends BaseTokenStreamFactoryTestCase { public void testParseString() throws Exception { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKAnalyzer.java index e22bb1454c0..60de5c516b4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKAnalyzer.java @@ -19,9 +19,7 @@ package org.apache.lucene.analysis.cjk; import java.io.IOException; import java.io.Reader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; @@ -31,6 +29,8 @@ import org.apache.lucene.analysis.charfilter.NormalizeCharMap; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.standard.StandardTokenizer; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Most tests adopted from TestCJKTokenizer */ public class TestCJKAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilter.java index e8271e51634..4e6499ed96f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilter.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.cjk; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.standard.StandardTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.IOUtils; public class TestCJKBigramFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java index 2bf8bedb955..428292c3a46 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKBigramFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.cjk; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the CJK bigram factory is working. */ public class TestCJKBigramFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthCharFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthCharFilter.java index 8f9239654f9..038b41fd9f2 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthCharFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthCharFilter.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.io.Reader; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestCJKWidthCharFilter extends BaseTokenStreamTestCase { /** Full-width ASCII forms normalized to half-width (basic latin) */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthCharFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthCharFilterFactory.java index 8b3ecec8114..833845003c4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthCharFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthCharFilterFactory.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.cjk; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure {@link CJKWidthCharFilter} is working */ public class TestCJKWidthCharFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilter.java index 9cdde2ff05c..967af7fce01 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.cjk; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests for {@link CJKWidthFilter} */ public class TestCJKWidthFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java index 611bd5fb9b3..20e610a59be 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cjk/TestCJKWidthFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.cjk; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the CJKWidthFilterFactory is working */ public class TestCJKWidthFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniAnalyzer.java index 3309da0cd55..42f6a521775 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ckb; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test the Sorani analyzer */ public class TestSoraniAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilter.java index 6a6f9ed2fc9..44c73657090 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.ckb; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests normalization for Sorani (this is more critical than stemming...) */ public class TestSoraniNormalizationFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java index af51b813b02..acbd6454bd4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniNormalizationFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ckb; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Sorani normalization factory is working. */ public class TestSoraniNormalizationFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilter.java index 41591a64f18..d2f4e9ec460 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilter.java @@ -16,15 +16,15 @@ */ package org.apache.lucene.analysis.ckb; -import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary; +import static org.apache.lucene.tests.analysis.VocabularyAssert.assertVocabulary; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test the Sorani Stemmer. */ public class TestSoraniStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java index 7a5693d9326..317d29abf21 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ckb/TestSoraniStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.ckb; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Sorani stem factory is working. */ public class TestSoraniStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/classic/TestClassicAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/classic/TestClassicAnalyzer.java index b649807045d..c84918bc00d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/classic/TestClassicAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/classic/TestClassicAnalyzer.java @@ -19,7 +19,6 @@ package org.apache.lucene.analysis.classic; import java.io.IOException; import java.util.Arrays; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -33,6 +32,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.BytesRef; /** tests for classicanalyzer */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/classic/TestClassicFactories.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/classic/TestClassicFactories.java index 27643fe487b..3eb2b03cce7 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/classic/TestClassicFactories.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/classic/TestClassicFactories.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.classic; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the classic lucene factories are working. */ public class TestClassicFactories extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilter.java index 2ce0d3aec2e..9f708612058 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilter.java @@ -19,13 +19,13 @@ package org.apache.lucene.analysis.commongrams; import java.io.StringReader; import java.util.Arrays; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.WhitespaceTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests CommonGrams(Query)Filter */ public class TestCommonGramsFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java index d93cd6078eb..ab3c3641899 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsFilterFactory.java @@ -17,11 +17,11 @@ package org.apache.lucene.analysis.commongrams; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.ClasspathResourceLoader; import org.apache.lucene.util.ResourceLoader; import org.apache.lucene.util.Version; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java index 309f731dd9e..4296a7a4fcc 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/commongrams/TestCommonGramsQueryFilterFactory.java @@ -16,11 +16,11 @@ */ package org.apache.lucene.analysis.commongrams; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.TestStopFilterFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.ClasspathResourceLoader; import org.apache.lucene.util.ResourceLoader; import org.apache.lucene.util.Version; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java index 4d36c19025b..67a36f94223 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java @@ -21,9 +21,7 @@ import java.io.Reader; import java.io.StringReader; import java.util.Arrays; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -32,6 +30,8 @@ import org.apache.lucene.analysis.charfilter.NormalizeCharMap; import org.apache.lucene.analysis.compound.hyphenation.HyphenationTree; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.Attribute; import org.apache.lucene.util.AttributeImpl; import org.apache.lucene.util.AttributeReflector; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java index 1f861408d99..cfe2f432b65 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestDictionaryCompoundWordTokenFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.compound; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Dictionary compound filter factory is working. */ public class TestDictionaryCompoundWordTokenFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java index de51ed6fb93..d13e518faed 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/compound/TestHyphenationCompoundWordTokenFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.compound; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Hyphenation compound filter factory is working. */ public class TestHyphenationCompoundWordTokenFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java index b5d0570118f..945177b69af 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java @@ -29,24 +29,11 @@ import java.util.Set; import org.apache.lucene.analysis.CachingTokenFilter; import org.apache.lucene.analysis.CharFilter; import org.apache.lucene.analysis.CharFilterFactory; -import org.apache.lucene.analysis.CrankyTokenFilter; -import org.apache.lucene.analysis.MockCharFilter; -import org.apache.lucene.analysis.MockFixedLengthPayloadFilter; -import org.apache.lucene.analysis.MockGraphTokenFilter; -import org.apache.lucene.analysis.MockHoleInjectingTokenFilter; -import org.apache.lucene.analysis.MockLowerCaseFilter; -import org.apache.lucene.analysis.MockRandomLookaheadTokenFilter; -import org.apache.lucene.analysis.MockSynonymFilter; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.MockVariableLengthPayloadFilter; -import org.apache.lucene.analysis.SimplePayloadFilter; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.TokenizerFactory; -import org.apache.lucene.analysis.ValidatingTokenFilter; import org.apache.lucene.analysis.miscellaneous.PatternKeywordMarkerFilter; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; import org.apache.lucene.analysis.path.ReversePathHierarchyTokenizer; @@ -54,7 +41,20 @@ import org.apache.lucene.analysis.sinks.TeeSinkTokenFilter; import org.apache.lucene.analysis.snowball.SnowballFilter; import org.apache.lucene.analysis.sr.SerbianNormalizationRegularFilter; import org.apache.lucene.analysis.util.StringMockResourceLoader; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.CrankyTokenFilter; +import org.apache.lucene.tests.analysis.MockCharFilter; +import org.apache.lucene.tests.analysis.MockFixedLengthPayloadFilter; +import org.apache.lucene.tests.analysis.MockGraphTokenFilter; +import org.apache.lucene.tests.analysis.MockHoleInjectingTokenFilter; +import org.apache.lucene.tests.analysis.MockLowerCaseFilter; +import org.apache.lucene.tests.analysis.MockRandomLookaheadTokenFilter; +import org.apache.lucene.tests.analysis.MockSynonymFilter; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.MockVariableLengthPayloadFilter; +import org.apache.lucene.tests.analysis.SimplePayloadFilter; +import org.apache.lucene.tests.analysis.ValidatingTokenFilter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ResourceLoader; import org.apache.lucene.util.ResourceLoaderAware; import org.apache.lucene.util.Version; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAnalyzers.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAnalyzers.java index 305c9f9543e..7ca07cfb8a3 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAnalyzers.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAnalyzers.java @@ -19,7 +19,6 @@ package org.apache.lucene.analysis.core; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.LowerCaseFilter; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; @@ -28,6 +27,7 @@ import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.analysis.standard.StandardTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java index a1a754bceb9..28777e8fdb6 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestBugInSomething.java @@ -23,12 +23,8 @@ import java.nio.CharBuffer; import java.util.Arrays; import java.util.HashSet; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.CharFilter; -import org.apache.lucene.analysis.MockCharFilter; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -40,7 +36,11 @@ import org.apache.lucene.analysis.ngram.EdgeNGramTokenizer; import org.apache.lucene.analysis.ngram.NGramTokenFilter; import org.apache.lucene.analysis.shingle.ShingleFilter; import org.apache.lucene.analysis.wikipedia.WikipediaTokenizer; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockCharFilter; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; @SuppressCodecs("Direct") public class TestBugInSomething extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestCoreFactories.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestCoreFactories.java index fcd0b5108ff..90368c772cd 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestCoreFactories.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestCoreFactories.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.core; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the core lucene factories are working. */ public class TestCoreFactories extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilter.java index fbf7b0d0a53..c91da6314bd 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilter.java @@ -18,12 +18,12 @@ package org.apache.lucene.analysis.core; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.SparseFixedBitSet; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java index e0f4df3fc3f..ccb9719a7c4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDecimalDigitFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.core; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the digit normalization factory is working. */ public class TestDecimalDigitFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDuelingAnalyzers.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDuelingAnalyzers.java index 3142f57c5d3..8f336c269da 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDuelingAnalyzers.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestDuelingAnalyzers.java @@ -20,16 +20,16 @@ import java.io.Reader; import java.io.StringReader; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockReaderWrapper; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockReaderWrapper; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.Operations; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java index a20e1eed519..95b8bddb114 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFactories.java @@ -27,17 +27,17 @@ import java.util.Map; import java.util.Set; import org.apache.lucene.analysis.AbstractAnalysisFactory; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilterFactory; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.TokenizerFactory; import org.apache.lucene.analysis.boost.DelimitedBoostTokenFilterFactory; import org.apache.lucene.analysis.miscellaneous.DelimitedTermFrequencyTokenFilterFactory; import org.apache.lucene.analysis.util.StringMockResourceLoader; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.lucene.util.AttributeFactory; -import org.apache.lucene.util.LuceneTestCase.Nightly; import org.apache.lucene.util.ResourceLoaderAware; import org.apache.lucene.util.Version; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFlattenGraphFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFlattenGraphFilter.java index 2452a36a04f..7b35f56016c 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFlattenGraphFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestFlattenGraphFilter.java @@ -26,17 +26,17 @@ import java.util.Random; import java.util.stream.Collectors; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.AutomatonToTokenStream; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.TokenStreamToAutomaton; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.synonym.SynonymGraphFilter; import org.apache.lucene.analysis.synonym.SynonymMap; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.CharsRefBuilder; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java index a75ebd5620d..f2800154f30 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java @@ -18,7 +18,6 @@ package org.apache.lucene.analysis.core; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.document.Document; @@ -33,9 +32,10 @@ import org.apache.lucene.index.PostingsEnum; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; public class TestKeywordAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordTokenizer.java index 229761d3f20..03ee77593d9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordTokenizer.java @@ -20,8 +20,8 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.AttributeFactory; public class TestKeywordTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java index 99061d50e20..98256b3b6f2 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java @@ -48,18 +48,13 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.regex.Pattern; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CachingTokenFilter; import org.apache.lucene.analysis.CharArrayMap; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.CharFilter; -import org.apache.lucene.analysis.CrankyTokenFilter; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; -import org.apache.lucene.analysis.ValidatingTokenFilter; import org.apache.lucene.analysis.boost.DelimitedBoostTokenFilter; import org.apache.lucene.analysis.charfilter.NormalizeCharMap; import org.apache.lucene.analysis.cjk.CJKBigramFilter; @@ -95,14 +90,19 @@ import org.apache.lucene.analysis.standard.StandardTokenizer; import org.apache.lucene.analysis.synonym.SynonymMap; import org.apache.lucene.analysis.wikipedia.WikipediaTokenizer; import org.apache.lucene.store.ByteBuffersDirectory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CrankyTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.ValidatingTokenFilter; +import org.apache.lucene.tests.util.Rethrow; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.AttributeFactory; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.CharsRef; -import org.apache.lucene.util.Rethrow; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopAnalyzer.java index a012e44ed5e..29b3089a819 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopAnalyzer.java @@ -20,12 +20,12 @@ import java.io.IOException; import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestStopAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java index e82a356bf8e..0946a922439 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestStopFilterFactory.java @@ -16,9 +16,9 @@ */ package org.apache.lucene.analysis.core; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.en.EnglishAnalyzer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.ClasspathResourceLoader; import org.apache.lucene.util.ResourceLoader; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilter.java index 32ce49624e2..0de7e525bd3 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilter.java @@ -20,13 +20,13 @@ import java.io.IOException; import java.io.StringReader; import java.util.Collections; import java.util.Set; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.standard.StandardTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; -import org.apache.lucene.util.English; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.English; public class TestTypeTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java index fa7b9430324..ffcbcbcc583 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestTypeTokenFilterFactory.java @@ -17,9 +17,9 @@ package org.apache.lucene.analysis.core; import java.util.Set; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.CannedTokenStream; import org.apache.lucene.analysis.TokenFilterFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; /** Testcase for {@link TypeTokenFilterFactory} */ public class TestTypeTokenFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestUnicodeWhitespaceTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestUnicodeWhitespaceTokenizer.java index f9510eb0e50..f8f3fe11496 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestUnicodeWhitespaceTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestUnicodeWhitespaceTokenizer.java @@ -20,8 +20,8 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.AttributeFactory; public class TestUnicodeWhitespaceTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestWhitespaceAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestWhitespaceAnalyzer.java index 384b2944820..3d0b538a678 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestWhitespaceAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestWhitespaceAnalyzer.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis.core; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestWhitespaceAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java index f87551279f6..cd4e77cca5e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/custom/TestCustomAnalyzer.java @@ -23,7 +23,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; import org.apache.lucene.analysis.CharFilterFactory; import org.apache.lucene.analysis.LowerCaseFilter; @@ -41,6 +40,7 @@ import org.apache.lucene.analysis.core.WhitespaceTokenizerFactory; import org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilterFactory; import org.apache.lucene.analysis.reverse.ReverseStringFilterFactory; import org.apache.lucene.analysis.standard.StandardTokenizerFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.AttributeFactory; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.SetOnce.AlreadySetException; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechAnalyzer.java index baa517df7db..0dc4547c379 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.cz; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** * Test the CzechAnalyzer diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java index 1a7f620fdac..0e28d8157ce 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.cz; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Czech stem filter factory is working. */ public class TestCzechStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemmer.java index 8890b0c37a2..61047d23f6d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechStemmer.java @@ -19,12 +19,12 @@ package org.apache.lucene.analysis.cz; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** * Test the Czech Stemmer. diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/da/TestDanishAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/da/TestDanishAnalyzer.java index c7619ac2314..d04d9795ab2 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/da/TestDanishAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/da/TestDanishAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.da; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestDanishAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanAnalyzer.java index 0159130dba5..faa3ab9038e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanAnalyzer.java @@ -19,12 +19,12 @@ package org.apache.lucene.analysis.de; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.LowerCaseFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.LetterTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestGermanAnalyzer extends BaseTokenStreamTestCase { public void testReusableTokenStream() throws Exception { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilter.java index 5e557fab28b..564bb569f27 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.de; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link GermanLightStemFilter} */ public class TestGermanLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java index 52baa3f8abf..d7d9dc49939 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanLightStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.de; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the German light stem factory is working. */ public class TestGermanLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilter.java index 08cc577b036..3154478b7d9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.de; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link GermanMinimalStemFilter} */ public class TestGermanMinimalStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java index d0d93a7f837..eb55a201e40 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanMinimalStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.de; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the German minimal stem factory is working. */ public class TestGermanMinimalStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilter.java index f0613f6bc11..357c70d9fba 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilter.java @@ -18,11 +18,11 @@ package org.apache.lucene.analysis.de; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests {@link GermanNormalizationFilter} */ public class TestGermanNormalizationFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java index bd1fc23cc9d..d05fddc4af8 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanNormalizationFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.de; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the German normalization factory is working. */ public class TestGermanNormalizationFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilter.java index 0b9c5235693..5ebe4f13ce4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilter.java @@ -16,19 +16,19 @@ */ package org.apache.lucene.analysis.de; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import java.io.InputStream; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.LowerCaseFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** * Test the German stemmer. The stemming algorithm is known to work less than perfect, as it doesn't diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java index 95554470c66..658d366d276 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/de/TestGermanStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.de; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the German stem filter factory is working. */ public class TestGermanStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekAnalyzer.java index 30d2965754a..91cf775c322 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekAnalyzer.java @@ -17,7 +17,7 @@ package org.apache.lucene.analysis.el; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** A unit test class for verifying the correct operation of the GreekAnalyzer. */ public class TestGreekAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java index 57d14fd6c19..b10909536dc 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekLowerCaseFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.el; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Greek lowercase filter factory is working. */ public class TestGreekLowerCaseFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java index 40595ba4783..965acdd48fe 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.el; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Greek stem filter factory is working. */ public class TestGreekStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemmer.java index 0eb34890811..9b5ddc42449 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/el/TestGreekStemmer.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.el; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestGreekStemmer extends BaseTokenStreamTestCase { private Analyzer a; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailAnalyzer.java index 90586037084..52f89647278 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailAnalyzer.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis.email; import java.io.IOException; import java.util.Arrays; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestUAX29URLEmailAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailTokenizer.java index 6eb226d43df..c72c9073c66 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailTokenizer.java @@ -30,15 +30,15 @@ import java.util.Random; import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; -import org.apache.lucene.analysis.standard.EmojiTokenizationTestUnicode_12_1; -import org.apache.lucene.analysis.standard.WordBreakTestUnicode_12_1_0; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.standard.EmojiTokenizationTestUnicode_12_1; +import org.apache.lucene.tests.analysis.standard.WordBreakTestUnicode_12_1_0; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; public class TestUAX29URLEmailTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailTokenizerFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailTokenizerFactory.java index bb038ca3de7..1d590cad1cc 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailTokenizerFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/email/TestUAX29URLEmailTokenizerFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.email; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** A few tests based on org.apache.lucene.analysis.TestUAX29URLEmailTokenizer */ public class TestUAX29URLEmailTokenizerFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishAnalyzer.java index 54021509c40..69698d5bd61 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.en; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestEnglishAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilter.java index b915f8d1a57..f4b15ebc739 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.en; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link EnglishMinimalStemFilter} */ public class TestEnglishMinimalStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java index 018fbb846be..404ce2241de 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestEnglishMinimalStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.en; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the English minimal stem factory is working. */ public class TestEnglishMinimalStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java index 021758d08d9..3997fff70f1 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.en; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the kstem filter factory is working. */ public class TestKStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemmer.java index fb2091d8713..385f0a76e17 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestKStemmer.java @@ -16,14 +16,14 @@ */ package org.apache.lucene.analysis.en; -import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary; +import static org.apache.lucene.tests.analysis.VocabularyAssert.assertVocabulary; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.junit.Ignore; /** Tests for {@link KStemmer} */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilter.java index 5a3a32dfaa7..87ece3a96cc 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilter.java @@ -16,18 +16,18 @@ */ package org.apache.lucene.analysis.en; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test the PorterStemFilter with Martin Porter's test data. */ public class TestPorterStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java index 20c26dad910..1e8e815a7d3 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/en/TestPorterStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.en; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Porter stem filter factory is working. */ public class TestPorterStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishAnalyzer.java index 68f42da08e2..b2017bbd9f7 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.es; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestSpanishAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilter.java index 10f8da23697..a0770bafb72 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilter.java @@ -16,14 +16,14 @@ */ package org.apache.lucene.analysis.es; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link SpanishLightStemFilter} */ public class TestSpanishLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java index 5b17ce2110b..f2099451b1d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishLightStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.es; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Spanish Light stem factory is working. */ public class TestSpanishLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishMinimalStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishMinimalStemFilter.java index 7cd511ebb78..d170f379554 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishMinimalStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishMinimalStemFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.es; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.en.EnglishMinimalStemFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** * Simple tests for {@link SpanishMinimalStemFilter} diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishMinimalStemFilterFactory.java index d71615e6fa3..ebb9fc458e6 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishMinimalStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishMinimalStemFilterFactory.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.es; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** * Simple tests to ensure the spanish minimal stem factory is working. diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishPluralStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishPluralStemFilter.java index 9381b900b11..49173904eb9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishPluralStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishPluralStemFilter.java @@ -16,14 +16,14 @@ */ package org.apache.lucene.analysis.es; -import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary; +import static org.apache.lucene.tests.analysis.VocabularyAssert.assertVocabulary; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link SpanishPluralStemFilter} */ public class TestSpanishPluralStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishPluralStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishPluralStemFilterFactory.java index 8abe7121942..a639d614516 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishPluralStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/es/TestSpanishPluralStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.es; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Spanish Plural stem factory is working. */ public class TestSpanishPluralStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/et/TestEstonianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/et/TestEstonianAnalyzer.java index e6169b0051a..6bde0723a12 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/et/TestEstonianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/et/TestEstonianAnalyzer.java @@ -18,7 +18,7 @@ package org.apache.lucene.analysis.et; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestEstonianAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/eu/TestBasqueAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/eu/TestBasqueAnalyzer.java index 263a9aa813e..9042c218280 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/eu/TestBasqueAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/eu/TestBasqueAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.eu; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestBasqueAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianAnalyzer.java index e1c642134f3..e6498d58fb4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianAnalyzer.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.fa; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test the Persian Analyzer */ public class TestPersianAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianCharFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianCharFilter.java index 13cd9e0a195..ba6a257eb3a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianCharFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianCharFilter.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.fa; import java.io.Reader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestPersianCharFilter extends BaseTokenStreamTestCase { private Analyzer analyzer; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilter.java index a1180cb0c32..89609df93ac 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.fa; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test the Persian Normalization Filter */ public class TestPersianNormalizationFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java index 667325e2de0..e3716228216 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianNormalizationFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.fa; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Persian normalization factory is working. */ public class TestPersianNormalizationFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishAnalyzer.java index fe2cc1197c3..74facc196d5 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.fi; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestFinnishAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilter.java index 145aa55ac08..cac78c260e5 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.fi; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link FinnishLightStemFilter} */ public class TestFinnishLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java index 82d930ab458..8ec532ec1f3 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fi/TestFinnishLightStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.fi; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Finnish light stem factory is working. */ public class TestFinnishLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchAnalyzer.java index 2e3a64e4e48..a975b619c8e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.fr; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test case for FrenchAnalyzer. */ public class TestFrenchAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilter.java index 53aba98fcb4..5844472004d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.fr; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link FrenchLightStemFilter} */ public class TestFrenchLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java index d6cbeab2c0b..ea9de378de9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchLightStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.fr; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the French light stem factory is working. */ public class TestFrenchLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilter.java index 036f9584917..e0880db43ad 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.fr; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link FrenchMinimalStemFilter} */ public class TestFrenchMinimalStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java index 19ebea7ff35..73545a13526 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/fr/TestFrenchMinimalStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.fr; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the French minimal stem factory is working. */ public class TestFrenchMinimalStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishAnalyzer.java index 138d189df46..02a5ad29875 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ga; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestIrishAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilter.java index 08167c9a8df..d85d8b3bcc1 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.ga; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test the Irish lowercase filter. */ public class TestIrishLowerCaseFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java index ccf7a00deb8..520f3844da2 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ga/TestIrishLowerCaseFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ga; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Irish lowercase filter factory is working. */ public class TestIrishLowerCaseFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianAnalyzer.java index e0dcaeb7cea..91b1d6a1d72 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.gl; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestGalicianAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilter.java index d3d79e63740..d744eddca59 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilter.java @@ -18,13 +18,13 @@ package org.apache.lucene.analysis.gl; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link GalicianMinimalStemmer} */ public class TestGalicianMinimalStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java index 18318a1e59d..6e927660844 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianMinimalStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.gl; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Galician plural stem factory is working. */ public class TestGalicianMinimalStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilter.java index 2a84d8aa3e1..f26e67c7eba 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilter.java @@ -16,14 +16,14 @@ */ package org.apache.lucene.analysis.gl; -import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary; +import static org.apache.lucene.tests.analysis.VocabularyAssert.assertVocabulary; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link GalicianStemFilter} */ public class TestGalicianStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java index 5f088a26d7f..fc613332d36 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/gl/TestGalicianStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.gl; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Galician stem factory is working. */ public class TestGalicianStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiAnalyzer.java index a61ea9b8a47..bc5c98e6b0b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiAnalyzer.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.hi; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Tests the HindiAnalyzer */ public class TestHindiAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java index b795997a758..45e20120b91 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiFilters.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.hi; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Hindi filter Factories are working. */ public class TestHindiFilters extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiNormalizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiNormalizer.java index 0a9e3be49a3..d71391805cf 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiNormalizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiNormalizer.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.hi; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test HindiNormalizer */ public class TestHindiNormalizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiStemmer.java index 14208b84387..6f5a1b72669 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hi/TestHindiStemmer.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.hi; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test HindiStemmer */ public class TestHindiStemmer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianAnalyzer.java index f9782d420c4..1d977f8d402 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.hu; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestHungarianAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilter.java index 2162d5dc5c6..7c8ce773ca4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.hu; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link HungarianLightStemFilter} */ public class TestHungarianLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java index 01a79d340c1..26e6aa67c98 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hu/TestHungarianLightStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.hu; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Hungarian light stem factory is working. */ public class TestHungarianLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/StemmerTestBase.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/StemmerTestBase.java index 5ea1d334557..bdffa5a3dad 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/StemmerTestBase.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/StemmerTestBase.java @@ -23,9 +23,9 @@ import java.text.ParseException; import java.util.Arrays; import java.util.List; import org.apache.lucene.store.ByteBuffersDirectory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.AfterClass; /** base class for hunspell stemmer tests */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java index 51c76d8cb0e..eb3938c58cb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java @@ -23,8 +23,8 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.CharsRef; -import org.apache.lucene.util.LuceneTestCase; /** Tests that > 64k affixes actually works and doesnt overflow some internal int */ public class Test64kAffixes extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAffixCondition.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAffixCondition.java index c419040f92e..301c19e9111 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAffixCondition.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAffixCondition.java @@ -21,7 +21,7 @@ import static org.apache.lucene.analysis.hunspell.AffixCondition.ALWAYS_TRUE_KEY import static org.apache.lucene.analysis.hunspell.AffixKind.PREFIX; import static org.apache.lucene.analysis.hunspell.AffixKind.SUFFIX; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestAffixCondition extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java index 670dea96717..999ee2b234b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java @@ -41,12 +41,12 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.RamUsageTester; import org.apache.lucene.util.NamedThreadFactory; import org.apache.lucene.util.RamUsageEstimator; -import org.apache.lucene.util.RamUsageTester; import org.junit.Assert; import org.junit.Assume; import org.junit.Ignore; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java index 41ece96492c..3ba00941109 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java @@ -34,8 +34,8 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; public class TestDictionary extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java index 598e74c6d77..3da1f114a16 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java @@ -26,7 +26,7 @@ import java.text.ParseException; import java.util.Collections; import java.util.concurrent.CancellationException; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestHunspell extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java index b5d44064266..ccd1a250515 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java @@ -21,13 +21,13 @@ import java.io.InputStream; import java.util.Arrays; import java.util.Collections; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.IOUtils; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java index 6fbfa9dc262..54abd095684 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.hunspell; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Hunspell stemmer loads from factory */ public class TestHunspellStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestPerformance.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestPerformance.java index 9b2ef820480..61410c9939e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestPerformance.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestPerformance.java @@ -35,7 +35,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; import org.junit.Assume; import org.junit.AssumptionViolatedException; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java index 7e175b6b922..15e452ce133 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java @@ -24,8 +24,8 @@ import java.text.ParseException; import java.util.List; import java.util.stream.Collectors; import org.apache.lucene.store.ByteBuffersDirectory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestSpellChecking extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestTrigramAutomaton.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestTrigramAutomaton.java index a424d23b1ac..49134ff199f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestTrigramAutomaton.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestTrigramAutomaton.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.hunspell; import java.util.stream.Collectors; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.CharsRef; -import org.apache.lucene.util.LuceneTestCase; public class TestTrigramAutomaton extends LuceneTestCase { public void testSameScore() { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hy/TestArmenianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hy/TestArmenianAnalyzer.java index cb9db24a86c..23951fde2a8 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hy/TestArmenianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hy/TestArmenianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.hy; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestArmenianAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianAnalyzer.java index 300bcfc5bb1..ff5fc53f4e1 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.id; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestIndonesianAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java index bb19b488449..1e7ef1bc6fd 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.id; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Indonesian stem filter factory is working. */ public class TestIndonesianStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemmer.java index f98ad3f71e8..8a63ae5c394 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/id/TestIndonesianStemmer.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.id; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.IOUtils; /** Tests {@link IndonesianStemmer} */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/in/TestIndicNormalizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/in/TestIndicNormalizer.java index ec389c69bc7..e214620c61e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/in/TestIndicNormalizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/in/TestIndicNormalizer.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.in; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test IndicNormalizer */ public class TestIndicNormalizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianAnalyzer.java index 8cc3d5bb8b2..5c667524113 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.it; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestItalianAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilter.java index 78724847def..929cd911665 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilter.java @@ -16,14 +16,14 @@ */ package org.apache.lucene.analysis.it; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link ItalianLightStemFilter} */ public class TestItalianLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java index d2d0754d0c7..600bb3e5833 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/it/TestItalianLightStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.it; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Italian light stem factory is working. */ public class TestItalianLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lt/TestLithuanianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lt/TestLithuanianAnalyzer.java index 6a071df38b6..f8e37ec2e99 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lt/TestLithuanianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lt/TestLithuanianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.lt; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestLithuanianAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lt/TestLithuanianStemming.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lt/TestLithuanianStemming.java index c1976bc62fe..329f9ef44b7 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lt/TestLithuanianStemming.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lt/TestLithuanianStemming.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.lt; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.snowball.SnowballFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.tartarus.snowball.ext.LithuanianStemmer; /** diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianAnalyzer.java index db1df0efb84..8ede4d58765 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.lv; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestLatvianAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java index e88a1ea1ce2..a55e300be8c 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.lv; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Latvian stem factory is working. */ public class TestLatvianStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemmer.java index 192b25b31d3..3cd170101eb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/lv/TestLatvianStemmer.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.lv; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Basic tests for {@link LatvianStemmer} */ public class TestLatvianStemmer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/minhash/TestMinHashFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/minhash/TestMinHashFilter.java index e14077743ac..e6b9525a5e7 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/minhash/TestMinHashFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/minhash/TestMinHashFilter.java @@ -23,13 +23,13 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.minhash.MinHashFilter.FixedSizeTreeSet; import org.apache.lucene.analysis.minhash.MinHashFilter.LongPair; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestASCIIFoldingFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestASCIIFoldingFilter.java index d42ac6c5934..706952abbf0 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestASCIIFoldingFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestASCIIFoldingFilter.java @@ -21,12 +21,12 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestASCIIFoldingFilter extends BaseTokenStreamTestCase { /** Pop one input token's worth of tokens off the filter and verify that they are as expected. */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestAsciiFoldingFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestAsciiFoldingFilterFactory.java index 03761e0726d..67abfc81e08 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestAsciiFoldingFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestAsciiFoldingFilterFactory.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import java.util.Collections; import java.util.HashMap; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; public class TestAsciiFoldingFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilter.java index 88d3d3200b7..a4ca04efdf3 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilter.java @@ -25,11 +25,11 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.junit.Test; /** Tests {@link CapitalizationFilter} */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java index 4d83ebdbfbb..1d9876d97cd 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCapitalizationFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; public class TestCapitalizationFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilter.java index 733d10b99be..e9d319bd971 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Test; public class TestCodepointCountFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java index 0f9d7dc6426..eba7df9a014 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestCodepointCountFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestCodepointCountFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenateGraphFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenateGraphFilter.java index 4e13d036909..48a331237fa 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenateGraphFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenateGraphFilter.java @@ -18,8 +18,6 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; @@ -27,6 +25,8 @@ import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.synonym.SynonymFilter; import org.apache.lucene.analysis.synonym.SynonymGraphFilter; import org.apache.lucene.analysis.synonym.SynonymMap; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.CharsRefBuilder; import org.junit.Test; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenateGraphFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenateGraphFilterFactory.java index 3b60c2374f5..9cee7e59cb9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenateGraphFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenateGraphFilterFactory.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestConcatenateGraphFilterFactory extends BaseTokenStreamFactoryTestCase { public void test() throws Exception { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenatingTokenStream.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenatingTokenStream.java index 51dd1389861..00efa01bf2d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenatingTokenStream.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConcatenatingTokenStream.java @@ -19,13 +19,13 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.FlagsAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; import org.apache.lucene.util.AttributeFactory; public class TestConcatenatingTokenStream extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConditionalTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConditionalTokenFilter.java index 8058c116f1b..272dfd6a546 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConditionalTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestConditionalTokenFilter.java @@ -24,17 +24,12 @@ import java.util.Random; import java.util.function.Function; import java.util.regex.Pattern; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.CharacterUtils; import org.apache.lucene.analysis.FilteringTokenFilter; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; -import org.apache.lucene.analysis.ValidatingTokenFilter; import org.apache.lucene.analysis.classic.ClassicTokenizer; import org.apache.lucene.analysis.core.TypeTokenFilter; import org.apache.lucene.analysis.de.GermanStemFilter; @@ -49,6 +44,11 @@ import org.apache.lucene.analysis.synonym.SynonymMap; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.analysis.ValidatingTokenFilter; public class TestConditionalTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDateRecognizerFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDateRecognizerFilter.java index 5c5afec2fff..236bc1cb2fe 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDateRecognizerFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDateRecognizerFilter.java @@ -20,8 +20,8 @@ import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Locale; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestDateRecognizerFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDateRecognizerFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDateRecognizerFilterFactory.java index 28831b01205..7b15a1fff85 100755 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDateRecognizerFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDateRecognizerFilterFactory.java @@ -18,7 +18,7 @@ package org.apache.lucene.analysis.miscellaneous; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestDateRecognizerFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDelimitedTermFrequencyTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDelimitedTermFrequencyTokenFilter.java index 3c84f82a14a..8724873a7bd 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDelimitedTermFrequencyTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDelimitedTermFrequencyTokenFilter.java @@ -17,10 +17,10 @@ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.TermFrequencyAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestDelimitedTermFrequencyTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDropIfFlaggedFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDropIfFlaggedFilter.java index 84e13950513..8d062759fdb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDropIfFlaggedFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDropIfFlaggedFilter.java @@ -16,10 +16,10 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; /** Test that this filter removes tokens that match a particular set of flags. */ public class TestDropIfFlaggedFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDropIfFlaggedFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDropIfFlaggedFilterFactory.java index c1afbbfa645..ca9ff4fb8f4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDropIfFlaggedFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestDropIfFlaggedFilterFactory.java @@ -17,11 +17,11 @@ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; /** This test just ensures the factory works, detailed tests in {@link TestDropIfFlaggedFilter} */ public class TestDropIfFlaggedFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestEmptyTokenStream.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestEmptyTokenStream.java index d4f5b683391..8aa86e76891 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestEmptyTokenStream.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestEmptyTokenStream.java @@ -17,7 +17,6 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute; import org.apache.lucene.document.Document; @@ -26,6 +25,7 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestEmptyTokenStream extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilter.java index 3746f006fa3..77690c49dae 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilter.java @@ -16,9 +16,9 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestFingerprintFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java index ee59c540121..82a8908cf86 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFingerprintFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestFingerprintFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFixBrokenOffsetsFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFixBrokenOffsetsFilter.java index afdffd2f66f..4b9c8e17424 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFixBrokenOffsetsFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestFixBrokenOffsetsFilter.java @@ -18,15 +18,15 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; @Deprecated public class TestFixBrokenOffsetsFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestHyphenatedWordsFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestHyphenatedWordsFilter.java index 0590d5ca5ce..26ba7ce5ec7 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestHyphenatedWordsFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestHyphenatedWordsFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** HyphenatedWordsFilter test */ public class TestHyphenatedWordsFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java index baf6a711740..0f362002fcc 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepFilterFactory.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.ClasspathResourceLoader; import org.apache.lucene.util.ResourceLoader; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepWordFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepWordFilter.java index 4cfbce7ff27..a390b71a699 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepWordFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeepWordFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.miscellaneous; import java.util.HashSet; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test {@link KeepWordFilter} */ public class TestKeepWordFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilter.java index 7f627130c80..3652a2b5d14 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilter.java @@ -19,12 +19,12 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import java.util.Locale; import java.util.regex.Pattern; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.KeywordAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.junit.Test; /** Testcase for {@link KeywordMarkerFilter} */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java index 60add0eecc2..52854280c12 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordMarkerFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.util.StringMockResourceLoader; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.Version; /** Simple tests to ensure the keyword marker filter factory is working. */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordRepeatFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordRepeatFilter.java index b43270c8d74..33576a0c0c5 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordRepeatFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestKeywordRepeatFilter.java @@ -17,9 +17,9 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.snowball.SnowballFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestKeywordRepeatFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilter.java index 932e7335bc4..2121a6f34f1 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.junit.Test; public class TestLengthFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java index 8dbe483523e..d932100315f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLengthFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestLengthFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java index 988f0fa026a..74a948a0093 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java @@ -18,8 +18,6 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -28,7 +26,9 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.TestUtil; public class TestLimitTokenCountAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilter.java index 93f21a4d52b..46b7c654ee9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilter.java @@ -16,9 +16,9 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.junit.Test; public class TestLimitTokenCountFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java index c02005b7edd..ed145d5143c 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestLimitTokenCountFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilter.java index 814637c2051..9bf640b9eea 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilter.java @@ -16,9 +16,9 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.junit.Test; public class TestLimitTokenOffsetFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java index fc76fb9b805..ef19049d67b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenOffsetFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestLimitTokenOffsetFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilter.java index 52ee974a4ac..9349d35ff66 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.synonym.SynonymFilter; import org.apache.lucene.analysis.synonym.SynonymMap; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.CharsRefBuilder; import org.junit.Test; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java index 17cf8b3c1aa..8515b81de9a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenPositionFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestLimitTokenPositionFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestMiscellaneousFactories.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestMiscellaneousFactories.java index 2418e961542..add0aa0bdef 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestMiscellaneousFactories.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestMiscellaneousFactories.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the miscellaneous lucene factories are working. */ public class TestMiscellaneousFactories extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestPerFieldAnalyzerWrapper.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestPerFieldAnalyzerWrapper.java index 2b8cd7dda63..7a49b025f18 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestPerFieldAnalyzerWrapper.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestPerFieldAnalyzerWrapper.java @@ -21,14 +21,14 @@ import java.util.Collections; import java.util.Map; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.AnalyzerWrapper; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockCharFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.core.SimpleAnalyzer; import org.apache.lucene.analysis.core.WhitespaceAnalyzer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockCharFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.IOUtils; public class TestPerFieldAnalyzerWrapper extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestProtectedTermFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestProtectedTermFilter.java index b222d1799f6..05e31d0a255 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestProtectedTermFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestProtectedTermFilter.java @@ -18,12 +18,12 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.core.LowerCaseFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; public class TestProtectedTermFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestProtectedTermFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestProtectedTermFilterFactory.java index 150e9d13659..219c823b8ec 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestProtectedTermFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestProtectedTermFilterFactory.java @@ -16,9 +16,9 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the simple truncation filter factory is working. */ public class TestProtectedTermFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilter.java index a2963a245f0..bc149822e1b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilter.java @@ -20,9 +20,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.Iterator; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; @@ -31,8 +28,11 @@ import org.apache.lucene.analysis.synonym.SynonymMap; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.CharsRef; -import org.apache.lucene.util.TestUtil; public class TestRemoveDuplicatesTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java index f369a884d5d..ca9b1655fba 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilterFactory.java @@ -16,10 +16,10 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; /** Simple tests to ensure this factory is working */ public class TestRemoveDuplicatesTokenFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilter.java index 5a20b8d1680..67ee8dcf03c 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilter.java @@ -17,11 +17,11 @@ package org.apache.lucene.analysis.miscellaneous; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestScandinavianFoldingFilter extends BaseTokenStreamTestCase { private Analyzer analyzer; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java index 596b49391de..72df59f00aa 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianFoldingFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; public class TestScandinavianFoldingFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilter.java index d26f7a02c8f..0b5ca7857cd 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilter.java @@ -18,6 +18,8 @@ package org.apache.lucene.analysis.miscellaneous; import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestScandinavianNormalizationFilter extends BaseTokenStreamTestCase { public void testDefault() throws Exception { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java index 2966fd47846..3fe52b3b067 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizationFilterFactory.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; public class TestScandinavianNormalizationFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizer.java index 2bea5346318..2014b206050 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestScandinavianNormalizer.java @@ -22,6 +22,8 @@ import java.util.Set; import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.miscellaneous.ScandinavianNormalizer.Foldings; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests low level the normalizer functionality */ public class TestScandinavianNormalizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java index c07d2c8e991..e2dec98cbf4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java @@ -25,7 +25,6 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharacterUtils; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -33,7 +32,8 @@ import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.core.WhitespaceTokenizer; import org.apache.lucene.analysis.en.PorterStemFilter; import org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter.StemmerOverrideMap; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; /** */ public class TestStemmerOverrideFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java index bc4e9c50059..9e366bc4930 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.util.StringMockResourceLoader; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.Version; /** Simple tests to ensure the stemmer override filter factory is working. */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilter.java index cfc9e398458..5b315cf3ce9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilter.java @@ -18,13 +18,13 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; /** */ public class TestTrimFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java index 980b01e3b06..d1e4e513422 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure this factory is working */ public class TestTrimFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilter.java index df3f0454069..0ce3932bd91 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilter.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.junit.Test; /** Test the truncate token filter. */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java index 14da3b53d01..2fed6c2ae21 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.miscellaneous; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the simple truncation filter factory is working. */ public class TestTruncateTokenFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTypeAsSynonymFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTypeAsSynonymFilter.java index ead884dfa46..66ef9052ce9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTypeAsSynonymFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTypeAsSynonymFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.miscellaneous; import java.util.Collections; import java.util.Set; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; /** * Test that this filter moves the value in type to a synonym token with the same offsets. This is diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTypeAsSynonymFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTypeAsSynonymFilterFactory.java index 4175b181b76..192197231d1 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTypeAsSynonymFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTypeAsSynonymFilterFactory.java @@ -17,10 +17,10 @@ package org.apache.lucene.analysis.miscellaneous; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; public class TestTypeAsSynonymFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestWordDelimiterFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestWordDelimiterFilter.java index 9f8ab64dddc..9eccfd53f9f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestWordDelimiterFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestWordDelimiterFilter.java @@ -21,12 +21,8 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -34,6 +30,10 @@ import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; import org.apache.lucene.util.IOUtils; /** diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestWordDelimiterGraphFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestWordDelimiterGraphFilter.java index f0fe89c57ca..d9258396e7a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestWordDelimiterGraphFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestWordDelimiterGraphFilter.java @@ -36,12 +36,8 @@ import java.util.List; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -49,8 +45,12 @@ import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; /** * New WordDelimiterGraphFilter tests... most of the tests are in ConvertedLegacyTest TODO: should diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ne/TestNepaliAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ne/TestNepaliAnalyzer.java index e81dea97930..32f0275b555 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ne/TestNepaliAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ne/TestNepaliAnalyzer.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.ne; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Tests the NepaliAnalyzer */ public class TestNepaliAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestEdgeNGramTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestEdgeNGramTokenFilter.java index 808c4737630..aea268e6def 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestEdgeNGramTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestEdgeNGramTokenFilter.java @@ -20,8 +20,6 @@ import java.io.IOException; import java.io.StringReader; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -32,7 +30,9 @@ import org.apache.lucene.analysis.shingle.ShingleFilter; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; /** Tests {@link EdgeNGramTokenFilter} for correctness. */ public class TestEdgeNGramTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestEdgeNGramTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestEdgeNGramTokenizer.java index 78846c381b0..434a552eaf7 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestEdgeNGramTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestEdgeNGramTokenizer.java @@ -21,9 +21,9 @@ import java.io.IOException; import java.io.StringReader; import java.util.Arrays; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests {@link EdgeNGramTokenizer} for correctness. */ public class TestEdgeNGramTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java index a2bd8821eae..14c168c1837 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramFilters.java @@ -18,11 +18,11 @@ package org.apache.lucene.analysis.ngram; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.payloads.PayloadHelper; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.BytesRef; /** Simple tests to ensure the NGram filter factories are working. */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramTokenFilter.java index f5f6967bb7b..207a6f43514 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramTokenFilter.java @@ -20,8 +20,6 @@ import java.io.IOException; import java.io.StringReader; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -31,7 +29,9 @@ import org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; /** Tests {@link NGramTokenFilter} for correctness. */ public class TestNGramTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramTokenizer.java index 5908cdf0f10..23240c5ca95 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ngram/TestNGramTokenizer.java @@ -21,14 +21,14 @@ import java.io.IOException; import java.io.StringReader; import java.util.Arrays; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.TestUtil; /** Tests {@link NGramTokenizer} for correctness. */ public class TestNGramTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchAnalyzer.java index 1fcd2132195..3c5db968fc4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchAnalyzer.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.nl; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArrayMap; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** * Test the Dutch Stem Filter, which only modifies the term text. diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianAnalyzer.java index 08baac94452..5aedfc78646 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.no; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestNorwegianAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilter.java index 3f65de24363..a15121abbb7 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilter.java @@ -16,21 +16,21 @@ */ package org.apache.lucene.analysis.no; -import static org.apache.lucene.analysis.VocabularyAssert.*; import static org.apache.lucene.analysis.no.NorwegianLightStemmer.BOKMAAL; import static org.apache.lucene.analysis.no.NorwegianLightStemmer.NYNORSK; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import java.nio.file.Files; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link NorwegianLightStemFilter} */ public class TestNorwegianLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java index a2f1eb15022..41ea448dbda 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianLightStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.no; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Norwegian Light stem factory is working. */ public class TestNorwegianLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilter.java index c43451a304d..c572a2ef2cd 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilter.java @@ -16,21 +16,21 @@ */ package org.apache.lucene.analysis.no; -import static org.apache.lucene.analysis.VocabularyAssert.*; import static org.apache.lucene.analysis.no.NorwegianLightStemmer.BOKMAAL; import static org.apache.lucene.analysis.no.NorwegianLightStemmer.NYNORSK; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import java.nio.file.Files; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link NorwegianMinimalStemFilter} */ public class TestNorwegianMinimalStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java index eace942e89e..6e7f28214f6 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianMinimalStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.no; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Norwegian Minimal stem factory is working. */ public class TestNorwegianMinimalStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianNormalizationFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianNormalizationFilter.java index c897fcb57a6..0662de2a6db 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianNormalizationFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianNormalizationFilter.java @@ -19,6 +19,8 @@ package org.apache.lucene.analysis.no; import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.ScandinavianNormalizationFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestNorwegianNormalizationFilter extends BaseTokenStreamTestCase { public void testDefault() throws Exception { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianNormalizationFilterFactory.java index 88ed19af6e0..04f6a3629d5 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianNormalizationFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/no/TestNorwegianNormalizationFilterFactory.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.analysis.no; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; public class TestNorwegianNormalizationFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/path/TestPathHierarchyTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/path/TestPathHierarchyTokenizer.java index e78d7be361b..238319be73e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/path/TestPathHierarchyTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/path/TestPathHierarchyTokenizer.java @@ -23,10 +23,10 @@ import java.io.Reader; import java.io.StringReader; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.charfilter.MappingCharFilter; import org.apache.lucene.analysis.charfilter.NormalizeCharMap; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestPathHierarchyTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/path/TestReversePathHierarchyTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/path/TestReversePathHierarchyTokenizer.java index df9adcd6000..683faf72f9c 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/path/TestReversePathHierarchyTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/path/TestReversePathHierarchyTokenizer.java @@ -22,8 +22,8 @@ import static org.apache.lucene.analysis.path.ReversePathHierarchyTokenizer.DEFA import java.io.StringReader; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestReversePathHierarchyTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternCaptureGroupTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternCaptureGroupTokenFilter.java index ad7339d9515..35cac143a87 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternCaptureGroupTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternCaptureGroupTokenFilter.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.pattern; import java.io.StringReader; import java.util.regex.Pattern; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestPatternCaptureGroupTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilter.java index 8c9a054308a..119859bc775 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilter.java @@ -23,12 +23,12 @@ import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Ignore; /** Tests {@link PatternReplaceCharFilter} */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java index e6d08ecde72..14263bc4c17 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceCharFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.pattern; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure this factory is working */ public class TestPatternReplaceCharFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilter.java index 8665517bdfc..c45b1388900 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.pattern; import java.io.IOException; import java.util.regex.Pattern; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestPatternReplaceFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java index 90efdbdd1c4..a63cc3ca2c8 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternReplaceFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.pattern; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure this factory is working */ public class TestPatternReplaceFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizer.java index 5f11f44916f..620cdd860c1 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizer.java @@ -22,13 +22,13 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.charfilter.MappingCharFilter; import org.apache.lucene.analysis.charfilter.NormalizeCharMap; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestPatternTokenizer extends BaseTokenStreamTestCase { public void testSplitting() throws Exception { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java index e870100bce4..9302bdcdd6c 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizerFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.pattern; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple Tests to ensure this factory is working */ public class TestPatternTokenizerFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTypingFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTypingFilter.java index 2611ff22e01..54835a4c3d1 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTypingFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTypingFilter.java @@ -18,11 +18,11 @@ package org.apache.lucene.analysis.pattern; import java.io.IOException; import java.util.regex.Pattern; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.pattern.PatternTypingFilter.PatternTypingRule; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; /** Test that this filter sets a type for tokens matching patterns defined in a patterns.txt file */ public class TestPatternTypingFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTypingFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTypingFilterFactory.java index dce0b59e6c8..37006580507 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTypingFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTypingFilterFactory.java @@ -17,12 +17,12 @@ package org.apache.lucene.analysis.pattern; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.util.StringMockResourceLoader; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; import org.apache.lucene.util.Version; /** This test just ensures the factory works */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestSimplePatternSplitTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestSimplePatternSplitTokenizer.java index 82fc2ece185..3de03f4853a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestSimplePatternSplitTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestSimplePatternSplitTokenizer.java @@ -21,7 +21,6 @@ import java.io.StringReader; import java.util.ArrayList; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -29,7 +28,8 @@ import org.apache.lucene.analysis.charfilter.MappingCharFilter; import org.apache.lucene.analysis.charfilter.NormalizeCharMap; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.automaton.Automaton; public class TestSimplePatternSplitTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestSimplePatternTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestSimplePatternTokenizer.java index e4ac20baf49..e66ae7a049d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestSimplePatternTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestSimplePatternTokenizer.java @@ -21,7 +21,6 @@ import java.io.StringReader; import java.util.ArrayList; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -29,7 +28,8 @@ import org.apache.lucene.analysis.charfilter.MappingCharFilter; import org.apache.lucene.analysis.charfilter.NormalizeCharMap; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.automaton.Automaton; public class TestSimplePatternTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilter.java index 6ac7219b4b1..2f804f2ea6e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilter.java @@ -17,10 +17,10 @@ package org.apache.lucene.analysis.payloads; import java.nio.charset.StandardCharsets; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.BytesRef; public class TestDelimitedPayloadTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java index b81a4c9858f..a812d9837eb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestDelimitedPayloadTokenFilterFactory.java @@ -18,11 +18,11 @@ package org.apache.lucene.analysis.payloads; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestDelimitedPayloadTokenFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestNumericPayloadTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestNumericPayloadTokenFilter.java index 98f2f40bc5d..237bf6605c6 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestNumericPayloadTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestNumericPayloadTokenFilter.java @@ -18,13 +18,13 @@ package org.apache.lucene.analysis.payloads; import java.io.IOException; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestNumericPayloadTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestTokenOffsetPayloadTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestTokenOffsetPayloadTokenFilter.java index eaef32b2fd2..3ff23cc0d7d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestTokenOffsetPayloadTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestTokenOffsetPayloadTokenFilter.java @@ -17,9 +17,9 @@ package org.apache.lucene.analysis.payloads; import java.io.IOException; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.BytesRef; public class TestTokenOffsetPayloadTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestTypeAsPayloadTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestTypeAsPayloadTokenFilter.java index 2a07c0e3f4c..e3ded643c27 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestTypeAsPayloadTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/payloads/TestTypeAsPayloadTokenFilter.java @@ -17,12 +17,12 @@ package org.apache.lucene.analysis.payloads; import java.io.IOException; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestTypeAsPayloadTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseAnalyzer.java index e8a1d59720e..1655761668d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.pt; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestPortugueseAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilter.java index 56ed6b681a5..1f6034b3147 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.pt; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link PortugueseLightStemFilter} */ public class TestPortugueseLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java index 4ee09ea4541..5aff1b114c8 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseLightStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.pt; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Portuguese Light stem factory is working. */ public class TestPortugueseLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilter.java index 370f07eda49..81a1497da35 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.pt; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link PortugueseMinimalStemFilter} */ public class TestPortugueseMinimalStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java index f028c83a26a..b28bd34edeb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseMinimalStemFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.pt; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Portuguese Minimal stem factory is working. */ public class TestPortugueseMinimalStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilter.java index fd1d2385811..662e63f18fb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.pt; -import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary; +import static org.apache.lucene.tests.analysis.VocabularyAssert.assertVocabulary; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link PortugueseStemFilter} */ public class TestPortugueseStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java index 2352bcf3660..a4e8dbbed48 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.pt; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Portuguese stem factory is working. */ public class TestPortugueseStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/query/TestQueryAutoStopWordAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/query/TestQueryAutoStopWordAnalyzer.java index 3a41880f4e2..09e2b363530 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/query/TestQueryAutoStopWordAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/query/TestQueryAutoStopWordAnalyzer.java @@ -28,6 +28,9 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestQueryAutoStopWordAnalyzer extends BaseTokenStreamTestCase { String[] variedFieldValues = { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilter.java index 3db436ba905..c48dedcf6d9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.reverse; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestReverseStringFilter extends BaseTokenStreamTestCase { public void testFilter() throws Exception { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java index d9fdb9f3b88..044e692a198 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/reverse/TestReverseStringFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.reverse; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Reverse string filter factory is working. */ public class TestReverseStringFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ro/TestRomanianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ro/TestRomanianAnalyzer.java index 726f8920ac0..d41b76ba741 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ro/TestRomanianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ro/TestRomanianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ro; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestRomanianAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java index 105797e4b2d..145fa23672a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ru; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test case for RussianAnalyzer. */ public class TestRussianAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilter.java index f5a6cbd7156..af98205ba3b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.ru; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link RussianLightStemFilter} */ public class TestRussianLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java index 1fec812a3b8..53b1a1f6df4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ru/TestRussianLightStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.ru; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Russian light stem factory is working. */ public class TestRussianLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestFixedShingleFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestFixedShingleFilter.java index db085f268a3..9c849e254cd 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestFixedShingleFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestFixedShingleFilter.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.shingle; import java.io.IOException; import java.util.Iterator; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; import org.apache.lucene.util.graph.GraphTokenStreamFiniteStrings; public class TestFixedShingleFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleAnalyzerWrapper.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleAnalyzerWrapper.java index 269d48dc749..ad76023576e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleAnalyzerWrapper.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleAnalyzerWrapper.java @@ -17,10 +17,7 @@ package org.apache.lucene.analysis.shingle; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; @@ -42,6 +39,9 @@ import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; /** A test class for ShingleAnalyzerWrapper as regards queries and scoring. */ public class TestShingleAnalyzerWrapper extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilter.java index 5f3a44c1858..34076678f5f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilter.java @@ -20,15 +20,15 @@ import java.io.IOException; import java.io.StringReader; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.core.WhitespaceTokenizer; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; public class TestShingleFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java index beb23199a6c..b0bf2eb6e38 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/TestShingleFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.shingle; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Shingle filter factory works. */ public class TestShingleFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sinks/TestTeeSinkTokenFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sinks/TestTeeSinkTokenFilter.java index 9ed0350457d..74863fd1264 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sinks/TestTeeSinkTokenFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sinks/TestTeeSinkTokenFilter.java @@ -20,12 +20,9 @@ import java.io.IOException; import java.io.StringReader; import java.util.Locale; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CachingTokenFilter; import org.apache.lucene.analysis.FilteringTokenFilter; import org.apache.lucene.analysis.LowerCaseFilter; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.standard.StandardTokenizer; @@ -43,7 +40,10 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.English; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.English; /** tests for the TestTeeSinkTokenFilter */ public class TestTeeSinkTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java index a30274a85dc..dfbdfe1f5bc 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java @@ -22,8 +22,6 @@ import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.WordlistLoader; @@ -34,6 +32,8 @@ import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.BytesRef; public class TestSnowball extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java index f1f5b1f7141..b55542a83d4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballPorterFilterFactory.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.snowball; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.util.StringMockResourceLoader; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.Version; import org.tartarus.snowball.ext.EnglishStemmer; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java index 17204aa40ec..9f0ea35d051 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.analysis.snowball; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import java.io.InputStream; @@ -25,7 +25,7 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.WordlistLoader; import org.apache.lucene.analysis.core.KeywordTokenizer; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Test the snowball filters against the snowball data tests */ public class TestSnowballVocab extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianAnalyzer.java index 1e29c6fd3ee..0898083a5d6 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.sr; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test the SerbianAnalyzer */ public class TestSerbianAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilter.java index 1ec88933295..4f9d74d7111 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilter.java @@ -18,11 +18,11 @@ package org.apache.lucene.analysis.sr; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests {@link SerbianNormalizationFilter} */ public class TestSerbianNormalizationFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java index 971a83c2369..106ed24d127 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.sr; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Serbian normalization factory is working. */ public class TestSerbianNormalizationFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationRegularFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationRegularFilter.java index a1d9d464f36..8d4deee1c52 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationRegularFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sr/TestSerbianNormalizationRegularFilter.java @@ -18,11 +18,11 @@ package org.apache.lucene.analysis.sr; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests {@link SerbianNormalizationFilter} */ public class TestSerbianNormalizationRegularFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishAnalyzer.java index d56d6cfeb82..ce14ea42357 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.sv; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestSwedishAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilter.java index 6565a535510..2aece6bd12d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilter.java @@ -16,17 +16,17 @@ */ package org.apache.lucene.analysis.sv; -import static org.apache.lucene.analysis.VocabularyAssert.*; +import static org.apache.lucene.tests.analysis.VocabularyAssert.*; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link SwedishLightStemFilter} */ public class TestSwedishLightStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java index a37ab4eed47..02b8d918912 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishLightStemFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.sv; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Swedish Light stem factory is working. */ public class TestSwedishLightStemFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishMinimalStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishMinimalStemFilter.java index ca337fee37a..701f0c8ccdb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishMinimalStemFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/sv/TestSwedishMinimalStemFilter.java @@ -16,13 +16,15 @@ */ package org.apache.lucene.analysis.sv; -import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary; +import static org.apache.lucene.tests.analysis.VocabularyAssert.assertVocabulary; import java.io.IOException; import java.nio.file.Files; import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link SwedishMinimalStemFilter} */ public class TestSwedishMinimalStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/BaseSynonymParserTestCase.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/BaseSynonymParserTestCase.java index 4a3fd721be2..9cbd49df26d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/BaseSynonymParserTestCase.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/BaseSynonymParserTestCase.java @@ -21,8 +21,8 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.store.ByteArrayDataInput; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.IntsRefBuilder; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestMultiWordSynonyms.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestMultiWordSynonyms.java index c71e94e73f6..7cd538c750b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestMultiWordSynonyms.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestMultiWordSynonyms.java @@ -18,9 +18,9 @@ package org.apache.lucene.analysis.synonym; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.util.StringMockResourceLoader; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.Version; /** @since solr 1.4 */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java index 4fd10221b84..4a983ab48bb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSolrSynonymParser.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.synonym; import java.io.StringReader; import java.text.ParseException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.en.EnglishAnalyzer; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; /** * Tests parser for the Solr synonyms format diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java index f2cfdd23c6f..8df8e4bfeb4 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilterFactory.java @@ -18,12 +18,12 @@ package org.apache.lucene.analysis.synonym; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.cjk.CJKAnalyzer; import org.apache.lucene.analysis.pattern.PatternTokenizerFactory; import org.apache.lucene.analysis.util.StringMockResourceLoader; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.util.Version; @Deprecated diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymGraphFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymGraphFilter.java index 3bfe306156b..fca26b50910 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymGraphFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymGraphFilter.java @@ -26,10 +26,6 @@ import java.util.List; import java.util.Locale; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockGraphTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.FlattenGraphFilter; @@ -37,20 +33,24 @@ import org.apache.lucene.analysis.tokenattributes.*; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.store.ByteArrayDataInput; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockGraphTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.CharsRefBuilder; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.TooComplexToDeterminizeException; import org.apache.lucene.util.automaton.Transition; diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java index 83e7f51f538..0415fae77b5 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymMapFilter.java @@ -27,16 +27,16 @@ import java.util.Map; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockGraphTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.tokenattributes.*; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockGraphTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.CharsRefBuilder; -import org.apache.lucene.util.TestUtil; @Deprecated public class TestSynonymMapFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestWordnetSynonymParser.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestWordnetSynonymParser.java index 5d26829cfa5..c9da33ba2cf 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestWordnetSynonymParser.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestWordnetSynonymParser.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.synonym; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestWordnetSynonymParser extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ta/TestTamilAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ta/TestTamilAnalyzer.java index 44d77120807..f97b5f7d94b 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/ta/TestTamilAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/ta/TestTamilAnalyzer.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.ta; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Tests the TamilAnalyzer */ public class TestTamilAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguAnalyzer.java index 1eb47efdfbd..5c3145a5677 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguAnalyzer.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.te; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestTeluguAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguFilters.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguFilters.java index bf08a41a05a..d0b6087b722 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguFilters.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguFilters.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.te; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Telugu filter Factories are working. */ public class TestTeluguFilters extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguNormalizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguNormalizer.java index 0571b6f1282..1a9aa10b613 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguNormalizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguNormalizer.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.te; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test TeluguNormalizer */ public class TestTeluguNormalizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguStemmer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguStemmer.java index bd1b271764f..cd1dc10fc89 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguStemmer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/te/TestTeluguStemmer.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.te; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test TeluguStemmer */ public class TestTeluguStemmer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java index 6cb3d2134e9..ff4591a1079 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java @@ -17,11 +17,11 @@ package org.apache.lucene.analysis.th; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.analysis.tokenattributes.FlagsAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test case for ThaiAnalyzer, modified from TestFrenchAnalyzer */ public class TestThaiAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java index 21da9f76350..e77a749564f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiTokenizerFactory.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.th; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the Thai word filter factory is working. */ public class TestThaiTokenizerFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilter.java index 900a7adf387..43127090a74 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilter.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.analysis.tr; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestApostropheFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java index 4eb6af1bc1b..095616312b2 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestApostropheFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.tr; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the apostrophe filter factory is working. */ public class TestApostropheFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishAnalyzer.java index 1d3744eed20..59dffc2e7b8 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.tr; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestTurkishAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilter.java index 6bf290b8a7d..6285925236d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilter.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.tr; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test the Turkish lowercase filter. */ public class TestTurkishLowerCaseFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java index 8ecb1b8535b..37929639f7c 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/tr/TestTurkishLowerCaseFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.tr; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the Turkish lowercase filter factory is working. */ public class TestTurkishLowerCaseFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java index e448a8cf26f..13a02f0369e 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharArrayIterator.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.util; import java.text.BreakIterator; import java.text.CharacterIterator; import java.util.Locale; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestCharArrayIterator extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharTokenizers.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharTokenizers.java index 82494ca9d60..48afa0dee98 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharTokenizers.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestCharTokenizers.java @@ -19,12 +19,12 @@ package org.apache.lucene.analysis.util; import java.io.IOException; import java.io.StringReader; import java.util.Locale; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.LowerCaseFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.core.LetterTokenizer; import org.apache.lucene.analysis.core.WhitespaceTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Testcase for {@link CharTokenizer} subclasses */ public class TestCharTokenizers extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElision.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElision.java index 5d707734bdd..c16e0f7b30f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElision.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElision.java @@ -21,7 +21,6 @@ import java.io.StringReader; import java.util.ArrayList; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; @@ -29,6 +28,7 @@ import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.fr.FrenchAnalyzer; import org.apache.lucene.analysis.standard.StandardTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** */ public class TestElision extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java index 60cec0e6e5c..942a5fd177f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestElisionFilterFactory.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.util; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests to ensure the French elision filter factory is working. */ public class TestElisionFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java index 861b6365e15..b82bde51b8a 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java @@ -25,8 +25,8 @@ import java.nio.file.Path; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.WordlistLoader; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.ResourceLoader; public class TestFilesystemResourceLoader extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestRollingCharBuffer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestRollingCharBuffer.java index 8c3f6520474..9a9e74c8764 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestRollingCharBuffer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestRollingCharBuffer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.util; import java.io.StringReader; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestRollingCharBuffer extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestSegmentingTokenizerBase.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestSegmentingTokenizerBase.java index ffe8863139b..20af3bd0e08 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestSegmentingTokenizerBase.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestSegmentingTokenizerBase.java @@ -21,10 +21,10 @@ import java.text.BreakIterator; import java.util.Arrays; import java.util.Locale; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.IOUtils; /** Basic tests for {@link SegmentingTokenizerBase} */ diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizer.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizer.java index 98055cd6c66..639d4086fd6 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizer.java @@ -26,9 +26,9 @@ import java.util.HashSet; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.FlagsAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Basic Tests for {@link WikipediaTokenizer} */ public class TestWikipediaTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java index ae2491f68e4..d6c2a5330c9 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/wikipedia/TestWikipediaTokenizerFactory.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.wikipedia; import java.io.StringReader; import java.util.HashSet; import java.util.Set; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the wikipedia tokenizer is working. */ public class TestWikipediaTokenizerFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java b/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java index 69ab63c2002..3536224c50f 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java @@ -23,7 +23,6 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; @@ -31,9 +30,10 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** trivial test of CollationDocValuesField */ public class TestCollationDocValuesField extends LuceneTestCase { diff --git a/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationKeyAnalyzer.java b/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationKeyAnalyzer.java index efc3c2df256..7ecfb7b58b3 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationKeyAnalyzer.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationKeyAnalyzer.java @@ -19,7 +19,7 @@ package org.apache.lucene.collation; import java.text.Collator; import java.util.Locale; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CollationTestBase; +import org.apache.lucene.tests.analysis.CollationTestBase; import org.apache.lucene.util.BytesRef; public class TestCollationKeyAnalyzer extends CollationTestBase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUCollationDocValuesField.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUCollationDocValuesField.java index dd6fb5ab786..e441c9662e1 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUCollationDocValuesField.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUCollationDocValuesField.java @@ -23,7 +23,6 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; @@ -31,9 +30,10 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** trivial test of ICUCollationDocValuesField */ public class TestICUCollationDocValuesField extends LuceneTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUCollationKeyAnalyzer.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUCollationKeyAnalyzer.java index 877d34aa452..e9141c242b8 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUCollationKeyAnalyzer.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUCollationKeyAnalyzer.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis.icu; import com.ibm.icu.text.Collator; import java.util.Locale; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CollationTestBase; +import org.apache.lucene.tests.analysis.CollationTestBase; import org.apache.lucene.util.BytesRef; public class TestICUCollationKeyAnalyzer extends CollationTestBase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilter.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilter.java index 67d065c2a0e..30a402d95bb 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilter.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilter.java @@ -18,10 +18,10 @@ package org.apache.lucene.analysis.icu; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests ICUFoldingFilter */ public class TestICUFoldingFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java index bf19a4d745d..d57235293a1 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUFoldingFilterFactory.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.icu; import java.io.Reader; import java.io.StringReader; import java.util.HashMap; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** basic tests for {@link ICUFoldingFilterFactory} */ public class TestICUFoldingFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilter.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilter.java index 9026701b70e..42891c2a59a 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilter.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilter.java @@ -22,13 +22,13 @@ import java.io.Reader; import java.io.StringReader; import java.util.Arrays; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.ngram.NGramTokenizer; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; public class TestICUNormalizer2CharFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java index 217a6c9149f..5842809d511 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2CharFilterFactory.java @@ -20,8 +20,8 @@ import java.io.Reader; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** basic tests for {@link ICUNormalizer2CharFilterFactory} */ public class TestICUNormalizer2CharFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2Filter.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2Filter.java index e26db30ba22..feed9d2640c 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2Filter.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2Filter.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.icu; import com.ibm.icu.text.Normalizer2; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests the ICUNormalizer2Filter */ public class TestICUNormalizer2Filter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java index ea80a5bc193..821d92d3556 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUNormalizer2FilterFactory.java @@ -20,8 +20,8 @@ import java.io.Reader; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** basic tests for {@link ICUNormalizer2FilterFactory} */ public class TestICUNormalizer2FilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilter.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilter.java index 61f51b113d4..e3320367c4b 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilter.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilter.java @@ -21,11 +21,11 @@ import com.ibm.icu.text.UnicodeSet; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Test the ICUTransformFilter with some basic examples. */ public class TestICUTransformFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java index 982c9717734..11d0b59d6a9 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/TestICUTransformFilterFactory.java @@ -20,8 +20,8 @@ import java.io.Reader; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** basic tests for {@link ICUTransformFilterFactory} */ public class TestICUTransformFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java index 4a0057f20f2..9d9c20f19c2 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestCharArrayIterator.java @@ -17,7 +17,7 @@ package org.apache.lucene.analysis.icu.segmentation; import java.text.CharacterIterator; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCharArrayIterator extends LuceneTestCase { public void testBasicUsage() { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java index bd9403a0b10..822d1743833 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java @@ -24,10 +24,10 @@ import java.util.Arrays; import java.util.Random; import java.util.concurrent.CountDownLatch; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.icu.tokenattributes.ScriptAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestICUTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerCJK.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerCJK.java index 6d989b3a569..7b7d57b1baf 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerCJK.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerCJK.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.icu.segmentation; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.util.LuceneTestCase.AwaitsFix; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix; /** test ICUTokenizer with dictionary-based CJ segmentation */ @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/LUCENE-8222") diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java index 4ea9542b676..d1511c0b006 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizerFactory.java @@ -20,8 +20,8 @@ import java.io.Reader; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; /** basic tests for {@link ICUTokenizerFactory} * */ diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestMyanmarSyllable.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestMyanmarSyllable.java index 33bfa017681..a8cb0b77328 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestMyanmarSyllable.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestMyanmarSyllable.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.icu.segmentation; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test tokenizing Myanmar text into syllables */ public class TestMyanmarSyllable extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestWithCJKBigramFilter.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestWithCJKBigramFilter.java index 7e053ae1b78..8fe60a45fea 100644 --- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestWithCJKBigramFilter.java +++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestWithCJKBigramFilter.java @@ -18,13 +18,13 @@ package org.apache.lucene.analysis.icu.segmentation; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.cjk.CJKBigramFilter; import org.apache.lucene.analysis.icu.ICUNormalizer2Filter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.IOUtils; /** diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestCSVUtil.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestCSVUtil.java index 380b387d780..072a93726d8 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestCSVUtil.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestCSVUtil.java @@ -18,7 +18,7 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import org.apache.lucene.analysis.ja.util.CSVUtil; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /* * Tests for the CSVUtil class. diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestExtendedMode.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestExtendedMode.java index 37db3346ef1..605cdcfdd78 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestExtendedMode.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestExtendedMode.java @@ -19,12 +19,12 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.ja.JapaneseTokenizer.Mode; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; public class TestExtendedMode extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java index 1924b6aa403..ee6232fa411 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestFactories.java @@ -27,16 +27,16 @@ import java.util.Map; import java.util.Set; import org.apache.lucene.analysis.AbstractAnalysisFactory; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilterFactory; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilterFactory; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.TokenizerFactory; import org.apache.lucene.analysis.boost.DelimitedBoostTokenFilterFactory; import org.apache.lucene.analysis.miscellaneous.DelimitedTermFrequencyTokenFilterFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.lucene.util.AttributeFactory; -import org.apache.lucene.util.LuceneTestCase.Nightly; import org.apache.lucene.util.ResourceLoaderAware; import org.apache.lucene.util.Version; diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseAnalyzer.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseAnalyzer.java index e5536fceed3..58074336d6a 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseAnalyzer.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseAnalyzer.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.ja.JapaneseTokenizer.Mode; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test Kuromoji Japanese morphological analyzer */ public class TestJapaneseAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilter.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilter.java index 99b2c855c0c..5da671ace3b 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilter.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilter.java @@ -18,12 +18,12 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestJapaneseBaseFormFilter extends BaseTokenStreamTestCase { private Analyzer analyzer; diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java index d58943bb919..470ce0c8f2d 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseBaseFormFilterFactory.java @@ -19,9 +19,9 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import java.io.StringReader; import java.util.HashMap; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link JapaneseBaseFormFilterFactory} */ public class TestJapaneseBaseFormFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionAnalyzer.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionAnalyzer.java index bae627af921..8077ed02550 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionAnalyzer.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionAnalyzer.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.junit.Test; public class TestJapaneseCompletionAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionFilter.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionFilter.java index 302ae3e5a49..20f55f7e89b 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionFilter.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionFilter.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import java.io.Reader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.cjk.CJKWidthCharFilter; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.IOUtils; import org.junit.Test; diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionFilterFactory.java index 6295dbfbfc1..5f30d8f90cb 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionFilterFactory.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseCompletionFilterFactory.java @@ -20,10 +20,10 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.cjk.CJKWidthFilterFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; import org.junit.Test; public class TestJapaneseCompletionFilterFactory extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilter.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilter.java index e8e76ff65e2..a07e561fd15 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilter.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilter.java @@ -20,10 +20,10 @@ import java.io.IOException; import java.io.Reader; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; import org.apache.lucene.util.IOUtils; // See: https://issues.apache.org/jira/browse/SOLR-12028 Tests cannot remove files on Windows diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java index ab3e93a554e..6ac6dcc6981 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseIterationMarkCharFilterFactory.java @@ -21,10 +21,10 @@ import java.io.Reader; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Simple tests for {@link JapaneseIterationMarkCharFilterFactory} */ public class TestJapaneseIterationMarkCharFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilter.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilter.java index 15c526f0df3..d082f3b5e81 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilter.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilter.java @@ -18,13 +18,13 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests for {@link JapaneseKatakanaStemFilter} */ public class TestJapaneseKatakanaStemFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java index a24aa74f30c..53d8e9c8d1b 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseKatakanaStemFilterFactory.java @@ -19,9 +19,9 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import java.io.StringReader; import java.util.HashMap; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link JapaneseKatakanaStemFilterFactory} */ public class TestJapaneseKatakanaStemFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilter.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilter.java index 0b6459c8eba..ced49e2fe74 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilter.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilter.java @@ -24,12 +24,12 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.junit.Ignore; import org.junit.Test; diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java index a215097b3c3..5b260d87e0d 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseNumberFilterFactory.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link org.apache.lucene.analysis.ja.JapaneseNumberFilterFactory} */ public class TestJapaneseNumberFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java index be1dc1ea3d9..c3d403811db 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapanesePartOfSpeechStopFilterFactory.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; import org.apache.lucene.util.Version; diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilter.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilter.java index 3bcab4412af..70996b53eee 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilter.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.cjk.CJKWidthFilter; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.IOUtils; /** Tests for {@link TestJapaneseReadingFormFilter} */ diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java index eb6dea58086..e5ed23c904f 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseReadingFormFilterFactory.java @@ -19,9 +19,9 @@ package org.apache.lucene.analysis.ja; import java.io.IOException; import java.io.StringReader; import java.util.HashMap; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link JapaneseReadingFormFilterFactory} */ public class TestJapaneseReadingFormFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizer.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizer.java index efc64dc0254..e3f11edbaba 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizer.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizer.java @@ -27,8 +27,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockGraphTokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.ja.JapaneseTokenizer.Mode; @@ -39,8 +37,10 @@ import org.apache.lucene.analysis.ja.dict.UnknownDictionary; import org.apache.lucene.analysis.ja.dict.UserDictionary; import org.apache.lucene.analysis.ja.tokenattributes.*; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockGraphTokenFilter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; public class TestJapaneseTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java index 8a2a9389145..3c11270f5fc 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestJapaneseTokenizerFactory.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link JapaneseTokenizerFactory} */ public class TestJapaneseTokenizerFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestSearchMode.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestSearchMode.java index 6f3c3aa81fe..afe7dca1c76 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestSearchMode.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/TestSearchMode.java @@ -25,9 +25,9 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.ja.JapaneseTokenizer.Mode; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestSearchMode extends BaseTokenStreamTestCase { private static final String SEGMENTATION_FILENAME = "search-segmentation-tests.txt"; diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/completion/TestKatakanaRomanizer.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/completion/TestKatakanaRomanizer.java index d1f739e12b6..d6611209a74 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/completion/TestKatakanaRomanizer.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/completion/TestKatakanaRomanizer.java @@ -17,8 +17,8 @@ package org.apache.lucene.analysis.ja.completion; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.CharsRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; public class TestKatakanaRomanizer extends LuceneTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/dict/TestTokenInfoDictionary.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/dict/TestTokenInfoDictionary.java index 9555ba02080..53993141894 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/dict/TestTokenInfoDictionary.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/dict/TestTokenInfoDictionary.java @@ -27,9 +27,9 @@ import java.nio.file.Path; import org.apache.lucene.analysis.ja.util.DictionaryBuilder; import org.apache.lucene.analysis.ja.util.DictionaryBuilder.DictionaryFormat; import org.apache.lucene.analysis.ja.util.ToStringUtil; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.UnicodeUtil; import org.apache.lucene.util.fst.FST; import org.apache.lucene.util.fst.IntsRefFSTEnum; diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/dict/TestUserDictionary.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/dict/TestUserDictionary.java index 3cc5ea63c98..b08d75344f0 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/dict/TestUserDictionary.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/dict/TestUserDictionary.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis.ja.dict; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.ja.TestJapaneseTokenizer; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestUserDictionary extends LuceneTestCase { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/util/TestToStringUtil.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/util/TestToStringUtil.java index 22b1a324a5b..cbe0554a971 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/util/TestToStringUtil.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/util/TestToStringUtil.java @@ -18,7 +18,7 @@ package org.apache.lucene.analysis.ja.util; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestToStringUtil extends LuceneTestCase { public void testPOS() { diff --git a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/util/TestUnknownDictionary.java b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/util/TestUnknownDictionary.java index 110cdc253e5..a2e74c710f7 100644 --- a/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/util/TestUnknownDictionary.java +++ b/lucene/analysis/kuromoji/src/test/org/apache/lucene/analysis/ja/util/TestUnknownDictionary.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.analysis.ja.util; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestUnknownDictionary extends LuceneTestCase { diff --git a/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikAnalyzer.java b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikAnalyzer.java index dbb718a517f..6e66771b760 100644 --- a/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikAnalyzer.java +++ b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikAnalyzer.java @@ -19,13 +19,13 @@ package org.apache.lucene.analysis.morfologik; import java.io.IOException; import java.util.TreeSet; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; import org.apache.lucene.analysis.standard.StandardTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** TODO: The tests below rely on the order of returned lemmas, which is probably not good. */ public class TestMorfologikAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java index b3051459197..19ad5a4cae0 100644 --- a/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java +++ b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/morfologik/TestMorfologikFilterFactory.java @@ -22,8 +22,8 @@ import java.io.StringReader; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; import org.apache.lucene.util.ResourceLoader; diff --git a/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/uk/TestUkrainianAnalyzer.java b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/uk/TestUkrainianAnalyzer.java index 880d1eca9b7..e04f62639db 100644 --- a/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/uk/TestUkrainianAnalyzer.java +++ b/lucene/analysis/morfologik/src/test/org/apache/lucene/analysis/uk/TestUkrainianAnalyzer.java @@ -18,7 +18,7 @@ package org.apache.lucene.analysis.uk; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test case for UkrainianAnalyzer. */ public class TestUkrainianAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanAnalyzer.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanAnalyzer.java index 2338c92d876..cb71a7641a4 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanAnalyzer.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanAnalyzer.java @@ -22,7 +22,7 @@ import java.util.HashSet; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Test Korean morphological analyzer */ public class TestKoreanAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java index f10d209a814..7da469db582 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java @@ -28,13 +28,13 @@ import java.nio.file.Paths; import java.util.HashSet; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.ko.dict.UserDictionary; import org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.junit.Ignore; import org.junit.Test; diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilterFactory.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilterFactory.java index 85a759a475f..2a519e8c723 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilterFactory.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilterFactory.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link org.apache.lucene.analysis.ko.KoreanNumberFilterFactory} */ public class TestKoreanNumberFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanPartOfSpeechStopFilterFactory.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanPartOfSpeechStopFilterFactory.java index 2c73f31cc9f..68fd7faa312 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanPartOfSpeechStopFilterFactory.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanPartOfSpeechStopFilterFactory.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.Version; /** Simple tests for {@link KoreanPartOfSpeechStopFilterFactory} */ diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanReadingFormFilter.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanReadingFormFilter.java index 0695e49db8d..27e45cb9ae1 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanReadingFormFilter.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanReadingFormFilter.java @@ -19,9 +19,9 @@ package org.apache.lucene.analysis.ko; import java.io.IOException; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.IOUtils; /** Tests for {@link TestKoreanReadingFormFilter} */ diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanReadingFormFilterFactory.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanReadingFormFilterFactory.java index 88eab97b670..46b910c92a3 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanReadingFormFilterFactory.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanReadingFormFilterFactory.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.ko; import java.io.IOException; import java.io.StringReader; import java.util.HashMap; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link KoreanReadingFormFilterFactory} */ public class TestKoreanReadingFormFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizer.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizer.java index f1e0d3f5227..ec72e8a089b 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizer.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizer.java @@ -23,8 +23,6 @@ import java.io.Reader; import java.nio.charset.StandardCharsets; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockGraphTokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.ko.KoreanTokenizer.DecompoundMode; @@ -35,6 +33,8 @@ import org.apache.lucene.analysis.ko.dict.UnknownDictionary; import org.apache.lucene.analysis.ko.dict.UserDictionary; import org.apache.lucene.analysis.ko.tokenattributes.PartOfSpeechAttribute; import org.apache.lucene.analysis.ko.tokenattributes.ReadingAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockGraphTokenFilter; public class TestKoreanTokenizer extends BaseTokenStreamTestCase { private Analyzer analyzer, diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizerFactory.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizerFactory.java index d8fa2b674a5..93bd20d663e 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizerFactory.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanTokenizerFactory.java @@ -21,8 +21,8 @@ import java.io.StringReader; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link KoreanTokenizerFactory} */ public class TestKoreanTokenizerFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/dict/TestTokenInfoDictionary.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/dict/TestTokenInfoDictionary.java index 10042c9e7e2..406ce6c414e 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/dict/TestTokenInfoDictionary.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/dict/TestTokenInfoDictionary.java @@ -26,9 +26,9 @@ import java.nio.file.Files; import java.nio.file.Path; import org.apache.lucene.analysis.ko.POS; import org.apache.lucene.analysis.ko.util.DictionaryBuilder; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.UnicodeUtil; import org.apache.lucene.util.fst.FST; import org.apache.lucene.util.fst.IntsRefFSTEnum; diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/dict/TestUserDictionary.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/dict/TestUserDictionary.java index 864d8e8e9f9..7f97d0520e8 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/dict/TestUserDictionary.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/dict/TestUserDictionary.java @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.List; import org.apache.lucene.analysis.ko.POS; import org.apache.lucene.analysis.ko.TestKoreanTokenizer; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestUserDictionary extends LuceneTestCase { diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/util/TestUnknownDictionary.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/util/TestUnknownDictionary.java index 10b7deedf2f..c619ad36072 100644 --- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/util/TestUnknownDictionary.java +++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/util/TestUnknownDictionary.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.analysis.ko.util; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestUnknownDictionary extends LuceneTestCase { diff --git a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPChunkerFilterFactory.java b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPChunkerFilterFactory.java index 27e10413149..1132be3ffe6 100644 --- a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPChunkerFilterFactory.java +++ b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPChunkerFilterFactory.java @@ -19,9 +19,9 @@ package org.apache.lucene.analysis.opennlp; import java.nio.charset.StandardCharsets; import java.util.Arrays; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.custom.CustomAnalyzer; import org.apache.lucene.analysis.payloads.TypeAsPayloadTokenFilterFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; /** diff --git a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java index 42c1d93942b..d74bc451d93 100644 --- a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java +++ b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java @@ -17,10 +17,10 @@ package org.apache.lucene.analysis.opennlp; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.custom.CustomAnalyzer; import org.apache.lucene.analysis.miscellaneous.KeywordRepeatFilterFactory; import org.apache.lucene.analysis.miscellaneous.RemoveDuplicatesTokenFilterFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; public class TestOpenNLPLemmatizerFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPPOSFilterFactory.java b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPPOSFilterFactory.java index bf188b0dc53..e9ac0f796d6 100644 --- a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPPOSFilterFactory.java +++ b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPPOSFilterFactory.java @@ -20,9 +20,9 @@ package org.apache.lucene.analysis.opennlp; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Arrays; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.custom.CustomAnalyzer; import org.apache.lucene.analysis.payloads.TypeAsPayloadTokenFilterFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; /** diff --git a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPSentenceBreakIterator.java b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPSentenceBreakIterator.java index 7c778d1e2ea..acd13da0037 100644 --- a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPSentenceBreakIterator.java +++ b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPSentenceBreakIterator.java @@ -23,8 +23,8 @@ import java.text.CharacterIterator; import org.apache.lucene.analysis.opennlp.tools.NLPSentenceDetectorOp; import org.apache.lucene.analysis.opennlp.tools.OpenNLPOpsFactory; import org.apache.lucene.analysis.util.CharArrayIterator; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ClasspathResourceLoader; -import org.apache.lucene.util.LuceneTestCase; import org.junit.BeforeClass; public class TestOpenNLPSentenceBreakIterator extends LuceneTestCase { diff --git a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPTokenizerFactory.java b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPTokenizerFactory.java index 315af01ee0e..b8ea21a3bcd 100644 --- a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPTokenizerFactory.java +++ b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPTokenizerFactory.java @@ -21,9 +21,9 @@ import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.custom.CustomAnalyzer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; import org.junit.Test; diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilter.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilter.java index 8f77840e711..9352a60ccdd 100644 --- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilter.java +++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilter.java @@ -25,13 +25,13 @@ import org.apache.commons.codec.language.bm.NameType; import org.apache.commons.codec.language.bm.PhoneticEngine; import org.apache.commons.codec.language.bm.RuleType; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.PatternKeywordMarkerFilter; import org.apache.lucene.analysis.tokenattributes.KeywordAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests {@link BeiderMorseFilter} */ public class TestBeiderMorseFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java index c4463a490b3..505af486c97 100644 --- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java +++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestBeiderMorseFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.phonetic; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Simple tests for {@link BeiderMorseFilterFactory} */ public class TestBeiderMorseFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilter.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilter.java index e7dd16b77da..b728ef34ee6 100644 --- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilter.java +++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilter.java @@ -19,11 +19,11 @@ package org.apache.lucene.analysis.phonetic; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.core.WhitespaceTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests {@link DaitchMokotoffSoundexFilter} */ public class TestDaitchMokotoffSoundexFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java index ca50c7afaab..390136cc325 100644 --- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java +++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDaitchMokotoffSoundexFilterFactory.java @@ -19,10 +19,10 @@ package org.apache.lucene.analysis.phonetic; import java.io.StringReader; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestDaitchMokotoffSoundexFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilter.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilter.java index 798c70013f6..fde7769eec6 100644 --- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilter.java +++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilter.java @@ -18,12 +18,12 @@ package org.apache.lucene.analysis.phonetic; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; public class TestDoubleMetaphoneFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java index 5ae14246b3a..4d8fae9ad95 100644 --- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java +++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestDoubleMetaphoneFilterFactory.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.phonetic; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestDoubleMetaphoneFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilter.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilter.java index e740cc32fcd..5a29785f26b 100644 --- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilter.java +++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilter.java @@ -26,10 +26,10 @@ import org.apache.commons.codec.language.Nysiis; import org.apache.commons.codec.language.RefinedSoundex; import org.apache.commons.codec.language.Soundex; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests {@link PhoneticFilter} */ public class TestPhoneticFilter extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java index e5afb179f69..65aebd8f881 100644 --- a/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java +++ b/lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilterFactory.java @@ -21,9 +21,9 @@ import java.util.HashMap; import java.util.Map; import org.apache.commons.codec.language.Caverphone2; import org.apache.commons.codec.language.Metaphone; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; public class TestPhoneticFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java b/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java index a191302d5ae..888e60a3bcf 100644 --- a/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java +++ b/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestHMMChineseTokenizerFactory.java @@ -19,9 +19,9 @@ package org.apache.lucene.analysis.cn.smart; import java.io.Reader; import java.io.StringReader; import java.util.HashMap; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.TokenizerFactory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Tests for {@link HMMChineseTokenizerFactory} */ public class TestHMMChineseTokenizerFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java b/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java index 79a89b0f820..e3492c383d3 100644 --- a/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java +++ b/lucene/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.cn.smart; import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.IOUtils; public class TestSmartChineseAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/pl/TestPolishAnalyzer.java b/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/pl/TestPolishAnalyzer.java index d688db77cc8..c1687cc119d 100644 --- a/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/pl/TestPolishAnalyzer.java +++ b/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/pl/TestPolishAnalyzer.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.pl; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestPolishAnalyzer extends BaseTokenStreamTestCase { /** This test fails with NPE when the stopwords file is missing in classpath */ diff --git a/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java b/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java index ff14bc5cc0c..0f9bb4df32b 100644 --- a/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java +++ b/lucene/analysis/stempel/src/test/org/apache/lucene/analysis/stempel/TestStempelPolishStemFilterFactory.java @@ -19,8 +19,8 @@ package org.apache.lucene.analysis.stempel; import java.io.Reader; import java.io.StringReader; import java.util.HashMap; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; /** Tests for {@link StempelPolishStemFilterFactory} */ public class TestStempelPolishStemFilterFactory extends BaseTokenStreamTestCase { diff --git a/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestCompile.java b/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestCompile.java index 8c27af0a488..aa196fdd1bc 100644 --- a/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestCompile.java +++ b/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestCompile.java @@ -65,7 +65,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.Locale; import java.util.StringTokenizer; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCompile extends LuceneTestCase { diff --git a/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestStemmer.java b/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestStemmer.java index b0d06c4d27f..02e27b2f473 100644 --- a/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestStemmer.java +++ b/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestStemmer.java @@ -55,7 +55,7 @@ individuals on behalf of the Egothor Project and was originally created by Leo Galambos (Leo.G@seznam.cz). */ -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestStemmer extends LuceneTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat.java index 3bc364b320a..0a9de02ef8a 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.backward_codecs.lucene40.blocktree.FieldReader; import org.apache.lucene.backward_codecs.lucene40.blocktree.Stats; import org.apache.lucene.backward_codecs.lucene50.Lucene50ScoreSkipReader.MutableImpactList; @@ -29,7 +28,6 @@ import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.CompetitiveImpactAccumulator; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.index.BasePostingsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.Impact; import org.apache.lucene.index.IndexWriter; @@ -39,8 +37,10 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; /** Tests BlockPostingsFormat */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat2.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat2.java index cc3dc608e53..337ec450c43 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat2.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat2.java @@ -16,7 +16,6 @@ */ package org.apache.lucene.backward_codecs.lucene50; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -26,11 +25,12 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.index.IndexableField; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; /** Tests special cases of BlockPostingsFormat */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat3.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat3.java index 7dec8c40c05..84f6ac950e1 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat3.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestBlockPostingsFormat3.java @@ -21,9 +21,6 @@ import java.util.Collections; import java.util.HashSet; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockFixedLengthPayloadFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.MockVariableLengthPayloadFilter; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.document.Document; @@ -38,19 +35,22 @@ import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum.SeekStatus; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockFixedLengthPayloadFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.MockVariableLengthPayloadFilter; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestForUtil.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestForUtil.java index 4513778bc6d..6c9bfebc20b 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestForUtil.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestForUtil.java @@ -28,9 +28,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; import org.apache.lucene.util.packed.PackedInts; @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50CompoundFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50CompoundFormat.java index 7fd2128072a..69c38210c7c 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50CompoundFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50CompoundFormat.java @@ -18,8 +18,8 @@ package org.apache.lucene.backward_codecs.lucene50; import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseCompoundFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseCompoundFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene50CompoundFormat extends BaseCompoundFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50LiveDocsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50LiveDocsFormat.java index f8ee50a5bf4..fca261f2a8a 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50LiveDocsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50LiveDocsFormat.java @@ -18,8 +18,8 @@ package org.apache.lucene.backward_codecs.lucene50; import org.apache.lucene.backward_codecs.lucene86.Lucene86RWCodec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseLiveDocsFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseLiveDocsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene50LiveDocsFormat extends BaseLiveDocsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormat.java index 935929c8978..51fd2a6c50d 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormat.java @@ -18,8 +18,8 @@ package org.apache.lucene.backward_codecs.lucene50; import org.apache.lucene.backward_codecs.lucene86.Lucene86RWCodec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene50StoredFieldsFormat extends BaseStoredFieldsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java index 89a34e1e644..fc10c6de2ef 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormatHighCompression.java @@ -22,12 +22,12 @@ import org.apache.lucene.backward_codecs.lucene86.Lucene86RWCodec; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.StoredField; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene50StoredFieldsFormatHighCompression extends BaseStoredFieldsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormatMergeInstance.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormatMergeInstance.java index 3ddd3c69ee5..5034e4032d6 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormatMergeInstance.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50StoredFieldsFormatMergeInstance.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.backward_codecs.lucene50; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; /** Test the merge instance of the Lucene50 stored fields format. */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50TermVectorsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50TermVectorsFormat.java index 39a8b1a9f20..388707407c8 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50TermVectorsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene50/TestLucene50TermVectorsFormat.java @@ -18,8 +18,8 @@ package org.apache.lucene.backward_codecs.lucene50; import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseTermVectorsFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseTermVectorsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene50TermVectorsFormat extends BaseTermVectorsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60FieldInfosFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60FieldInfosFormat.java index 0099e5dd67d..10b7fe9a92e 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60FieldInfosFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60FieldInfosFormat.java @@ -18,8 +18,8 @@ package org.apache.lucene.backward_codecs.lucene60; import org.apache.lucene.backward_codecs.lucene84.Lucene84RWCodec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseFieldInfoFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseFieldInfoFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene60FieldInfosFormat extends BaseFieldInfoFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60PointsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60PointsFormat.java index e70e6449be7..5e52c3dace6 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60PointsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60PointsFormat.java @@ -23,19 +23,19 @@ import org.apache.lucene.backward_codecs.lucene84.Lucene84RWCodec; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.BinaryPoint; import org.apache.lucene.document.Document; -import org.apache.lucene.index.BasePointsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.MockRandomMergePolicy; import org.apache.lucene.index.PointValues; import org.apache.lucene.index.PointValues.IntersectVisitor; import org.apache.lucene.index.PointValues.Relation; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BasePointsFormatTestCase; +import org.apache.lucene.tests.index.MockRandomMergePolicy; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; /** Tests Lucene60PointsFormat */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70SegmentInfoFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70SegmentInfoFormat.java index ed68ef982d7..f3d777de28b 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70SegmentInfoFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70SegmentInfoFormat.java @@ -19,8 +19,8 @@ package org.apache.lucene.backward_codecs.lucene70; import org.apache.lucene.backward_codecs.lucene84.Lucene84RWCodec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseSegmentInfoFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseSegmentInfoFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.lucene.util.Version; @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java index 5ae55493f70..390ddc37a2d 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java @@ -26,10 +26,8 @@ import java.util.Set; import java.util.TreeSet; import java.util.function.LongSupplier; import java.util.function.Supplier; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; @@ -40,7 +38,6 @@ import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; -import org.apache.lucene.index.BaseCompressingDocValuesFormatTestCase; import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.DocValues; @@ -51,7 +48,6 @@ import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.index.SortedNumericDocValues; @@ -63,9 +59,13 @@ import org.apache.lucene.index.TermsEnum.SeekStatus; import org.apache.lucene.store.ByteBuffersDataInput; import org.apache.lucene.store.ByteBuffersDataOutput; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.index.BaseCompressingDocValuesFormatTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; -import org.apache.lucene.util.TestUtil; /** Tests Lucene80DocValuesFormat */ public abstract class BaseLucene80DocValuesFormatTestCase diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestBestCompressionLucene80DocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestBestCompressionLucene80DocValuesFormat.java index 59dc7f97740..93ca2fe3cee 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestBestCompressionLucene80DocValuesFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestBestCompressionLucene80DocValuesFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.backward_codecs.lucene80; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; /** Tests Lucene80DocValuesFormat */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestBestSpeedLucene80DocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestBestSpeedLucene80DocValuesFormat.java index 47723f5fecd..2bdb660ca70 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestBestSpeedLucene80DocValuesFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestBestSpeedLucene80DocValuesFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.backward_codecs.lucene80; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; /** Tests Lucene80DocValuesFormat */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestDocValuesCompression.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestDocValuesCompression.java index 8dcfbc2b5dc..42e9ec28be6 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestDocValuesCompression.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestDocValuesCompression.java @@ -37,10 +37,10 @@ import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; @Nightly // N-2 formats are only tested on nightly runs public class TestDocValuesCompression extends LuceneTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestIndexedDISI.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestIndexedDISI.java index 7f42398f352..b15d2cfa836 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestIndexedDISI.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestIndexedDISI.java @@ -25,13 +25,13 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.RandomAccessInput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BitSet; import org.apache.lucene.util.BitSetIterator; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; import org.apache.lucene.util.SparseFixedBitSet; -import org.apache.lucene.util.TestUtil; @Nightly // N-2 formats are only tested on nightly runs public class TestIndexedDISI extends LuceneTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestLucene80NormsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestLucene80NormsFormat.java index bb51f100080..c61fb2beae4 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestLucene80NormsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestLucene80NormsFormat.java @@ -18,8 +18,8 @@ package org.apache.lucene.backward_codecs.lucene80; import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseNormsFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseNormsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; /** Tests Lucene80NormsFormat */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestLucene80NormsFormatMergeInstance.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestLucene80NormsFormatMergeInstance.java index f93d7e1f57f..851d8f82056 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestLucene80NormsFormatMergeInstance.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/TestLucene80NormsFormatMergeInstance.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.backward_codecs.lucene80; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; /** Test the merge instance of the Lucene80 norms format. */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestForDeltaUtil.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestForDeltaUtil.java index b36ca0f45a6..8217751151a 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestForDeltaUtil.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestForDeltaUtil.java @@ -25,9 +25,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestForUtil.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestForUtil.java index 04145cff1b6..75aa44c9eb3 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestForUtil.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestForUtil.java @@ -25,10 +25,10 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestLucene84PostingsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestLucene84PostingsFormat.java index 0521203755b..abb1c83247f 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestLucene84PostingsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestLucene84PostingsFormat.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.backward_codecs.lucene40.blocktree.FieldReader; import org.apache.lucene.backward_codecs.lucene40.blocktree.Stats; import org.apache.lucene.backward_codecs.lucene84.Lucene84ScoreSkipReader.MutableImpactList; @@ -29,7 +28,6 @@ import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.CompetitiveImpactAccumulator; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.index.BasePostingsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.Impact; import org.apache.lucene.index.IndexWriter; @@ -39,8 +37,10 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene84PostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestPForUtil.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestPForUtil.java index 02b88091302..fb6161830a3 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestPForUtil.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene84/TestPForUtil.java @@ -25,10 +25,10 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene86/TestLucene86PointsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene86/TestLucene86PointsFormat.java index 9d7678df4b1..c713ea58569 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene86/TestLucene86PointsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene86/TestLucene86PointsFormat.java @@ -26,21 +26,21 @@ import org.apache.lucene.codecs.PointsReader; import org.apache.lucene.codecs.PointsWriter; import org.apache.lucene.document.BinaryPoint; import org.apache.lucene.document.Document; -import org.apache.lucene.index.BasePointsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.MockRandomMergePolicy; import org.apache.lucene.index.PointValues; import org.apache.lucene.index.PointValues.IntersectVisitor; import org.apache.lucene.index.PointValues.Relation; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BasePointsFormatTestCase; +import org.apache.lucene.tests.index.MockRandomMergePolicy; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.bkd.BKDConfig; @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene86/TestLucene86SegmentInfoFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene86/TestLucene86SegmentInfoFormat.java index bc2b5c6db8f..c8901616763 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene86/TestLucene86SegmentInfoFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene86/TestLucene86SegmentInfoFormat.java @@ -19,8 +19,8 @@ package org.apache.lucene.backward_codecs.lucene86; import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseSegmentInfoFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseSegmentInfoFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.lucene.util.Version; @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormat.java index 4a11b40bb73..c58727903f9 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.backward_codecs.lucene87; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene87StoredFieldsFormat extends BaseStoredFieldsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormatHighCompression.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormatHighCompression.java index d197e0c2cd9..baaedbaed8c 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormatHighCompression.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormatHighCompression.java @@ -20,12 +20,12 @@ import com.carrotsearch.randomizedtesting.generators.RandomPicks; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.StoredField; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestLucene87StoredFieldsFormatHighCompression extends BaseStoredFieldsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormatMergeInstance.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormatMergeInstance.java index c9dab93dd90..7d7444cbed6 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormatMergeInstance.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene87/TestLucene87StoredFieldsFormatMergeInstance.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.backward_codecs.lucene87; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; /** Test the merge instance of the Lucene87 stored fields format. */ @Nightly // N-2 formats are only tested on nightly runs diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectMonotonic.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectMonotonic.java index cfc6aa2a0c8..ba988afa614 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectMonotonic.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectMonotonic.java @@ -26,11 +26,11 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.LongValues; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; @Nightly // N-2 formats are only tested on nightly runs public class TestLegacyDirectMonotonic extends LuceneTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectPacked.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectPacked.java index a8ee6fe1c8f..0cbceb92685 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectPacked.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectPacked.java @@ -23,10 +23,10 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.LongValues; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.TestUtil; @Nightly // N-2 formats are only tested on nightly runs public class TestLegacyDirectPacked extends LuceneTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyPackedInts.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyPackedInts.java index 1dc0be458b2..cdf5686bb66 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyPackedInts.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyPackedInts.java @@ -22,10 +22,10 @@ import org.apache.lucene.backward_codecs.store.EndiannessReverserUtil; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.RamUsageTester; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.RamUsageTester; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; import org.apache.lucene.util.packed.PackedInts.Reader; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/EndiannessReverserTestCase.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/EndiannessReverserTestCase.java index a0d1b3c06db..eeb1719f6f8 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/EndiannessReverserTestCase.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/EndiannessReverserTestCase.java @@ -22,8 +22,8 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.RandomAccessInput; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public abstract class EndiannessReverserTestCase extends LuceneTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/TestEndiannessReverserCheckSumIndexInput.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/TestEndiannessReverserCheckSumIndexInput.java index 8e3f6486eda..ded97033ec2 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/TestEndiannessReverserCheckSumIndexInput.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/TestEndiannessReverserCheckSumIndexInput.java @@ -21,7 +21,7 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestEndiannessReverserCheckSumIndexInput extends EndiannessReverserTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/TestEndiannessReverserIndexInput.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/TestEndiannessReverserIndexInput.java index 6e7f0c0884f..757ef328b77 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/TestEndiannessReverserIndexInput.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/store/TestEndiannessReverserIndexInput.java @@ -21,7 +21,7 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; @Nightly // N-2 formats are only tested on nightly runs public class TestEndiannessReverserIndexInput extends EndiannessReverserTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java index 442ae7355fa..362326180be 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java @@ -39,7 +39,6 @@ import java.util.Set; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.BinaryPoint; @@ -81,7 +80,6 @@ import org.apache.lucene.index.MultiTerms; import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SegmentCommitInfo; import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.index.SegmentReader; @@ -103,19 +101,21 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.NIOFSDirectory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestIndexWriterOnOldIndex.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestIndexWriterOnOldIndex.java index a3f00b94dd7..66fc4fdd891 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestIndexWriterOnOldIndex.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestIndexWriterOnOldIndex.java @@ -23,8 +23,8 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Version; public class TestIndexWriterOnOldIndex extends LuceneTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestManyPointsInOldIndex.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestManyPointsInOldIndex.java index cae0742bb98..0a7571bcc2f 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestManyPointsInOldIndex.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestManyPointsInOldIndex.java @@ -24,11 +24,11 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.IntPoint; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; // LUCENE-7501 public class TestManyPointsInOldIndex extends LuceneTestCase { diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java index f8287fbfa5a..a37c740ee71 100644 --- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java +++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/BenchmarkTestCase.java @@ -22,8 +22,8 @@ import java.io.StringReader; import java.nio.file.Files; import java.nio.file.Path; import org.apache.lucene.benchmark.byTask.Benchmark; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java index eae50b71da2..4b8b390f4c6 100644 --- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java +++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java @@ -25,8 +25,6 @@ import java.util.Collection; import java.util.List; import java.util.Locale; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute; import org.apache.lucene.benchmark.BenchmarkTestCase; @@ -53,9 +51,11 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Test very simply that perf tasks - simple algorithms - are doing what they should. */ @LuceneTestCase.SuppressCodecs({"SimpleText", "Direct"}) diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java index b3ccee71863..010f70f638c 100644 --- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java +++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java @@ -34,8 +34,8 @@ import org.apache.lucene.benchmark.byTask.tasks.TaskSequence; import org.apache.lucene.benchmark.byTask.utils.Algorithm; import org.apache.lucene.benchmark.byTask.utils.Config; import org.apache.lucene.search.Query; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; import org.junit.Assert; /** Test very simply that perf tasks are parsed as expected. */ diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestEnwikiContentSource.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestEnwikiContentSource.java index c2464b573db..a2a58bdb5d1 100644 --- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestEnwikiContentSource.java +++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestEnwikiContentSource.java @@ -23,7 +23,7 @@ import java.nio.charset.StandardCharsets; import java.text.ParseException; import java.util.Properties; import org.apache.lucene.benchmark.byTask.utils.Config; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestEnwikiContentSource extends LuceneTestCase { diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestHtmlParser.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestHtmlParser.java index 7353d640baf..9d147832bf4 100644 --- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestHtmlParser.java +++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestHtmlParser.java @@ -20,7 +20,7 @@ import java.io.StringReader; import java.util.Locale; import java.util.Properties; import org.apache.lucene.benchmark.byTask.feeds.DemoHTMLParser.Parser; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestHtmlParser extends LuceneTestCase { diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestTrecContentSource.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestTrecContentSource.java index b5b2f67e52c..9a038b2bde7 100644 --- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestTrecContentSource.java +++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestTrecContentSource.java @@ -28,8 +28,8 @@ import java.util.Properties; import org.apache.lucene.benchmark.byTask.feeds.TrecDocParser.ParsePathType; import org.apache.lucene.benchmark.byTask.utils.Config; import org.apache.lucene.document.DateTools; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestTrecContentSource extends LuceneTestCase { diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java index 1fd668ab112..57c4f5a34f0 100644 --- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java +++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java @@ -17,7 +17,7 @@ package org.apache.lucene.benchmark.byTask.utils; import java.util.Properties; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestConfig extends LuceneTestCase { diff --git a/lucene/classification/src/test/org/apache/lucene/classification/ClassificationTestBase.java b/lucene/classification/src/test/org/apache/lucene/classification/ClassificationTestBase.java index 28b6e48854a..edc880fbee4 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/ClassificationTestBase.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/ClassificationTestBase.java @@ -25,12 +25,12 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.After; import org.junit.Before; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/Test20NewsgroupsClassification.java b/lucene/classification/src/test/org/apache/lucene/classification/Test20NewsgroupsClassification.java index 61afc53e5e4..1cb03f618dd 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/Test20NewsgroupsClassification.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/Test20NewsgroupsClassification.java @@ -60,10 +60,10 @@ import org.apache.lucene.search.similarities.LambdaTTF; import org.apache.lucene.search.similarities.Normalization; import org.apache.lucene.search.similarities.NormalizationH1; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; -import org.apache.lucene.util.TestUtil; import org.junit.Test; @LuceneTestCase.SuppressSysoutChecks(bugUrl = "none") diff --git a/lucene/classification/src/test/org/apache/lucene/classification/TestBM25NBClassifier.java b/lucene/classification/src/test/org/apache/lucene/classification/TestBM25NBClassifier.java index f1220d2a750..b392b6a1fe1 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/TestBM25NBClassifier.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/TestBM25NBClassifier.java @@ -17,7 +17,6 @@ package org.apache.lucene.classification; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter; @@ -29,6 +28,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.BytesRef; import org.junit.Test; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/TestBooleanPerceptronClassifier.java b/lucene/classification/src/test/org/apache/lucene/classification/TestBooleanPerceptronClassifier.java index ba6a485c95b..a6abd5796c8 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/TestBooleanPerceptronClassifier.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/TestBooleanPerceptronClassifier.java @@ -16,7 +16,6 @@ */ package org.apache.lucene.classification; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.classification.utils.ConfusionMatrixGenerator; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.MultiTerms; @@ -24,6 +23,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.BytesRef; import org.junit.Test; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/TestCachingNaiveBayesClassifier.java b/lucene/classification/src/test/org/apache/lucene/classification/TestCachingNaiveBayesClassifier.java index e69e10f857c..c4868c0549e 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/TestCachingNaiveBayesClassifier.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/TestCachingNaiveBayesClassifier.java @@ -17,7 +17,6 @@ package org.apache.lucene.classification; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter; @@ -29,6 +28,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.BytesRef; import org.junit.Test; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/TestKNearestFuzzyClassifier.java b/lucene/classification/src/test/org/apache/lucene/classification/TestKNearestFuzzyClassifier.java index 2ba1c0885e3..e4428ada7bd 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/TestKNearestFuzzyClassifier.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/TestKNearestFuzzyClassifier.java @@ -16,7 +16,6 @@ */ package org.apache.lucene.classification; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.classification.utils.ConfusionMatrixGenerator; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.MultiTerms; @@ -24,6 +23,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.BytesRef; import org.junit.Test; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/TestKNearestNeighborClassifier.java b/lucene/classification/src/test/org/apache/lucene/classification/TestKNearestNeighborClassifier.java index 95e4f505524..364758dc034 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/TestKNearestNeighborClassifier.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/TestKNearestNeighborClassifier.java @@ -18,7 +18,6 @@ package org.apache.lucene.classification; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.classification.utils.ConfusionMatrixGenerator; import org.apache.lucene.index.LeafReader; @@ -29,6 +28,7 @@ import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.search.similarities.LMDirichletSimilarity; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.BytesRef; import org.junit.Test; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/TestSimpleNaiveBayesClassifier.java b/lucene/classification/src/test/org/apache/lucene/classification/TestSimpleNaiveBayesClassifier.java index 18538907b22..82c2b871c9c 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/TestSimpleNaiveBayesClassifier.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/TestSimpleNaiveBayesClassifier.java @@ -17,7 +17,6 @@ package org.apache.lucene.classification; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter; @@ -29,6 +28,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.BytesRef; import org.junit.Test; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/document/DocumentClassificationTestBase.java b/lucene/classification/src/test/org/apache/lucene/classification/document/DocumentClassificationTestBase.java index 890e3638ee1..7e9fa45282d 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/document/DocumentClassificationTestBase.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/document/DocumentClassificationTestBase.java @@ -27,7 +27,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; import org.junit.Before; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/utils/TestConfusionMatrixGenerator.java b/lucene/classification/src/test/org/apache/lucene/classification/utils/TestConfusionMatrixGenerator.java index ba03ec34fc2..41e6575483e 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/utils/TestConfusionMatrixGenerator.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/utils/TestConfusionMatrixGenerator.java @@ -18,7 +18,6 @@ package org.apache.lucene.classification.utils; import java.io.IOException; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.classification.BM25NBClassifier; import org.apache.lucene.classification.BooleanPerceptronClassifier; import org.apache.lucene.classification.CachingNaiveBayesClassifier; @@ -29,6 +28,7 @@ import org.apache.lucene.classification.KNearestFuzzyClassifier; import org.apache.lucene.classification.KNearestNeighborClassifier; import org.apache.lucene.classification.SimpleNaiveBayesClassifier; import org.apache.lucene.index.LeafReader; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.BytesRef; import org.junit.Test; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/utils/TestDataSplitter.java b/lucene/classification/src/test/org/apache/lucene/classification/utils/TestDataSplitter.java index 7228130f054..c7cd6cb2c7e 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/utils/TestDataSplitter.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/utils/TestDataSplitter.java @@ -18,7 +18,6 @@ package org.apache.lucene.classification.utils; import java.io.IOException; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -27,12 +26,13 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/classification/src/test/org/apache/lucene/classification/utils/TestDocToDoubleVectorUtils.java b/lucene/classification/src/test/org/apache/lucene/classification/utils/TestDocToDoubleVectorUtils.java index 7db23939c22..c150d011a2e 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/utils/TestDocToDoubleVectorUtils.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/utils/TestDocToDoubleVectorUtils.java @@ -22,13 +22,13 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiTerms; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Terms; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestFixedGapPostingsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestFixedGapPostingsFormat.java index 2d80009c69f..6157244d0fa 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestFixedGapPostingsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestFixedGapPostingsFormat.java @@ -17,8 +17,9 @@ package org.apache.lucene.codecs.blockterms; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.codecs.blockterms.LuceneFixedGap; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Basic tests of a PF using FixedGap terms dictionary */ public class TestFixedGapPostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestVarGapDocFreqIntervalPostingsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestVarGapDocFreqIntervalPostingsFormat.java index 5f66a59f042..cbdbdc7fa9f 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestVarGapDocFreqIntervalPostingsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestVarGapDocFreqIntervalPostingsFormat.java @@ -17,8 +17,9 @@ package org.apache.lucene.codecs.blockterms; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.codecs.blockterms.LuceneVarGapFixedInterval; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Basic tests of a PF using VariableGap terms dictionary (fixed interval) */ public class TestVarGapDocFreqIntervalPostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestVarGapFixedIntervalPostingsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestVarGapFixedIntervalPostingsFormat.java index 73566fa2642..c6564614a93 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestVarGapFixedIntervalPostingsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/blockterms/TestVarGapFixedIntervalPostingsFormat.java @@ -17,8 +17,9 @@ package org.apache.lucene.codecs.blockterms; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.codecs.blockterms.LuceneVarGapDocFreqInterval; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Basic tests of a PF using VariableGap terms dictionary (fixed interval, docFreq threshold) */ public class TestVarGapFixedIntervalPostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/blocktreeords/TestOrdsBlockTree.java b/lucene/codecs/src/test/org/apache/lucene/codecs/blocktreeords/TestOrdsBlockTree.java index 1c6ea28309f..b4a7faa9a44 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/blocktreeords/TestOrdsBlockTree.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/blocktreeords/TestOrdsBlockTree.java @@ -20,21 +20,21 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.index.BasePostingsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.MultiTerms; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; public class TestOrdsBlockTree extends BasePostingsFormatTestCase { private final Codec codec = TestUtil.alwaysPostingsFormat(new BlockTreeOrdsPostingsFormat()); diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/bloom/TestBloomPostingsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/bloom/TestBloomPostingsFormat.java index 89b58a29af0..38b90d7e576 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/bloom/TestBloomPostingsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/bloom/TestBloomPostingsFormat.java @@ -17,8 +17,9 @@ package org.apache.lucene.codecs.bloom; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.codecs.bloom.TestBloomFilteredLucenePostings; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Basic tests for BloomPostingsFormat */ public class TestBloomPostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/memory/TestDirectPostingsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/memory/TestDirectPostingsFormat.java index 69e9226e32f..493ad6bbd4f 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/memory/TestDirectPostingsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/memory/TestDirectPostingsFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.memory; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests DirectPostingsFormat */ public class TestDirectPostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/memory/TestFSTPostingsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/memory/TestFSTPostingsFormat.java index 2ffbaa8b1e8..b94ca70ef8b 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/memory/TestFSTPostingsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/memory/TestFSTPostingsFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.memory; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests FSTPostingsFormat */ public class TestFSTPostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextCompoundFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextCompoundFormat.java index 8bdd18bc6d1..fbb0ce1ebf6 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextCompoundFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextCompoundFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseCompoundFormatTestCase; +import org.apache.lucene.tests.index.BaseCompoundFormatTestCase; public class TestSimpleTextCompoundFormat extends BaseCompoundFormatTestCase { private final Codec codec = new SimpleTextCodec(); diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextDocValuesFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextDocValuesFormat.java index a33697b6c8f..ed13e2bbad8 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextDocValuesFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextDocValuesFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseDocValuesFormatTestCase; +import org.apache.lucene.tests.index.BaseDocValuesFormatTestCase; /** Tests SimpleTextDocValuesFormat */ public class TestSimpleTextDocValuesFormat extends BaseDocValuesFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextFieldInfoFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextFieldInfoFormat.java index e507403a065..842f59dfac6 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextFieldInfoFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextFieldInfoFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseFieldInfoFormatTestCase; +import org.apache.lucene.tests.index.BaseFieldInfoFormatTestCase; /** Tests SimpleTextFieldInfoFormat */ public class TestSimpleTextFieldInfoFormat extends BaseFieldInfoFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextKnnVectorsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextKnnVectorsFormat.java index 296ecd1912e..527112b0db2 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextKnnVectorsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextKnnVectorsFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseKnnVectorsFormatTestCase; +import org.apache.lucene.tests.index.BaseKnnVectorsFormatTestCase; public class TestSimpleTextKnnVectorsFormat extends BaseKnnVectorsFormatTestCase { @Override diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextLiveDocsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextLiveDocsFormat.java index bb2ff691461..2c78db8341d 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextLiveDocsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextLiveDocsFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseLiveDocsFormatTestCase; +import org.apache.lucene.tests.index.BaseLiveDocsFormatTestCase; public class TestSimpleTextLiveDocsFormat extends BaseLiveDocsFormatTestCase { private final Codec codec = new SimpleTextCodec(); diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextNormsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextNormsFormat.java index 672a2666760..96b85dc52f4 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextNormsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextNormsFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseNormsFormatTestCase; +import org.apache.lucene.tests.index.BaseNormsFormatTestCase; /** Tests SimpleTextNormsFormat */ public class TestSimpleTextNormsFormat extends BaseNormsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextPointsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextPointsFormat.java index 8f80f9fdd58..cca19b6260d 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextPointsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextPointsFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePointsFormatTestCase; +import org.apache.lucene.tests.index.BasePointsFormatTestCase; /** Tests SimpleText's point format */ public class TestSimpleTextPointsFormat extends BasePointsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextPostingsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextPostingsFormat.java index 7d90470f385..8a07b2d88a2 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextPostingsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextPostingsFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; /** Tests SimpleText's postings */ @Nightly // please figure out why I am so horrendously slow! diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextSegmentInfoFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextSegmentInfoFormat.java index 156c063d03f..610f5a2d756 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextSegmentInfoFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextSegmentInfoFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseSegmentInfoFormatTestCase; +import org.apache.lucene.tests.index.BaseSegmentInfoFormatTestCase; import org.apache.lucene.util.Version; /** Tests SimpleTextSegmentInfoFormat */ diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextStoredFieldsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextStoredFieldsFormat.java index 3726eb62439..6e30d64fd49 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextStoredFieldsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextStoredFieldsFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; public class TestSimpleTextStoredFieldsFormat extends BaseStoredFieldsFormatTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextTermVectorsFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextTermVectorsFormat.java index b2ebc21c174..1c9e3047b77 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextTermVectorsFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/simpletext/TestSimpleTextTermVectorsFormat.java @@ -17,7 +17,7 @@ package org.apache.lucene.codecs.simpletext; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseTermVectorsFormatTestCase; +import org.apache.lucene.tests.index.BaseTermVectorsFormatTestCase; public class TestSimpleTextTermVectorsFormat extends BaseTermVectorsFormatTestCase { @Override diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestBlockWriter.java b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestBlockWriter.java index 815d286972f..5d74e7bf0d0 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestBlockWriter.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestBlockWriter.java @@ -26,8 +26,8 @@ import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.VectorSimilarityFunction; import org.apache.lucene.store.ByteBuffersDataOutput; import org.apache.lucene.store.ByteBuffersIndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Tests {@link BlockWriter}. */ public class TestBlockWriter extends LuceneTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestFSTDictionary.java b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestFSTDictionary.java index d3e8004064d..d9ae90a9d24 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestFSTDictionary.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestFSTDictionary.java @@ -24,8 +24,9 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; import org.apache.lucene.store.ByteBuffersDataOutput; +import org.apache.lucene.tests.codecs.uniformsplit.Rot13CypherTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Tests {@link FSTDictionary}. */ public class TestFSTDictionary extends LuceneTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestTermBytes.java b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestTermBytes.java index 9fb54080c31..a5f90976120 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestTermBytes.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestTermBytes.java @@ -22,8 +22,8 @@ import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Tests {@link TermBytes}. */ public class TestTermBytes extends LuceneTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestTermBytesComparator.java b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestTermBytesComparator.java index c2ba3e99dcc..e1bec2ea3f5 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestTermBytesComparator.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestTermBytesComparator.java @@ -33,8 +33,8 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Tests the {@link TermBytes} comparator. */ public class TestTermBytesComparator extends LuceneTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestUniformSplitPostingFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestUniformSplitPostingFormat.java index 95242eb2371..0b5a573df3e 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestUniformSplitPostingFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/TestUniformSplitPostingFormat.java @@ -19,8 +19,9 @@ package org.apache.lucene.codecs.uniformsplit; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.codecs.uniformsplit.UniformSplitRot13PostingsFormat; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.After; import org.junit.Before; diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/sharedterms/TestSTBlockReader.java b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/sharedterms/TestSTBlockReader.java index 513a0d99b8c..2a5e9121edf 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/sharedterms/TestSTBlockReader.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/sharedterms/TestSTBlockReader.java @@ -48,8 +48,8 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestSTBlockReader extends LuceneTestCase { diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/sharedterms/TestSTUniformSplitPostingFormat.java b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/sharedterms/TestSTUniformSplitPostingFormat.java index d68660a5432..c3cab041f4e 100644 --- a/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/sharedterms/TestSTUniformSplitPostingFormat.java +++ b/lucene/codecs/src/test/org/apache/lucene/codecs/uniformsplit/sharedterms/TestSTUniformSplitPostingFormat.java @@ -20,6 +20,7 @@ package org.apache.lucene.codecs.uniformsplit.sharedterms; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.uniformsplit.TestUniformSplitPostingFormat; import org.apache.lucene.codecs.uniformsplit.UniformSplitTermsWriter; +import org.apache.lucene.tests.codecs.uniformsplit.sharedterms.STUniformSplitRot13PostingsFormat; /** Tests {@link STUniformSplitPostingsFormat} with block encoding using ROT13 cypher. */ public class TestSTUniformSplitPostingFormat extends TestUniformSplitPostingFormat { diff --git a/lucene/core/src/java/module-info.java b/lucene/core/src/java/module-info.java index 931d4cbac2d..79ca14519e8 100644 --- a/lucene/core/src/java/module-info.java +++ b/lucene/core/src/java/module-info.java @@ -16,6 +16,7 @@ */ /** Lucene Core. */ +@SuppressWarnings("module") // the test framework is compiled after the core... module org.apache.lucene.core { requires jdk.unsupported; // this is needed for MMapDirectory to unmap @@ -46,6 +47,10 @@ module org.apache.lucene.core { exports org.apache.lucene.util.mutable; exports org.apache.lucene.util.packed; + // Only export internal packages to the test framework. + exports org.apache.lucene.internal.tests to + org.apache.lucene.test_framework; + provides org.apache.lucene.analysis.TokenizerFactory with org.apache.lucene.analysis.standard.StandardTokenizerFactory; provides org.apache.lucene.codecs.Codec with diff --git a/lucene/core/src/java/org/apache/lucene/analysis/TokenFilter.java b/lucene/core/src/java/org/apache/lucene/analysis/TokenFilter.java index 9e05e9050e3..e83fcfe8ae4 100644 --- a/lucene/core/src/java/org/apache/lucene/analysis/TokenFilter.java +++ b/lucene/core/src/java/org/apache/lucene/analysis/TokenFilter.java @@ -17,6 +17,7 @@ package org.apache.lucene.analysis; import java.io.IOException; +import org.apache.lucene.util.Unwrappable; /** * A TokenFilter is a TokenStream whose input is another TokenStream. @@ -25,7 +26,7 @@ import java.io.IOException; * * @see TokenStream */ -public abstract class TokenFilter extends TokenStream { +public abstract class TokenFilter extends TokenStream implements Unwrappable { /** The source of tokens for this filter. */ protected final TokenStream input; @@ -67,4 +68,9 @@ public abstract class TokenFilter extends TokenStream { public void reset() throws IOException { input.reset(); } + + @Override + public TokenStream unwrap() { + return input; + } } diff --git a/lucene/core/src/java/org/apache/lucene/analysis/Tokenizer.java b/lucene/core/src/java/org/apache/lucene/analysis/Tokenizer.java index 343e01154d1..1e30737ce4a 100644 --- a/lucene/core/src/java/org/apache/lucene/analysis/Tokenizer.java +++ b/lucene/core/src/java/org/apache/lucene/analysis/Tokenizer.java @@ -103,8 +103,8 @@ public abstract class Tokenizer extends TokenStream { inputPending = ILLEGAL_STATE_READER; } - // only used for testing - void setReaderTestPoint() {} + /** @lucene.internal */ + protected void setReaderTestPoint() {} private static final Reader ILLEGAL_STATE_READER = new Reader() { diff --git a/lucene/core/src/java/org/apache/lucene/analysis/package-info.java b/lucene/core/src/java/org/apache/lucene/analysis/package-info.java index 52f18765188..451227a6399 100644 --- a/lucene/core/src/java/org/apache/lucene/analysis/package-info.java +++ b/lucene/core/src/java/org/apache/lucene/analysis/package-info.java @@ -553,7 +553,7 @@ *

Testing Your Analysis Component

* *

The lucene-test-framework component defines BaseTokenStreamTestCase. + * href="{@docRoot}/../test-framework/org/apache/lucene/tests/analysis/BaseTokenStreamTestCase.html">BaseTokenStreamTestCase. * By extending this class, you can create JUnit tests that validate that your Analyzer and/or * analysis components correctly implement the protocol. The checkRandomData methods of that class * are particularly effective in flushing out errors. diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYEncodingUtils.java b/lucene/core/src/java/org/apache/lucene/geo/XYEncodingUtils.java index b3dede3c391..113cbb15dfc 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYEncodingUtils.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYEncodingUtils.java @@ -74,7 +74,13 @@ public final class XYEncodingUtils { return decode(NumericUtils.sortableBytesToInt(src, offset)); } - static double[] floatArrayToDoubleArray(float[] f) { + /** + * Convert an array of {@code float} numbers to {@code double} numbers. + * + * @param f The input floats + * @return Corresponding double array. + */ + public static double[] floatArrayToDoubleArray(float[] f) { double[] d = new double[f.length]; for (int i = 0; i < f.length; i++) { d[i] = f[i]; diff --git a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java index 64bc28c7928..de5141acb2c 100644 --- a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java +++ b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java @@ -2285,6 +2285,11 @@ public final class CheckIndex implements Closeable { return status; } + /** + * For use in tests only. + * + * @lucene.internal + */ static void checkImpacts(Impacts impacts, int lastTarget) { final int numLevels = impacts.numLevels(); if (numLevels < 1) { diff --git a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java index d4acf03cf73..08cc014b3e1 100644 --- a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java +++ b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java @@ -22,6 +22,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; import org.apache.lucene.index.MergePolicy.OneMerge; +import org.apache.lucene.internal.tests.ConcurrentMergeSchedulerAccess; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FilterDirectory; @@ -897,4 +899,14 @@ public class ConcurrentMergeScheduler extends MergeScheduler { private static String getSegmentName(MergePolicy.OneMerge merge) { return merge.info != null ? merge.info.info.name : "_na_"; } + + static { + TestSecrets.setConcurrentMergeSchedulerAccess( + new ConcurrentMergeSchedulerAccess() { + @Override + public void setSuppressExceptions(ConcurrentMergeScheduler cms) { + cms.setSuppressExceptions(); + } + }); + } } diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java b/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java index 8da4fbef18f..b00951c7299 100644 --- a/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java +++ b/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java @@ -22,6 +22,7 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.Unwrappable; /** * A FilterLeafReader contains another LeafReader, which it uses as its basic source of @@ -242,7 +243,8 @@ public abstract class FilterLeafReader extends LeafReader { } /** Base class for filtering {@link PostingsEnum} implementations. */ - public abstract static class FilterPostingsEnum extends PostingsEnum { + public abstract static class FilterPostingsEnum extends PostingsEnum + implements Unwrappable { /** The underlying PostingsEnum instance. */ protected final PostingsEnum in; @@ -302,6 +304,11 @@ public abstract class FilterLeafReader extends LeafReader { public long cost() { return in.cost(); } + + @Override + public PostingsEnum unwrap() { + return in; + } } /** The underlying LeafReader. */ diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterMergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/FilterMergePolicy.java index d37f6f4dc2b..8a5e3901c40 100644 --- a/lucene/core/src/java/org/apache/lucene/index/FilterMergePolicy.java +++ b/lucene/core/src/java/org/apache/lucene/index/FilterMergePolicy.java @@ -19,13 +19,14 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Map; import org.apache.lucene.util.IOSupplier; +import org.apache.lucene.util.Unwrappable; /** * A wrapper for {@link MergePolicy} instances. * * @lucene.experimental */ -public class FilterMergePolicy extends MergePolicy { +public class FilterMergePolicy extends MergePolicy implements Unwrappable { /** The wrapped {@link MergePolicy}. */ protected final MergePolicy in; @@ -118,4 +119,9 @@ public class FilterMergePolicy extends MergePolicy { throws IOException { return in.numDeletesToMerge(info, delCount, readerSupplier); } + + @Override + public MergePolicy unwrap() { + return in; + } } diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexReader.java b/lucene/core/src/java/org/apache/lucene/index/IndexReader.java index 4f60f905a1f..6a0fb033b76 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexReader.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexReader.java @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.lucene.document.Document; import org.apache.lucene.document.DocumentStoredFieldVisitor; import org.apache.lucene.store.AlreadyClosedException; -import org.apache.lucene.util.Bits; // javadocs +import org.apache.lucene.util.Bits; /** * IndexReader is an abstract class, providing an interface for accessing a point-in-time view of an @@ -171,8 +171,12 @@ public abstract class IndexReader implements Closeable { parentReaders.add(reader); } - // overridden by StandardDirectoryReader and SegmentReader - void notifyReaderClosedListeners() throws IOException { + /** + * For test framework use only. + * + * @lucene.internal + */ + protected void notifyReaderClosedListeners() throws IOException { // nothing to notify in the base impl } diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java index 580ea73a0a5..e48e7afd37e 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java @@ -55,6 +55,9 @@ import org.apache.lucene.index.DocValuesUpdate.BinaryDocValuesUpdate; import org.apache.lucene.index.DocValuesUpdate.NumericDocValuesUpdate; import org.apache.lucene.index.FieldInfos.FieldNumbers; import org.apache.lucene.index.IndexWriterConfig.OpenMode; +import org.apache.lucene.internal.tests.IndexPackageAccess; +import org.apache.lucene.internal.tests.IndexWriterAccess; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.DocValuesFieldExistsQuery; import org.apache.lucene.search.MatchAllDocsQuery; @@ -448,10 +451,6 @@ public class IndexWriter } }; - DirectoryReader getReader() throws IOException { - return getReader(true, false); - } - /** * Expert: returns a readonly reader, covering all committed as well as un-committed changes to * the index. This provides "near real-time" searching, in that changes made during an IndexWriter @@ -6277,4 +6276,84 @@ public class IndexWriter mergesEnabled = true; } } + + static { + TestSecrets.setIndexWriterAccess( + new IndexWriterAccess() { + @Override + public String segString(IndexWriter iw) { + return iw.segString(); + } + + @Override + public int getSegmentCount(IndexWriter iw) { + return iw.getSegmentCount(); + } + + @Override + public boolean isClosed(IndexWriter iw) { + return iw.isClosed(); + } + + @Override + public DirectoryReader getReader( + IndexWriter iw, boolean applyDeletions, boolean writeAllDeletes) throws IOException { + return iw.getReader(applyDeletions, writeAllDeletes); + } + + @Override + public int getDocWriterThreadPoolSize(IndexWriter iw) { + return iw.docWriter.perThreadPool.size(); + } + + @Override + public boolean isDeleterClosed(IndexWriter iw) { + return iw.isDeleterClosed(); + } + + @Override + public SegmentCommitInfo newestSegment(IndexWriter iw) { + return iw.newestSegment(); + } + }); + + // Piggyback general package-scope accessors. + TestSecrets.setIndexPackageAccess( + new IndexPackageAccess() { + + @Override + public IndexReader.CacheKey newCacheKey() { + return new IndexReader.CacheKey(); + } + + @Override + public void setIndexWriterMaxDocs(int limit) { + IndexWriter.setMaxDocs(limit); + } + + @Override + public FieldInfosBuilder newFieldInfosBuilder(String softDeletesFieldName) { + return new FieldInfosBuilder() { + private FieldInfos.Builder builder = + new FieldInfos.Builder(new FieldInfos.FieldNumbers(softDeletesFieldName)); + + @Override + public FieldInfosBuilder add(FieldInfo fi) { + builder.add(fi); + return this; + } + + @Override + public FieldInfos finish() { + return builder.finish(); + } + }; + } + + @Override + public void checkImpacts(Impacts impacts, int max) { + CheckIndex.checkImpacts(impacts, max); + } + }); + } } diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java b/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java index a66b29a8f5d..c13858c14ff 100644 --- a/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java +++ b/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java @@ -29,6 +29,8 @@ import org.apache.lucene.codecs.NormsProducer; import org.apache.lucene.codecs.PointsReader; import org.apache.lucene.codecs.StoredFieldsReader; import org.apache.lucene.codecs.TermVectorsReader; +import org.apache.lucene.internal.tests.SegmentReaderAccess; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.util.Bits; @@ -311,7 +313,7 @@ public final class SegmentReader extends CodecReader { private final Set readerClosedListeners = new CopyOnWriteArraySet<>(); @Override - void notifyReaderClosedListeners() throws IOException { + protected void notifyReaderClosedListeners() throws IOException { synchronized (readerClosedListeners) { IOUtils.applyToAll(readerClosedListeners, l -> l.onClose(readerCacheHelper.getKey())); } @@ -393,4 +395,14 @@ public final class SegmentReader extends CodecReader { core.cfsReader.checkIntegrity(); } } + + static { + TestSecrets.setSegmentReaderAccess( + new SegmentReaderAccess() { + @Override + public Object getCore(SegmentReader segmentReader) { + return segmentReader.core; + } + }); + } } diff --git a/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java index e5051af29fd..fd929457cf2 100644 --- a/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java +++ b/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java @@ -579,7 +579,7 @@ public final class StandardDirectoryReader extends DirectoryReader { }; @Override - void notifyReaderClosedListeners() throws IOException { + protected void notifyReaderClosedListeners() throws IOException { synchronized (readerClosedListeners) { IOUtils.applyToAll(readerClosedListeners, l -> l.onClose(cacheHelper.getKey())); } diff --git a/lucene/core/src/java/org/apache/lucene/internal/tests/ConcurrentMergeSchedulerAccess.java b/lucene/core/src/java/org/apache/lucene/internal/tests/ConcurrentMergeSchedulerAccess.java new file mode 100644 index 00000000000..d9505082112 --- /dev/null +++ b/lucene/core/src/java/org/apache/lucene/internal/tests/ConcurrentMergeSchedulerAccess.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.internal.tests; + +import org.apache.lucene.index.ConcurrentMergeScheduler; + +/** + * Access to {@link org.apache.lucene.index.ConcurrentMergeScheduler} internals exposed to the test + * framework. + * + * @lucene.internal + */ +public interface ConcurrentMergeSchedulerAccess { + void setSuppressExceptions(ConcurrentMergeScheduler cms); +} diff --git a/lucene/core/src/java/org/apache/lucene/internal/tests/IndexPackageAccess.java b/lucene/core/src/java/org/apache/lucene/internal/tests/IndexPackageAccess.java new file mode 100644 index 00000000000..545b5659933 --- /dev/null +++ b/lucene/core/src/java/org/apache/lucene/internal/tests/IndexPackageAccess.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.internal.tests; + +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.FieldInfos; +import org.apache.lucene.index.Impacts; +import org.apache.lucene.index.IndexReader; + +/** + * Access to {@link org.apache.lucene.index} package internals exposed to the test framework. + * + * @lucene.internal + */ +public interface IndexPackageAccess { + IndexReader.CacheKey newCacheKey(); + + void setIndexWriterMaxDocs(int limit); + + FieldInfosBuilder newFieldInfosBuilder(String softDeletesFieldName); + + void checkImpacts(Impacts impacts, int max); + + /** Public type exposing {@link FieldInfo} internal builders. */ + interface FieldInfosBuilder { + FieldInfosBuilder add(FieldInfo fi); + + FieldInfos finish(); + } +} diff --git a/lucene/core/src/java/org/apache/lucene/internal/tests/IndexWriterAccess.java b/lucene/core/src/java/org/apache/lucene/internal/tests/IndexWriterAccess.java new file mode 100644 index 00000000000..82ee409b976 --- /dev/null +++ b/lucene/core/src/java/org/apache/lucene/internal/tests/IndexWriterAccess.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.internal.tests; + +import java.io.IOException; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.SegmentCommitInfo; + +/** + * Access to {@link org.apache.lucene.index.IndexWriter} internals exposed to the test framework. + * + * @lucene.internal + */ +public interface IndexWriterAccess { + String segString(IndexWriter iw); + + int getSegmentCount(IndexWriter iw); + + boolean isClosed(IndexWriter iw); + + DirectoryReader getReader(IndexWriter iw, boolean applyDeletions, boolean writeAllDeletes) + throws IOException; + + int getDocWriterThreadPoolSize(IndexWriter iw); + + boolean isDeleterClosed(IndexWriter iw); + + SegmentCommitInfo newestSegment(IndexWriter iw); +} diff --git a/lucene/core/src/java/org/apache/lucene/internal/tests/SegmentReaderAccess.java b/lucene/core/src/java/org/apache/lucene/internal/tests/SegmentReaderAccess.java new file mode 100644 index 00000000000..724830e0641 --- /dev/null +++ b/lucene/core/src/java/org/apache/lucene/internal/tests/SegmentReaderAccess.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.internal.tests; + +import org.apache.lucene.index.SegmentReader; + +/** + * Access to {@link org.apache.lucene.index.SegmentReader} internals exposed to the test framework. + * + * @lucene.internal + */ +public interface SegmentReaderAccess { + /** + * @return Returns the package-private {@code SegmentCoreReaders} associated with the segment + * reader. We don't use the actual type anywhere, so just return it as an object, without + * type. + */ + Object getCore(SegmentReader segmentReader); +} diff --git a/lucene/core/src/java/org/apache/lucene/internal/tests/TestSecrets.java b/lucene/core/src/java/org/apache/lucene/internal/tests/TestSecrets.java new file mode 100644 index 00000000000..fca41e0e604 --- /dev/null +++ b/lucene/core/src/java/org/apache/lucene/internal/tests/TestSecrets.java @@ -0,0 +1,128 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.internal.tests; + +import java.lang.StackWalker.StackFrame; +import java.util.Objects; +import java.util.function.Consumer; +import org.apache.lucene.index.ConcurrentMergeScheduler; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.SegmentReader; + +/** + * A set of static methods returning accessors for internal, package-private functionality in + * Lucene. All getters may only be called by the Lucene Test Framework module. Setters are + * initialized once on startup. + */ +public final class TestSecrets { + static { + Consumer> ensureInitialized = + clazz -> { + try { + // A no-op forName here has a side-effect of ensuring the class is loaded and + // initialized. + // This only happens once. We could just leverage the JLS and invoke a static + // method (or a constructor) on the target class but the method below seems simpler. + Class.forName(clazz.getName()); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + }; + + ensureInitialized.accept(ConcurrentMergeScheduler.class); + ensureInitialized.accept(SegmentReader.class); + ensureInitialized.accept(IndexWriter.class); + } + + private static IndexPackageAccess indexPackageAccess; + private static ConcurrentMergeSchedulerAccess cmsAccess; + private static SegmentReaderAccess segmentReaderAccess; + private static IndexWriterAccess indexWriterAccess; + + private TestSecrets() {} + + /** Return the accessor to internal secrets for an {@link IndexReader}. */ + public static IndexPackageAccess getIndexPackageAccess() { + ensureCaller(); + return Objects.requireNonNull(indexPackageAccess); + } + + /** Return the accessor to internal secrets for an {@link ConcurrentMergeScheduler}. */ + public static ConcurrentMergeSchedulerAccess getConcurrentMergeSchedulerAccess() { + ensureCaller(); + return Objects.requireNonNull(cmsAccess); + } + + /** Return the accessor to internal secrets for an {@link SegmentReader}. */ + public static SegmentReaderAccess getSegmentReaderAccess() { + ensureCaller(); + return Objects.requireNonNull(segmentReaderAccess); + } + + /** Return the accessor to internal secrets for an {@link IndexWriter}. */ + public static IndexWriterAccess getIndexWriterAccess() { + ensureCaller(); + return Objects.requireNonNull(indexWriterAccess); + } + + /** For internal initialization only. */ + public static void setIndexWriterAccess(IndexWriterAccess indexWriterAccess) { + ensureNull(TestSecrets.indexWriterAccess); + TestSecrets.indexWriterAccess = indexWriterAccess; + } + + /** For internal initialization only. */ + public static void setIndexPackageAccess(IndexPackageAccess indexPackageAccess) { + ensureNull(TestSecrets.indexPackageAccess); + TestSecrets.indexPackageAccess = indexPackageAccess; + } + + /** For internal initialization only. */ + public static void setConcurrentMergeSchedulerAccess(ConcurrentMergeSchedulerAccess cmsAccess) { + ensureNull(TestSecrets.cmsAccess); + TestSecrets.cmsAccess = cmsAccess; + } + + /** For internal initialization only. */ + public static void setSegmentReaderAccess(SegmentReaderAccess segmentReaderAccess) { + ensureNull(TestSecrets.segmentReaderAccess); + TestSecrets.segmentReaderAccess = segmentReaderAccess; + } + + private static void ensureNull(Object ob) { + if (ob != null) { + throw new AssertionError( + "The accessor is already set. It can only be called from inside Lucene Core."); + } + } + + private static void ensureCaller() { + final boolean validCaller = + StackWalker.getInstance() + .walk( + s -> + s.skip(2) + .limit(1) + .map(StackFrame::getClassName) + .allMatch(c -> c.startsWith("org.apache.lucene.tests."))); + if (!validCaller) { + throw new UnsupportedOperationException( + "Lucene TestSecrets can only be used by the test-framework."); + } + } +} diff --git a/lucene/core/src/java/org/apache/lucene/internal/tests/package-info.java b/lucene/core/src/java/org/apache/lucene/internal/tests/package-info.java new file mode 100644 index 00000000000..7a7a591f81b --- /dev/null +++ b/lucene/core/src/java/org/apache/lucene/internal/tests/package-info.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Internal bridges to package-private internals, for use by the lucene test framework only. + * + * @see org.apache.lucene.internal.tests.TestSecrets + */ +package org.apache.lucene.internal.tests; diff --git a/lucene/core/src/java/org/apache/lucene/search/FilterScorer.java b/lucene/core/src/java/org/apache/lucene/search/FilterScorer.java index 5d27cc9a473..337531dbb32 100644 --- a/lucene/core/src/java/org/apache/lucene/search/FilterScorer.java +++ b/lucene/core/src/java/org/apache/lucene/search/FilterScorer.java @@ -17,6 +17,7 @@ package org.apache.lucene.search; import java.io.IOException; +import org.apache.lucene.util.Unwrappable; /** * A {@code FilterScorer} contains another {@code Scorer}, which it uses as its basic source of @@ -25,7 +26,7 @@ import java.io.IOException; * versions that pass all requests to the contained scorer. Subclasses of {@code FilterScorer} may * further override some of these methods and may also provide additional methods and fields. */ -public abstract class FilterScorer extends Scorer { +public abstract class FilterScorer extends Scorer implements Unwrappable { protected final Scorer in; /** @@ -74,4 +75,9 @@ public abstract class FilterScorer extends Scorer { public final TwoPhaseIterator twoPhaseIterator() { return in.twoPhaseIterator(); } + + @Override + public Scorer unwrap() { + return in; + } } diff --git a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java index d771cd9ec57..c07d5e28b0f 100644 --- a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java +++ b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java @@ -137,6 +137,16 @@ public class IndexSearcher { return defaultSimilarity; } + /** + * Expert: returns leaf contexts associated with this searcher. This is an internal method exposed + * for tests only. + * + * @lucene.internal + */ + public List getLeafContexts() { + return leafContexts; + } + /** * Expert: Get the default {@link QueryCache} or {@code null} if the cache is disabled. * diff --git a/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java b/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java index 4df9239c028..43185a54f45 100644 --- a/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java +++ b/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java @@ -120,4 +120,9 @@ public abstract class FilterDirectory extends Directory { public Set getPendingDeletions() throws IOException { return in.getPendingDeletions(); } + + @Override + protected void ensureOpen() throws AlreadyClosedException { + in.ensureOpen(); + } } diff --git a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java index 656bf75ab99..d19ca3be06b 100644 --- a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java +++ b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java @@ -607,7 +607,7 @@ public final class RamUsageEstimator { *

The returned offset will be the maximum of whatever was measured so far and f * field's offset and representation size (unaligned). */ - static long adjustForField(long sizeSoFar, final Field f) { + public static long adjustForField(long sizeSoFar, final Field f) { final Class type = f.getType(); final int fsize = type.isPrimitive() ? primitiveSizes.get(type) : NUM_BYTES_OBJECT_REF; // TODO: No alignments based on field type/ subclass fields alignments? diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java index 8c0ae65eabb..3986a9c0ca1 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java @@ -624,7 +624,7 @@ public class Automaton implements Accountable, TransitionAccessor { } /** Returns sorted array of all interval start points. */ - int[] getStartPoints() { + public int[] getStartPoints() { Set pointset = new HashSet<>(); pointset.add(Character.MIN_CODE_POINT); // System.out.println("getStartPoints"); diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java b/lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java index 08bcfa657f0..0a729ba1d65 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java @@ -1223,7 +1223,7 @@ public final class Operations { } /** Reverses the automaton, returning the new initial states. */ - static Automaton reverse(Automaton a, Set initialStates) { + public static Automaton reverse(Automaton a, Set initialStates) { if (Operations.isEmpty(a)) { return new Automaton(); diff --git a/lucene/core/src/test/org/apache/lucene/TestAssertions.java b/lucene/core/src/test/org/apache/lucene/TestAssertions.java index c35a7c3dd9d..fdcbd870490 100644 --- a/lucene/core/src/test/org/apache/lucene/TestAssertions.java +++ b/lucene/core/src/test/org/apache/lucene/TestAssertions.java @@ -17,7 +17,7 @@ package org.apache.lucene; import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** validate that assertions are enabled during tests */ public class TestAssertions extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/TestDemo.java b/lucene/core/src/test/org/apache/lucene/TestDemo.java index 0a512c32574..0f64228a04c 100644 --- a/lucene/core/src/test/org/apache/lucene/TestDemo.java +++ b/lucene/core/src/test/org/apache/lucene/TestDemo.java @@ -31,8 +31,8 @@ import org.apache.lucene.index.Term; import org.apache.lucene.search.*; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; /** * A very simple demo used in the API documentation (src/java/overview.html). diff --git a/lucene/core/src/test/org/apache/lucene/TestExternalCodecs.java b/lucene/core/src/test/org/apache/lucene/TestExternalCodecs.java index bf353a55307..56067b27f9b 100644 --- a/lucene/core/src/test/org/apache/lucene/TestExternalCodecs.java +++ b/lucene/core/src/test/org/apache/lucene/TestExternalCodecs.java @@ -16,9 +16,7 @@ */ package org.apache.lucene; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -27,9 +25,11 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /* Intentionally outside of oal.index to verify fully external codecs work fine */ diff --git a/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java b/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java index cf9283ab71a..da2e062d278 100644 --- a/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java +++ b/lucene/core/src/test/org/apache/lucene/TestMergeSchedulerExternal.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.ConcurrentMergeScheduler; @@ -35,10 +34,11 @@ import org.apache.lucene.index.MergeScheduler; import org.apache.lucene.index.MergeTrigger; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.PrintStreamInfoStream; import org.junit.AfterClass; diff --git a/lucene/core/src/test/org/apache/lucene/TestSearch.java b/lucene/core/src/test/org/apache/lucene/TestSearch.java index 04aa6e39f15..727a571f9c0 100644 --- a/lucene/core/src/test/org/apache/lucene/TestSearch.java +++ b/lucene/core/src/test/org/apache/lucene/TestSearch.java @@ -26,7 +26,8 @@ import org.apache.lucene.document.*; import org.apache.lucene.index.*; import org.apache.lucene.search.*; import org.apache.lucene.store.*; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; /** JUnit adaptation of an older test case SearchTest. */ public class TestSearch extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/TestSearchForDuplicates.java b/lucene/core/src/test/org/apache/lucene/TestSearchForDuplicates.java index 6bbce716903..22ad98bf5e6 100644 --- a/lucene/core/src/test/org/apache/lucene/TestSearchForDuplicates.java +++ b/lucene/core/src/test/org/apache/lucene/TestSearchForDuplicates.java @@ -21,7 +21,6 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -41,7 +40,8 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSearchForDuplicates extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestAbstractAnalysisFactory.java b/lucene/core/src/test/org/apache/lucene/analysis/TestAbstractAnalysisFactory.java index bb9953f27da..474e76ab4af 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestAbstractAnalysisFactory.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestAbstractAnalysisFactory.java @@ -18,7 +18,7 @@ package org.apache.lucene.analysis; import org.apache.lucene.analysis.standard.StandardTokenizerFactory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestAbstractAnalysisFactory extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestAnalysisSPILoader.java b/lucene/core/src/test/org/apache/lucene/analysis/TestAnalysisSPILoader.java index 904cd415702..e6fcf460f59 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestAnalysisSPILoader.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestAnalysisSPILoader.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis; import java.util.HashMap; import java.util.Map; import org.apache.lucene.analysis.standard.StandardTokenizerFactory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Version; public class TestAnalysisSPILoader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestAnalyzerWrapper.java b/lucene/core/src/test/org/apache/lucene/analysis/TestAnalyzerWrapper.java index 051338da5ad..99f8204ec7c 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestAnalyzerWrapper.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestAnalyzerWrapper.java @@ -19,7 +19,8 @@ package org.apache.lucene.analysis; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestAnalyzerWrapper extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestAutomatonToTokenStream.java b/lucene/core/src/test/org/apache/lucene/analysis/TestAutomatonToTokenStream.java index 369856eaf89..27d2c72ddb0 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestAutomatonToTokenStream.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestAutomatonToTokenStream.java @@ -20,6 +20,7 @@ package org.apache.lucene.analysis; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.DaciukMihovAutomatonBuilder; diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java b/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java index 87cacb83927..df7574308d3 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java @@ -25,9 +25,11 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiTerms; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; public class TestCachingTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestCharArrayMap.java b/lucene/core/src/test/org/apache/lucene/analysis/TestCharArrayMap.java index 0380e5d7c74..625da794325 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestCharArrayMap.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestCharArrayMap.java @@ -17,7 +17,7 @@ package org.apache.lucene.analysis; import java.util.*; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCharArrayMap extends LuceneTestCase { public void doRandom(int iter, boolean ignoreCase) { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestCharArraySet.java b/lucene/core/src/test/org/apache/lucene/analysis/TestCharArraySet.java index 2396d6468e3..b25b4e8c5d0 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestCharArraySet.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestCharArraySet.java @@ -17,7 +17,7 @@ package org.apache.lucene.analysis; import java.util.*; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.SuppressForbidden; public class TestCharArraySet extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestCharFilter.java b/lucene/core/src/test/org/apache/lucene/analysis/TestCharFilter.java index c00f26e49b3..145d74364a1 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestCharFilter.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestCharFilter.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis; import java.io.IOException; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCharFilter extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestCharacterUtils.java b/lucene/core/src/test/org/apache/lucene/analysis/TestCharacterUtils.java index ba916b504e2..8d0dcc6ff9d 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestCharacterUtils.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestCharacterUtils.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.io.Reader; import java.io.StringReader; import org.apache.lucene.analysis.CharacterUtils.CharacterBuffer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Test; /** TestCase for the {@link CharacterUtils} class. */ diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestDelegatingAnalyzerWrapper.java b/lucene/core/src/test/org/apache/lucene/analysis/TestDelegatingAnalyzerWrapper.java index 2255d0b227c..4efbe52d765 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestDelegatingAnalyzerWrapper.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestDelegatingAnalyzerWrapper.java @@ -19,8 +19,11 @@ package org.apache.lucene.analysis; import java.io.IOException; import java.io.Reader; import java.nio.charset.StandardCharsets; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockBytesAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestDelegatingAnalyzerWrapper extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestGraphTokenFilter.java b/lucene/core/src/test/org/apache/lucene/analysis/TestGraphTokenFilter.java index 627cef9af8c..6afa522cd2c 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestGraphTokenFilter.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestGraphTokenFilter.java @@ -21,6 +21,9 @@ import java.io.IOException; import java.io.StringReader; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; public class TestGraphTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestGraphTokenizers.java b/lucene/core/src/test/org/apache/lucene/analysis/TestGraphTokenizers.java index 989759d9038..6e51a6bbb0c 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestGraphTokenizers.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestGraphTokenizers.java @@ -31,11 +31,18 @@ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockGraphTokenFilter; +import org.apache.lucene.tests.analysis.MockHoleInjectingTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.analysis.TokenStreamToDot; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.fst.Util; diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestReusableStringReader.java b/lucene/core/src/test/org/apache/lucene/analysis/TestReusableStringReader.java index 564f5aaeed0..aa376210ca0 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestReusableStringReader.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestReusableStringReader.java @@ -17,7 +17,7 @@ package org.apache.lucene.analysis; import java.nio.CharBuffer; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestReusableStringReader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestStopFilter.java b/lucene/core/src/test/org/apache/lucene/analysis/TestStopFilter.java index 13b2ea9df7b..99a16048642 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestStopFilter.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestStopFilter.java @@ -29,7 +29,9 @@ import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; -import org.apache.lucene.util.English; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.English; public class TestStopFilter extends BaseTokenStreamTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestWordlistLoader.java b/lucene/core/src/test/org/apache/lucene/analysis/TestWordlistLoader.java index 6526dd589c7..7af64c0011e 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/TestWordlistLoader.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/TestWordlistLoader.java @@ -19,7 +19,7 @@ package org.apache.lucene.analysis; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestWordlistLoader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/standard/TestStandardAnalyzer.java b/lucene/core/src/test/org/apache/lucene/analysis/standard/TestStandardAnalyzer.java index a14d31fa0f8..7befe923cee 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/standard/TestStandardAnalyzer.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/standard/TestStandardAnalyzer.java @@ -24,13 +24,15 @@ import java.util.Arrays; import java.util.List; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockGraphTokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockGraphTokenFilter; +import org.apache.lucene.tests.analysis.standard.EmojiTokenizationTestUnicode_12_1; +import org.apache.lucene.tests.analysis.standard.WordBreakTestUnicode_12_1_0; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; public class TestStandardAnalyzer extends BaseTokenStreamTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java b/lucene/core/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java index 2efd04624a5..133add81c3f 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/standard/TestStandardFactories.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.standard; import java.io.Reader; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamFactoryTestCase; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamFactoryTestCase; /** Simple tests to ensure the standard lucene factories are working. */ public class TestStandardFactories extends BaseTokenStreamFactoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestBytesRefAttImpl.java b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestBytesRefAttImpl.java index ebf20d8dc56..3e1f42762de 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestBytesRefAttImpl.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestBytesRefAttImpl.java @@ -17,9 +17,9 @@ package org.apache.lucene.analysis.tokenattributes; import java.util.stream.Stream; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.AttributeImpl; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestBytesRefAttImpl extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java index 53af58b8f68..8152b3e26f5 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestCharTermAttributeImpl.java @@ -21,10 +21,10 @@ import java.util.Formatter; import java.util.HashMap; import java.util.Locale; import java.util.regex.Pattern; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.AttributeImpl; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestCharTermAttributeImpl extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestPackedTokenAttributeImpl.java b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestPackedTokenAttributeImpl.java index 8e440962630..49b2e10c69c 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestPackedTokenAttributeImpl.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestPackedTokenAttributeImpl.java @@ -18,12 +18,12 @@ package org.apache.lucene.analysis.tokenattributes; import java.io.StringReader; import java.util.HashMap; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestPackedTokenAttributeImpl extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestSimpleAttributeImpl.java b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestSimpleAttributeImpl.java index f8832d97248..74d9726e352 100644 --- a/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestSimpleAttributeImpl.java +++ b/lucene/core/src/test/org/apache/lucene/analysis/tokenattributes/TestSimpleAttributeImpl.java @@ -18,8 +18,8 @@ package org.apache.lucene.analysis.tokenattributes; import java.util.Collections; import java.util.HashMap; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestSimpleAttributeImpl extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java b/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java index 26f00c3c2ee..ea47019de6c 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/TestCodecUtil.java @@ -29,7 +29,7 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; /** tests for codecutil methods */ diff --git a/lucene/core/src/test/org/apache/lucene/codecs/TestCompetitiveFreqNormAccumulator.java b/lucene/core/src/test/org/apache/lucene/codecs/TestCompetitiveFreqNormAccumulator.java index 26e7adeb32c..6a7e165cedd 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/TestCompetitiveFreqNormAccumulator.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/TestCompetitiveFreqNormAccumulator.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Set; import java.util.TreeSet; import org.apache.lucene.index.Impact; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCompetitiveFreqNormAccumulator extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/compressing/AbstractTestCompressionMode.java b/lucene/core/src/test/org/apache/lucene/codecs/compressing/AbstractTestCompressionMode.java index b1be46c9a8a..4c9478800a0 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/compressing/AbstractTestCompressionMode.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/compressing/AbstractTestCompressionMode.java @@ -22,10 +22,10 @@ import java.util.Arrays; import java.util.Random; import org.apache.lucene.store.ByteArrayDataInput; import org.apache.lucene.store.ByteArrayDataOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public abstract class AbstractTestCompressionMode extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestForUtil.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestForUtil.java index b1f683ba005..363226423ee 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestForUtil.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestForUtil.java @@ -24,9 +24,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; public class TestForUtil extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestIndexedDISI.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestIndexedDISI.java index 3cbff9f9679..a45f0e6d5ac 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestIndexedDISI.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestIndexedDISI.java @@ -24,12 +24,12 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.RandomAccessInput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BitSet; import org.apache.lucene.util.BitSetIterator; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.SparseFixedBitSet; -import org.apache.lucene.util.TestUtil; // Copied from the lucene70 package for separation of codec-code public class TestIndexedDISI extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90CompoundFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90CompoundFormat.java index ed78abd345e..506462f6d6b 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90CompoundFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90CompoundFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.lucene90; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseCompoundFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseCompoundFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLucene90CompoundFormat extends BaseCompoundFormatTestCase { private final Codec codec = TestUtil.getDefaultCodec(); diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90DocValuesFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90DocValuesFormat.java index 1439d0862d6..4e79ee9dfd7 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90DocValuesFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90DocValuesFormat.java @@ -27,12 +27,10 @@ import java.util.TreeSet; import java.util.function.LongSupplier; import java.util.function.Supplier; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; @@ -43,7 +41,6 @@ import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; -import org.apache.lucene.index.BaseCompressingDocValuesFormatTestCase; import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.DocValues; @@ -54,7 +51,6 @@ import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.index.SortedNumericDocValues; @@ -66,9 +62,13 @@ import org.apache.lucene.index.TermsEnum.SeekStatus; import org.apache.lucene.store.ByteBuffersDataInput; import org.apache.lucene.store.ByteBuffersDataOutput; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.index.BaseCompressingDocValuesFormatTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; -import org.apache.lucene.util.TestUtil; /** Tests Lucene90DocValuesFormat */ public class TestLucene90DocValuesFormat extends BaseCompressingDocValuesFormatTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90FieldInfosFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90FieldInfosFormat.java index 83bd56a1aaa..e723b5146c2 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90FieldInfosFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90FieldInfosFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.lucene90; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseFieldInfoFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseFieldInfoFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLucene90FieldInfosFormat extends BaseFieldInfoFormatTestCase { @Override diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90HnswVectorsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90HnswVectorsFormat.java index e13840b97db..7baca8ca540 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90HnswVectorsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90HnswVectorsFormat.java @@ -22,8 +22,8 @@ import static org.apache.lucene.codecs.lucene90.Lucene90HnswVectorsFormat.DEFAUL import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.KnnVectorsFormat; -import org.apache.lucene.index.BaseKnnVectorsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseKnnVectorsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLucene90HnswVectorsFormat extends BaseKnnVectorsFormatTestCase { @Override diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90LiveDocsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90LiveDocsFormat.java index 9575def972d..5beda0269b0 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90LiveDocsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90LiveDocsFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.lucene90; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseLiveDocsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseLiveDocsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLucene90LiveDocsFormat extends BaseLiveDocsFormatTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90NormsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90NormsFormat.java index d7023ba590b..8c9a1a28a00 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90NormsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90NormsFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.lucene90; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseNormsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseNormsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests Lucene90NormsFormat */ public class TestLucene90NormsFormat extends BaseNormsFormatTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PointsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PointsFormat.java index f7284d04271..632c396fe03 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PointsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PointsFormat.java @@ -25,20 +25,20 @@ import org.apache.lucene.codecs.PointsReader; import org.apache.lucene.codecs.PointsWriter; import org.apache.lucene.document.BinaryPoint; import org.apache.lucene.document.Document; -import org.apache.lucene.index.BasePointsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.MockRandomMergePolicy; import org.apache.lucene.index.PointValues; import org.apache.lucene.index.PointValues.IntersectVisitor; import org.apache.lucene.index.PointValues.Relation; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BasePointsFormatTestCase; +import org.apache.lucene.tests.index.MockRandomMergePolicy; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.bkd.BKDConfig; public class TestLucene90PointsFormat extends BasePointsFormatTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PostingsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PostingsFormat.java index df4aacc1b27..90a9ebe5369 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PostingsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90PostingsFormat.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.CompetitiveImpactAccumulator; import org.apache.lucene.codecs.lucene90.Lucene90ScoreSkipReader.MutableImpactList; @@ -28,7 +27,6 @@ import org.apache.lucene.codecs.lucene90.blocktree.FieldReader; import org.apache.lucene.codecs.lucene90.blocktree.Stats; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.index.BasePostingsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.Impact; import org.apache.lucene.index.IndexWriter; @@ -38,7 +36,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLucene90PostingsFormat extends BasePostingsFormatTestCase { private final Codec codec = TestUtil.alwaysPostingsFormat(new Lucene90PostingsFormat()); diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90SegmentInfoFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90SegmentInfoFormat.java index 4826b12fd06..baf266dc6ac 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90SegmentInfoFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90SegmentInfoFormat.java @@ -18,8 +18,8 @@ package org.apache.lucene.codecs.lucene90; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseSegmentInfoFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseSegmentInfoFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Version; public class TestLucene90SegmentInfoFormat extends BaseSegmentInfoFormatTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90StoredFieldsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90StoredFieldsFormat.java index e2e0ec69c6c..ad6c60ca435 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90StoredFieldsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90StoredFieldsFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.lucene90; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLucene90StoredFieldsFormat extends BaseStoredFieldsFormatTestCase { @Override diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90StoredFieldsFormatHighCompression.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90StoredFieldsFormatHighCompression.java index 14eed8eb537..a1cb543bc05 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90StoredFieldsFormatHighCompression.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90StoredFieldsFormatHighCompression.java @@ -21,11 +21,11 @@ import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.lucene90.Lucene90Codec.Mode; import org.apache.lucene.document.Document; import org.apache.lucene.document.StoredField; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; public class TestLucene90StoredFieldsFormatHighCompression extends BaseStoredFieldsFormatTestCase { @Override diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90TermVectorsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90TermVectorsFormat.java index 00bf963ab03..6660b9b6429 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90TermVectorsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90TermVectorsFormat.java @@ -17,8 +17,8 @@ package org.apache.lucene.codecs.lucene90; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseTermVectorsFormatTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseTermVectorsFormatTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLucene90TermVectorsFormat extends BaseTermVectorsFormatTestCase { @Override diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestPForUtil.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestPForUtil.java index 207adcb1e7e..a7b37030ad1 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestPForUtil.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestPForUtil.java @@ -24,9 +24,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; public class TestPForUtil extends LuceneTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingStoredFieldsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingStoredFieldsFormat.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingStoredFieldsFormat.java rename to lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingStoredFieldsFormat.java index ad1f7866539..c1096b71409 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingStoredFieldsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingStoredFieldsFormat.java @@ -19,15 +19,12 @@ package org.apache.lucene.codecs.lucene90.compressing; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.io.IOException; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.compressing.CompressingCodec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.IntPoint; import org.apache.lucene.document.StoredField; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; import org.apache.lucene.index.CodecReader; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; @@ -37,6 +34,9 @@ import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.store.ByteArrayDataInput; import org.apache.lucene.store.ByteArrayDataOutput; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.compressing.CompressingCodec; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; public class TestCompressingStoredFieldsFormat extends BaseStoredFieldsFormatTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingTermVectorsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingTermVectorsFormat.java similarity index 95% rename from lucene/test-framework/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingTermVectorsFormat.java rename to lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingTermVectorsFormat.java index 42f030a1dd8..7cc6943185b 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingTermVectorsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestCompressingTermVectorsFormat.java @@ -17,14 +17,11 @@ package org.apache.lucene.codecs.lucene90.compressing; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.compressing.CompressingCodec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; -import org.apache.lucene.index.BaseTermVectorsFormatTestCase; import org.apache.lucene.index.CodecReader; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; @@ -32,11 +29,14 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum.SeekStatus; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.compressing.CompressingCodec; +import org.apache.lucene.tests.index.BaseTermVectorsFormatTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; public class TestCompressingTermVectorsFormat extends BaseTermVectorsFormatTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestStoredFieldsInt.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestStoredFieldsInt.java index fee31356700..3578cdd713e 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestStoredFieldsInt.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/compressing/TestStoredFieldsInt.java @@ -21,8 +21,8 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestStoredFieldsInt extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldDocValuesFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldDocValuesFormat.java index 619c940da29..d33eab12546 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldDocValuesFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldDocValuesFormat.java @@ -24,18 +24,15 @@ import java.util.HashSet; import java.util.List; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.DocValuesProducer; -import org.apache.lucene.codecs.asserting.AssertingCodec; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.TextField; -import org.apache.lucene.index.BaseDocValuesFormatTestCase; import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.FieldInfo; @@ -44,7 +41,6 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.MergeState; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomCodec; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.Term; @@ -53,8 +49,12 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.index.BaseDocValuesFormatTestCase; +import org.apache.lucene.tests.index.RandomCodec; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; /** Basic tests of PerFieldDocValuesFormat */ public class TestPerFieldDocValuesFormat extends BaseDocValuesFormatTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldKnnVectorsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldKnnVectorsFormat.java index 31371a5b9fa..1181247ae1a 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldKnnVectorsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldKnnVectorsFormat.java @@ -23,16 +23,13 @@ import java.util.Collections; import java.util.HashSet; import java.util.Random; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.KnnVectorsFormat; import org.apache.lucene.codecs.KnnVectorsReader; import org.apache.lucene.codecs.KnnVectorsWriter; -import org.apache.lucene.codecs.asserting.AssertingCodec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.KnnVectorField; -import org.apache.lucene.index.BaseKnnVectorsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.IndexReader; @@ -40,13 +37,16 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomCodec; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.VectorValues; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.index.BaseKnnVectorsFormatTestCase; +import org.apache.lucene.tests.index.RandomCodec; +import org.apache.lucene.tests.util.TestUtil; import org.hamcrest.MatcherAssert; /** Basic tests of PerFieldDocValuesFormat */ diff --git a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat.java index 60ae76b0533..52f86a92410 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat.java @@ -19,8 +19,8 @@ package org.apache.lucene.codecs.perfield; import java.util.Collections; import java.util.Random; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; -import org.apache.lucene.index.RandomCodec; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.index.RandomCodec; /** Basic tests of PerFieldPostingsFormat */ public class TestPerFieldPostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat2.java b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat2.java index 9497fae1a75..b9ccab0935a 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat2.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/perfield/TestPerFieldPostingsFormat2.java @@ -22,14 +22,11 @@ import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FieldsConsumer; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.NormsProducer; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; -import org.apache.lucene.codecs.blockterms.LuceneVarGapFixedInterval; import org.apache.lucene.codecs.memory.DirectPostingsFormat; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -46,7 +43,6 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.index.LogDocMergePolicy; import org.apache.lucene.index.MergeState; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.Term; @@ -54,8 +50,12 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.codecs.blockterms.LuceneVarGapFixedInterval; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Test; /** */ diff --git a/lucene/core/src/test/org/apache/lucene/document/BaseLatLonPointTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseLatLonPointTestCase.java index d886979ec6e..938168acf1d 100644 --- a/lucene/core/src/test/org/apache/lucene/document/BaseLatLonPointTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/document/BaseLatLonPointTestCase.java @@ -20,17 +20,17 @@ import com.carrotsearch.randomizedtesting.generators.RandomPicks; import java.util.Arrays; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Circle; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.Line; import org.apache.lucene.geo.Point; import org.apache.lucene.geo.Polygon; import org.apache.lucene.geo.Rectangle; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; import org.apache.lucene.util.IOUtils; /** diff --git a/lucene/core/src/test/org/apache/lucene/document/BaseLatLonShapeTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseLatLonShapeTestCase.java index 36898a86e39..7caf03ae978 100644 --- a/lucene/core/src/test/org/apache/lucene/document/BaseLatLonShapeTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/document/BaseLatLonShapeTestCase.java @@ -20,16 +20,16 @@ import com.carrotsearch.randomizedtesting.generators.RandomPicks; import java.util.Arrays; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Circle; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.Line; import org.apache.lucene.geo.Polygon; import org.apache.lucene.geo.Rectangle; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; import org.apache.lucene.util.IOUtils; /** diff --git a/lucene/core/src/test/org/apache/lucene/document/BaseLatLonSpatialTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseLatLonSpatialTestCase.java index 483e9e35846..e93541ba386 100644 --- a/lucene/core/src/test/org/apache/lucene/document/BaseLatLonSpatialTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/document/BaseLatLonSpatialTestCase.java @@ -22,15 +22,14 @@ import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude; import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitudeCeil; import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude; import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitudeCeil; -import static org.apache.lucene.geo.GeoTestUtil.nextLatitude; -import static org.apache.lucene.geo.GeoTestUtil.nextLongitude; +import static org.apache.lucene.tests.geo.GeoTestUtil.nextLatitude; +import static org.apache.lucene.tests.geo.GeoTestUtil.nextLongitude; import com.carrotsearch.randomizedtesting.generators.RandomPicks; import java.util.Arrays; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Circle; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.GeoUtils; import org.apache.lucene.geo.LatLonGeometry; import org.apache.lucene.geo.Line; @@ -39,7 +38,8 @@ import org.apache.lucene.geo.Polygon; import org.apache.lucene.geo.Rectangle; import org.apache.lucene.geo.Tessellator; import org.apache.lucene.search.Query; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.util.TestUtil; /** Base test case for testing geospatial indexing and search functionality * */ public abstract class BaseLatLonSpatialTestCase extends BaseSpatialTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/BaseShapeEncodingTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseShapeEncodingTestCase.java index 668443cf46e..3beafb44bd9 100644 --- a/lucene/core/src/test/org/apache/lucene/document/BaseShapeEncodingTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/document/BaseShapeEncodingTestCase.java @@ -18,7 +18,7 @@ package org.apache.lucene.document; import org.apache.lucene.geo.Component2D; import org.apache.lucene.geo.GeoUtils; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** * base shape encoding class for testing encoding of tessellated {@link diff --git a/lucene/core/src/test/org/apache/lucene/document/BaseSpatialTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseSpatialTestCase.java index 2d2da74e280..d75758fe039 100644 --- a/lucene/core/src/test/org/apache/lucene/document/BaseSpatialTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/document/BaseSpatialTestCase.java @@ -42,11 +42,11 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.SimpleCollector; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** * Base test case for testing spherical and cartesian geometry indexing and search functionality diff --git a/lucene/core/src/test/org/apache/lucene/document/BaseXYShapeTestCase.java b/lucene/core/src/test/org/apache/lucene/document/BaseXYShapeTestCase.java index b6dc4b80109..dfe29753d2b 100644 --- a/lucene/core/src/test/org/apache/lucene/document/BaseXYShapeTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/document/BaseXYShapeTestCase.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.Random; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.ShapeTestUtil; import org.apache.lucene.geo.Tessellator; import org.apache.lucene.geo.XYCircle; import org.apache.lucene.geo.XYGeometry; @@ -33,7 +32,8 @@ import org.apache.lucene.geo.XYPoint; import org.apache.lucene.geo.XYPolygon; import org.apache.lucene.geo.XYRectangle; import org.apache.lucene.search.Query; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.util.TestUtil; /** Base test case for testing indexing and search functionality of cartesian geometry * */ public abstract class BaseXYShapeTestCase extends BaseSpatialTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestBinaryDocument.java b/lucene/core/src/test/org/apache/lucene/document/TestBinaryDocument.java index 6c091cca430..352626a93b3 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestBinaryDocument.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestBinaryDocument.java @@ -18,10 +18,10 @@ package org.apache.lucene.document; import java.nio.charset.StandardCharsets; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Tests {@link Document} class. */ public class TestBinaryDocument extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java index 287801a56b8..8c2c22f8b6a 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java @@ -19,7 +19,7 @@ package org.apache.lucene.document; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDateTools extends LuceneTestCase { public void testStringToDate() throws ParseException { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestDocument.java b/lucene/core/src/test/org/apache/lucene/document/TestDocument.java index f67379957b3..e30a48161e7 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestDocument.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestDocument.java @@ -19,13 +19,11 @@ package org.apache.lucene.document; import java.io.StringReader; import java.nio.charset.StandardCharsets; import java.util.List; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexableField; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.PhraseQuery; @@ -33,8 +31,10 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Tests {@link Document} class. */ public class TestDocument extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestDoubleRange.java b/lucene/core/src/test/org/apache/lucene/document/TestDoubleRange.java index f60cf711bf7..ee94abda8d7 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestDoubleRange.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestDoubleRange.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.document; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDoubleRange extends LuceneTestCase { public void testToString() { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestFeatureDoubleValues.java b/lucene/core/src/test/org/apache/lucene/document/TestFeatureDoubleValues.java index c901a24acc8..1f60acc7833 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestFeatureDoubleValues.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestFeatureDoubleValues.java @@ -20,12 +20,12 @@ import java.io.IOException; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.DoubleValues; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestFeatureDoubleValues extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestFeatureField.java b/lucene/core/src/test/org/apache/lucene/document/TestFeatureField.java index 5fea98ccaed..1f12944a981 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestFeatureField.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestFeatureField.java @@ -20,14 +20,12 @@ import java.io.IOException; import org.apache.lucene.document.Field.Store; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Scorer; import org.apache.lucene.search.TermQuery; @@ -36,7 +34,9 @@ import org.apache.lucene.search.Weight; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.search.similarities.Similarity.SimScorer; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestFeatureField extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestFeatureSort.java b/lucene/core/src/test/org/apache/lucene/document/TestFeatureSort.java index e300abc9205..ee42de7b7d5 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestFeatureSort.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestFeatureSort.java @@ -19,16 +19,16 @@ package org.apache.lucene.document; import java.io.IOException; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /* * Test for sorting using a feature from a FeatureField. diff --git a/lucene/core/src/test/org/apache/lucene/document/TestField.java b/lucene/core/src/test/org/apache/lucene/document/TestField.java index f187a069744..de57596912d 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestField.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestField.java @@ -18,17 +18,17 @@ package org.apache.lucene.document; import java.io.StringReader; import java.nio.charset.StandardCharsets; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; // sanity check some basics of fields public class TestField extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestFieldType.java b/lucene/core/src/test/org/apache/lucene/document/TestFieldType.java index 6de673b2081..4b2136dfa4b 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestFieldType.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestFieldType.java @@ -21,7 +21,7 @@ import java.lang.reflect.Method; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.PointValues; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** simple testcases for concrete impl of IndexableFieldType */ public class TestFieldType extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestFloatRange.java b/lucene/core/src/test/org/apache/lucene/document/TestFloatRange.java index 5ce4eb03ca5..bc5227f63be 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestFloatRange.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestFloatRange.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.document; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestFloatRange extends LuceneTestCase { public void testToString() { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestInetAddressPoint.java b/lucene/core/src/test/org/apache/lucene/document/TestInetAddressPoint.java index 168b35d8b65..834171a5473 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestInetAddressPoint.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestInetAddressPoint.java @@ -18,11 +18,11 @@ package org.apache.lucene.document; import java.net.InetAddress; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** Simple tests for {@link InetAddressPoint} */ public class TestInetAddressPoint extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestIntRange.java b/lucene/core/src/test/org/apache/lucene/document/TestIntRange.java index 0bf73cd81e3..167c70068a1 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestIntRange.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestIntRange.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.document; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestIntRange extends LuceneTestCase { public void testToString() { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonDocValuesField.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonDocValuesField.java index 28797854b5a..8a6711fd7d1 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonDocValuesField.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonDocValuesField.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.document; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Simple tests for LatLonDocValuesField */ public class TestLatLonDocValuesField extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonLineShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonLineShapeQueries.java index 942ac06fe83..9b96f1280ca 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonLineShapeQueries.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonLineShapeQueries.java @@ -19,8 +19,8 @@ package org.apache.lucene.document; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.Line; +import org.apache.lucene.tests.geo.GeoTestUtil; /** random bounding box, line, and polygon query tests for random generated {@link Line} types */ @SuppressWarnings("SimpleText") diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPoint.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPoint.java index 3137e6ea4c9..823046b1333 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPoint.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPoint.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.document; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Simple tests for {@link LatLonPoint} TODO: move this lone test and remove class? */ public class TestLatLonPoint extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceFeatureQuery.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceFeatureQuery.java index f5bfb9ead30..32dfe7252c9 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceFeatureQuery.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceFeatureQuery.java @@ -23,19 +23,19 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TopScoreDocCollector; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.SloppyMath; public class TestLatLonPointDistanceFeatureQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceSort.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceSort.java index 24b9a3b93ab..25e51891a60 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceSort.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceSort.java @@ -23,10 +23,8 @@ import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude; import java.io.IOException; import java.util.Arrays; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.IndexSearcher; @@ -35,9 +33,11 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.SloppyMath; -import org.apache.lucene.util.TestUtil; /** Simple tests for {@link LatLonDocValuesField#newDistanceSort} */ public class TestLatLonPointDistanceSort extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointShapeQueries.java index 1c37875ca91..76ee5e834c4 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointShapeQueries.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointShapeQueries.java @@ -19,9 +19,9 @@ package org.apache.lucene.document; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.Line; import org.apache.lucene.geo.Point; +import org.apache.lucene.tests.geo.GeoTestUtil; /** * random bounding box, line, and polygon query tests for random generated {@code latitude, diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java index 431d4a2ff5e..355b6818231 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java @@ -26,7 +26,6 @@ import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Circle; import org.apache.lucene.geo.Component2D; import org.apache.lucene.geo.GeoEncodingUtils; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.GeoUtils; import org.apache.lucene.geo.LatLonGeometry; import org.apache.lucene.geo.Line; @@ -38,15 +37,16 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Ignore; /** Test case for indexing polygons and querying by bounding box */ diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonShapeEncoding.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShapeEncoding.java index ab8973e98b7..68618b134b8 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonShapeEncoding.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShapeEncoding.java @@ -18,9 +18,9 @@ package org.apache.lucene.document; import org.apache.lucene.geo.Component2D; import org.apache.lucene.geo.GeoEncodingUtils; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.LatLonGeometry; import org.apache.lucene.geo.Polygon; +import org.apache.lucene.tests.geo.GeoTestUtil; /** Test case for LatLonShape encoding */ public class TestLatLonShapeEncoding extends BaseShapeEncodingTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLongDistanceFeatureQuery.java b/lucene/core/src/test/org/apache/lucene/document/TestLongDistanceFeatureQuery.java index 2e6db55f028..19a2da8b529 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLongDistanceFeatureQuery.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLongDistanceFeatureQuery.java @@ -21,16 +21,16 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TopScoreDocCollector; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLongDistanceFeatureQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLongRange.java b/lucene/core/src/test/org/apache/lucene/document/TestLongRange.java index 14ef9f1ddc1..2cd0e9b998d 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestLongRange.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestLongRange.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.document; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLongRange extends LuceneTestCase { public void testToString() { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestPerFieldConsistency.java b/lucene/core/src/test/org/apache/lucene/document/TestPerFieldConsistency.java index ae124500337..b4c397e65b5 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestPerFieldConsistency.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestPerFieldConsistency.java @@ -34,8 +34,8 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.VectorSimilarityFunction; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestPerFieldConsistency extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestXYLineShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYLineShapeQueries.java index 7338be27cf5..b81787d6f64 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestXYLineShapeQueries.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestXYLineShapeQueries.java @@ -20,8 +20,8 @@ import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.util.Random; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.ShapeTestUtil; import org.apache.lucene.geo.XYLine; +import org.apache.lucene.tests.geo.ShapeTestUtil; /** * random cartesian bounding box, line, and polygon query tests for random generated cartesian diff --git a/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPointShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPointShapeQueries.java index dbf5e7287ac..fdbbf826286 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPointShapeQueries.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPointShapeQueries.java @@ -20,8 +20,8 @@ import java.util.ArrayList; import java.util.List; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.ShapeTestUtil; import org.apache.lucene.geo.XYPoint; +import org.apache.lucene.tests.geo.ShapeTestUtil; /** * random cartesian bounding box, line, and polygon query tests for random indexed arrays of {@code diff --git a/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPolygonShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPolygonShapeQueries.java index 2c44bcd9667..83158c276a4 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPolygonShapeQueries.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestXYMultiPolygonShapeQueries.java @@ -21,7 +21,7 @@ import java.util.List; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Component2D; import org.apache.lucene.geo.XYPolygon; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** * random cartesian bounding box, line, and polygon query tests for random indexed arrays of diff --git a/lucene/core/src/test/org/apache/lucene/document/TestXYPointShapeQueries.java b/lucene/core/src/test/org/apache/lucene/document/TestXYPointShapeQueries.java index 519f83e2567..29e7b75dada 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestXYPointShapeQueries.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestXYPointShapeQueries.java @@ -20,9 +20,9 @@ import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.util.Random; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.ShapeTestUtil; import org.apache.lucene.geo.XYLine; import org.apache.lucene.geo.XYPoint; +import org.apache.lucene.tests.geo.ShapeTestUtil; /** * random cartesian bounding box, line, and polygon query tests for random generated {@code x, y} diff --git a/lucene/core/src/test/org/apache/lucene/document/TestXYShape.java b/lucene/core/src/test/org/apache/lucene/document/TestXYShape.java index 69521099cf2..5d3e32ceda5 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestXYShape.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestXYShape.java @@ -19,7 +19,6 @@ package org.apache.lucene.document; import java.util.Random; import org.apache.lucene.document.ShapeField.QueryRelation; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.ShapeTestUtil; import org.apache.lucene.geo.Tessellator; import org.apache.lucene.geo.XYCircle; import org.apache.lucene.geo.XYGeometry; @@ -28,14 +27,15 @@ import org.apache.lucene.geo.XYPoint; import org.apache.lucene.geo.XYPolygon; import org.apache.lucene.geo.XYRectangle; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Test case for indexing cartesian shapes and search by bounding box, lines, and polygons */ public class TestXYShape extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/document/TestXYShapeEncoding.java b/lucene/core/src/test/org/apache/lucene/document/TestXYShapeEncoding.java index ca4e4b6ca79..5b89eab2283 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestXYShapeEncoding.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestXYShapeEncoding.java @@ -17,10 +17,10 @@ package org.apache.lucene.document; import org.apache.lucene.geo.Component2D; -import org.apache.lucene.geo.ShapeTestUtil; import org.apache.lucene.geo.XYEncodingUtils; import org.apache.lucene.geo.XYGeometry; import org.apache.lucene.geo.XYPolygon; +import org.apache.lucene.tests.geo.ShapeTestUtil; /** tests XYShape encoding */ public class TestXYShapeEncoding extends BaseShapeEncodingTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestCircle.java b/lucene/core/src/test/org/apache/lucene/geo/TestCircle.java index a835e69d768..f7329338d57 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestCircle.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestCircle.java @@ -16,7 +16,8 @@ */ package org.apache.lucene.geo; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCircle extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestCircle2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestCircle2D.java index 670632b9bfa..394a3fcb3d1 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestCircle2D.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestCircle2D.java @@ -18,7 +18,9 @@ package org.apache.lucene.geo; import org.apache.lucene.index.PointValues; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCircle2D extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestGeoEncodingUtils.java b/lucene/core/src/test/org/apache/lucene/geo/TestGeoEncodingUtils.java index fc170b8333f..d654e446475 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestGeoEncodingUtils.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestGeoEncodingUtils.java @@ -28,9 +28,9 @@ import static org.apache.lucene.geo.GeoUtils.MIN_LAT_INCL; import static org.apache.lucene.geo.GeoUtils.MIN_LON_INCL; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; /** Tests methods in {@link GeoEncodingUtils} */ public class TestGeoEncodingUtils extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java b/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java index 27a76a56132..3d96108d6b6 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java @@ -18,7 +18,9 @@ package org.apache.lucene.geo; import java.util.Locale; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.EarthDebugger; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.SloppyMath; /** diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestLine2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestLine2D.java index a64ff0ae28c..46c383ace50 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestLine2D.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestLine2D.java @@ -18,7 +18,8 @@ package org.apache.lucene.geo; import org.apache.lucene.index.PointValues.Relation; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLine2D extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestPoint.java b/lucene/core/src/test/org/apache/lucene/geo/TestPoint.java index ec1861f1271..616af8b090a 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestPoint.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestPoint.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.geo; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestPoint extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestPoint2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestPoint2D.java index ef041f6204f..1413e682a8e 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestPoint2D.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestPoint2D.java @@ -18,7 +18,8 @@ package org.apache.lucene.geo; import org.apache.lucene.index.PointValues.Relation; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestPoint2D extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestPolygon.java b/lucene/core/src/test/org/apache/lucene/geo/TestPolygon.java index bdc0eaadb5c..4e6aa00940e 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestPolygon.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestPolygon.java @@ -17,7 +17,7 @@ package org.apache.lucene.geo; import java.text.ParseException; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestPolygon extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java index c39e63b3408..1660cd69dcd 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java @@ -16,16 +16,17 @@ */ package org.apache.lucene.geo; -import static org.apache.lucene.geo.GeoTestUtil.createRegularPolygon; -import static org.apache.lucene.geo.GeoTestUtil.nextLatitude; -import static org.apache.lucene.geo.GeoTestUtil.nextLongitude; -import static org.apache.lucene.geo.GeoTestUtil.nextPointNear; -import static org.apache.lucene.geo.GeoTestUtil.nextPolygon; +import static org.apache.lucene.tests.geo.GeoTestUtil.createRegularPolygon; +import static org.apache.lucene.tests.geo.GeoTestUtil.nextLatitude; +import static org.apache.lucene.tests.geo.GeoTestUtil.nextLongitude; +import static org.apache.lucene.tests.geo.GeoTestUtil.nextPointNear; +import static org.apache.lucene.tests.geo.GeoTestUtil.nextPolygon; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import org.apache.lucene.index.PointValues.Relation; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Test Polygon2D impl */ public class TestPolygon2D extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestRectangle2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestRectangle2D.java index 8299f7f0ee5..0d19d2b5027 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestRectangle2D.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestRectangle2D.java @@ -19,7 +19,8 @@ package org.apache.lucene.geo; import java.util.Random; import org.apache.lucene.index.PointValues; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestRectangle2D extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestSimpleWKTShapeParsing.java b/lucene/core/src/test/org/apache/lucene/geo/TestSimpleWKTShapeParsing.java index 83eef23f771..2e709aefa02 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestSimpleWKTShapeParsing.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestSimpleWKTShapeParsing.java @@ -17,7 +17,7 @@ package org.apache.lucene.geo; import org.apache.lucene.geo.SimpleWKTShapeParser.ShapeType; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** simple WKT parsing tests */ public class TestSimpleWKTShapeParsing extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestTessellator.java b/lucene/core/src/test/org/apache/lucene/geo/TestTessellator.java index 2c7686a95d4..7162814ada2 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestTessellator.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestTessellator.java @@ -16,11 +16,12 @@ */ package org.apache.lucene.geo; -import static org.apache.lucene.geo.GeoTestUtil.nextBoxNotCrossingDateline; +import static org.apache.lucene.tests.geo.GeoTestUtil.nextBoxNotCrossingDateline; import java.text.ParseException; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; /** Test case for the Polygon {@link Tessellator} class */ public class TestTessellator extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestXYCircle.java b/lucene/core/src/test/org/apache/lucene/geo/TestXYCircle.java index 3aee255ea2e..21aae005cbb 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestXYCircle.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestXYCircle.java @@ -16,7 +16,8 @@ */ package org.apache.lucene.geo; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestXYCircle extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestXYLine.java b/lucene/core/src/test/org/apache/lucene/geo/TestXYLine.java index 700a16c0e09..b3c7c602ec9 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestXYLine.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestXYLine.java @@ -17,7 +17,8 @@ package org.apache.lucene.geo; import java.util.Arrays; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestXYLine extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestXYPoint.java b/lucene/core/src/test/org/apache/lucene/geo/TestXYPoint.java index 6919ce62579..08794a4a59d 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestXYPoint.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestXYPoint.java @@ -16,7 +16,8 @@ */ package org.apache.lucene.geo; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestXYPoint extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestXYPolygon.java b/lucene/core/src/test/org/apache/lucene/geo/TestXYPolygon.java index ecb73040e9f..0f6f668d02a 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestXYPolygon.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestXYPolygon.java @@ -17,7 +17,8 @@ package org.apache.lucene.geo; import java.util.Arrays; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestXYPolygon extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestXYRectangle.java b/lucene/core/src/test/org/apache/lucene/geo/TestXYRectangle.java index bbb475c477b..edaecba14d9 100644 --- a/lucene/core/src/test/org/apache/lucene/geo/TestXYRectangle.java +++ b/lucene/core/src/test/org/apache/lucene/geo/TestXYRectangle.java @@ -16,8 +16,9 @@ */ package org.apache.lucene.geo; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestXYRectangle extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java b/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java index d6fd95a38a6..2faf281b3e8 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java @@ -17,20 +17,20 @@ package org.apache.lucene.index; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.ByteArrayDataInput; import org.apache.lucene.store.ByteArrayDataOutput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.TimeUnits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; -import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.TimeUnits; @SuppressCodecs({"SimpleText", "Direct"}) @TimeoutSuite(millis = 80 * TimeUnits.HOUR) // effectively no limit diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BDocs.java b/lucene/core/src/test/org/apache/lucene/index/Test2BDocs.java index c2cc19a3cb5..8c30aaa6bba 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BDocs.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BDocs.java @@ -19,19 +19,19 @@ package org.apache.lucene.index; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; import java.util.Random; import java.util.concurrent.TimeUnit; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.TimeUnits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; -import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.TimeUnits; @SuppressCodecs({"SimpleText", "Direct"}) @TimeoutSuite(millis = 80 * TimeUnits.HOUR) // effectively no limit diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java b/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java index 215b966ffed..0ee78973cf7 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java @@ -17,17 +17,17 @@ package org.apache.lucene.index; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.NumericDocValuesField; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; -import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.TimeUnits; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.TimeUnits; @SuppressCodecs({"SimpleText", "Direct"}) @TimeoutSuite(millis = 8 * TimeUnits.HOUR) diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BPoints.java b/lucene/core/src/test/org/apache/lucene/index/Test2BPoints.java index 6ed6e563969..1975b6d1188 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BPoints.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BPoints.java @@ -17,17 +17,17 @@ package org.apache.lucene.index; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.LongPoint; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; // e.g. run like this: ant test -Dtestcase=Test2BPoints -Dtests.nightly=true -Dtests.verbose=true // -Dtests.monster=true diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BPositions.java b/lucene/core/src/test/org/apache/lucene/index/Test2BPositions.java index 13b426f5f23..76867c92afa 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BPositions.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BPositions.java @@ -16,7 +16,6 @@ */ package org.apache.lucene.index; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; @@ -24,12 +23,13 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; /** * Test indexes ~82M docs with 52 positions each, so you get > Integer.MAX_VALUE positions diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java b/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java index f3f800edc30..6813d8f0f75 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java @@ -17,18 +17,18 @@ package org.apache.lucene.index; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TimeUnits; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TimeUnits; /** * Test indexes ~82M docs with 26 terms each, so you get > Integer.MAX_VALUE terms/docs pairs diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java b/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java index ff932ad0b8f..8b90b1d610b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java @@ -19,21 +19,21 @@ package org.apache.lucene.index; import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.compressing.CompressingCodec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.compressing.CompressingCodec; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; /** * Test indexes 2B docs with 65k freqs each, so you get > Integer.MAX_VALUE postings data for the diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java b/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java index daf662d7bb5..599fa2811b8 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java @@ -17,18 +17,18 @@ package org.apache.lucene.index; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.SortedDocValuesField; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.TimeUnits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; -import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.TimeUnits; @SuppressCodecs({"SimpleText", "Direct"}) @TimeoutSuite(millis = 80 * TimeUnits.HOUR) // effectively no limit diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java b/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java index a314a8bb5a4..41664442181 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java @@ -17,18 +17,18 @@ package org.apache.lucene.index; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.SortedDocValuesField; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.TimeUnits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; -import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.TimeUnits; @SuppressCodecs({"SimpleText", "Direct"}) @TimeoutSuite(millis = 80 * TimeUnits.HOUR) // effectively no limit diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java b/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java index 1a577b0582e..7d7872c7d17 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute; @@ -32,19 +31,20 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.TimeUnits; import org.apache.lucene.util.Attribute; import org.apache.lucene.util.AttributeFactory; import org.apache.lucene.util.AttributeImpl; import org.apache.lucene.util.AttributeReflector; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; -import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.TimeUnits; // NOTE: SimpleText codec will consume very large amounts of // disk (but, should run successfully). Best to run w/ diff --git a/lucene/core/src/test/org/apache/lucene/index/Test4GBStoredFields.java b/lucene/core/src/test/org/apache/lucene/index/Test4GBStoredFields.java index 6d0dea843e2..b631445e78c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/Test4GBStoredFields.java +++ b/lucene/core/src/test/org/apache/lucene/index/Test4GBStoredFields.java @@ -18,17 +18,17 @@ package org.apache.lucene.index; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.codecs.compressing.CompressingCodec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.store.MMapDirectory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.compressing.CompressingCodec; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TimeUnits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TimeUnits; /** This test creates an index with one segment that is a little larger than 4GB. */ @SuppressCodecs({"SimpleText", "Compressing"}) diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java b/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java index 86f45b9603b..45d42b86d6c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java @@ -21,11 +21,9 @@ import java.io.IOException; import java.nio.file.NoSuchFileException; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; import org.apache.lucene.codecs.memory.DirectPostingsFormat; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -40,14 +38,18 @@ import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.store.AlreadyClosedException; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.LockObtainFailedException; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.index.AllDeletedFilterReader; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestAddIndexes extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java index 1ee2961c573..18ca3e856da 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java @@ -20,18 +20,19 @@ import java.io.EOFException; import java.io.IOException; import java.util.Arrays; import java.util.Collections; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems; +import org.apache.lucene.tests.util.TestUtil; /** Test that a plain default detects broken index headers early (on opening a reader). */ @SuppressFileSystems("ExtrasFS") diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectBitFlips.java b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectBitFlips.java index ecd0657ff94..156a30b13fd 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectBitFlips.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectBitFlips.java @@ -19,18 +19,19 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Arrays; import java.util.Collections; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.CodecUtil; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.AwaitsFix; -import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems; +import org.apache.lucene.tests.util.TestUtil; /** Test that the default codec detects bit flips at open or checkIntegrity time. */ @SuppressFileSystems("ExtrasFS") diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java index 8c94f87f3b4..24d1f809d3c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java @@ -20,17 +20,18 @@ import java.io.EOFException; import java.io.IOException; import java.util.Arrays; import java.util.Collections; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.AwaitsFix; -import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems; +import org.apache.lucene.tests.util.TestUtil; /** Test that a plain default detects index file truncation early (on opening a reader). */ @SuppressFileSystems("ExtrasFS") diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesHaveChecksumFooter.java b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesHaveChecksumFooter.java index 8dceeb038ad..e937b8d7704 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesHaveChecksumFooter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesHaveChecksumFooter.java @@ -17,13 +17,14 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IndexInput; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Test that a plain default puts CRC32 footers in all files. */ public class TestAllFilesHaveChecksumFooter extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesHaveCodecHeader.java b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesHaveCodecHeader.java index 1a1f0b3c679..9c107599965 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesHaveCodecHeader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesHaveCodecHeader.java @@ -19,13 +19,14 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IndexInput; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Test that a plain default puts codec headers in all files */ public class TestAllFilesHaveCodecHeader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestApproximatePriorityQueue.java b/lucene/core/src/test/org/apache/lucene/index/TestApproximatePriorityQueue.java index ee764bc7ae3..fa6052d16e9 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestApproximatePriorityQueue.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestApproximatePriorityQueue.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.index; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestApproximatePriorityQueue extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java b/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java index f4e3a9313aa..b951a565d62 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java @@ -20,15 +20,16 @@ import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.IntPoint; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestAtomicUpdate extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java index bf346901116..25c9e57fbc5 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java @@ -22,16 +22,18 @@ import java.util.List; import java.util.Random; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CountDownLatch; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.MockRandomMergePolicy; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; /** * Simple test that adds numeric terms, where each term has the totalTermFreq of its integer value, diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java index e096cb503a2..3cb0105e35f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java @@ -23,14 +23,16 @@ import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CountDownLatch; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.MockRandomMergePolicy; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; /** * Simple test that adds numeric terms, where each term has the docFreq of its integer value, and diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java index 312f25b2291..d6d7135bd23 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java @@ -27,11 +27,7 @@ import java.util.Random; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.codecs.DocValuesFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; -import org.apache.lucene.codecs.asserting.AssertingDocValuesFormat; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -44,11 +40,16 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.store.Directory; import org.apache.lucene.store.NRTCachingDirectory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.codecs.asserting.AssertingDocValuesFormat; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestBinaryDocValuesUpdates extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBinaryTerms.java b/lucene/core/src/test/org/apache/lucene/index/TestBinaryTerms.java index e9209c022b9..93064bd7062 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestBinaryTerms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestBinaryTerms.java @@ -24,8 +24,9 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Test indexing and searching some byte[] terms */ public class TestBinaryTerms extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBufferedUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestBufferedUpdates.java index f657f888fb9..8fb59602981 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestBufferedUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestBufferedUpdates.java @@ -17,7 +17,7 @@ package org.apache.lucene.index; import org.apache.lucene.search.TermQuery; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Unit test for {@link BufferedUpdates} */ public class TestBufferedUpdates extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestByteSliceReader.java b/lucene/core/src/test/org/apache/lucene/index/TestByteSliceReader.java index b0bc2f9d54b..a49fb5afd5c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestByteSliceReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestByteSliceReader.java @@ -17,9 +17,9 @@ package org.apache.lucene.index; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ByteBlockPool; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java b/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java index c9ffbabe019..420abe06ad0 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java @@ -18,17 +18,18 @@ package org.apache.lucene.index; import java.io.ByteArrayOutputStream; import java.io.IOException; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.document.*; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.BaseTestCheckIndex; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.VectorUtil; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java b/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java index 229ceada8c2..5f1a4cc5e36 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java @@ -20,9 +20,10 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.IntPoint; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.TextField; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestCodecHoldsOpenFiles extends LuceneTestCase { public void test() throws Exception { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java b/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java index 0e467673b1c..e2ca2ea2e36 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java @@ -23,7 +23,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FieldsConsumer; import org.apache.lucene.codecs.FieldsProducer; @@ -33,12 +32,13 @@ import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java index 6ec2946bff6..95964ff814a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java @@ -29,8 +29,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; @@ -38,10 +36,13 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.SuppressingConcurrentMergeScheduler; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestConcurrentMergeScheduler extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestConsistentFieldNumbers.java b/lucene/core/src/test/org/apache/lucene/index/TestConsistentFieldNumbers.java index 8d52ed76b86..de1d4ca98a4 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestConsistentFieldNumbers.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestConsistentFieldNumbers.java @@ -17,15 +17,15 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.FailOnNonBulkMergesInfoStream; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.FailOnNonBulkMergesInfoStream; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestConsistentFieldNumbers extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCrash.java b/lucene/core/src/test/org/apache/lucene/index/TestCrash.java index be3b600e3d8..d598c530c63 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCrash.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCrash.java @@ -18,13 +18,14 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.NoLockFactory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCrash extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java b/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java index 72777918a64..5ed2149963a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java @@ -18,7 +18,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.nio.file.Path; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.IndexSearcher; @@ -29,7 +28,8 @@ import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.FilterDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCrashCausesCorruptIndex extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java b/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java index abd091a6eff..d85442986e9 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java @@ -19,7 +19,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -29,9 +28,11 @@ import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** */ public class TestCustomNorms extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCustomTermFreq.java b/lucene/core/src/test/org/apache/lucene/index/TestCustomTermFreq.java index a3429a0a138..4679cc306e7 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCustomTermFreq.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCustomTermFreq.java @@ -19,7 +19,6 @@ package org.apache.lucene.index; import static org.apache.lucene.index.PostingsEnum.NO_MORE_DOCS; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.TermFrequencyAttribute; @@ -31,8 +30,9 @@ import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestCustomTermFreq extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java index fb434dcd101..83524d4f02f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java @@ -23,7 +23,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriterConfig.OpenMode; @@ -32,8 +31,9 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Version; /* diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java index 2e1f2ebad07..03b2ecc7830 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java @@ -46,13 +46,13 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.Throttling; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.Throttling; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; // TODO: diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java index 365c008d543..89b3b42677a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Random; import java.util.Set; import java.util.TreeSet; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -39,13 +38,16 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.search.DocIdSetIterator; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; import org.junit.Assume; @@ -874,7 +876,7 @@ public class TestDirectoryReader extends LuceneTestCase { Document d = new Document(); d.add(newTextField("f", "a a b", Field.Store.NO)); writer.addDocument(d); - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); writer.close(); try { // Make sure codec impls totalTermFreq (eg PreFlex doesn't) @@ -897,7 +899,7 @@ public class TestDirectoryReader extends LuceneTestCase { d = new Document(); d.add(newTextField("f", "b", Field.Store.NO)); writer.addDocument(d); - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); writer.close(); try { // Make sure codec impls getSumDocFreq (eg PreFlex doesn't) @@ -918,7 +920,7 @@ public class TestDirectoryReader extends LuceneTestCase { d = new Document(); d.add(newTextField("f", "a", Field.Store.NO)); writer.addDocument(d); - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); writer.close(); try { // Make sure codec impls getSumDocFreq (eg PreFlex doesn't) @@ -939,7 +941,7 @@ public class TestDirectoryReader extends LuceneTestCase { d = new Document(); d.add(newTextField("f", "a a b", Field.Store.NO)); writer.addDocument(d); - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); writer.close(); try { // Make sure codec impls getSumDocFreq (eg PreFlex doesn't) @@ -963,7 +965,7 @@ public class TestDirectoryReader extends LuceneTestCase { writer.commit(); writer.addDocument(new Document()); writer.commit(); - final DirectoryReader reader = writer.getReader(); + final DirectoryReader reader = DirectoryReader.open(writer); final int[] closeCount = new int[1]; final IndexReader.ClosedListener listener = new IndexReader.ClosedListener() { @@ -994,7 +996,7 @@ public class TestDirectoryReader extends LuceneTestCase { Directory dir = newDirectory(); IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))); writer.addDocument(new Document()); - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); writer.close(); r.document(0); expectThrows( diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java index 76cf47e221e..462343f6bcf 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -39,11 +38,12 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestDirectoryReaderReopen extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDoc.java b/lucene/core/src/test/org/apache/lucene/index/TestDoc.java index ae635a3b584..90195ede06a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDoc.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDoc.java @@ -31,7 +31,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.TextField; @@ -40,11 +39,12 @@ import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.MergeInfo; -import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.TrackingDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; import org.apache.lucene.util.Version; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocCount.java b/lucene/core/src/test/org/apache/lucene/index/TestDocCount.java index 40880f3b204..6bdcd128e8d 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocCount.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocCount.java @@ -21,9 +21,10 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Tests the Terms.docCount statistic */ public class TestDocCount extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocIDMerger.java b/lucene/core/src/test/org/apache/lucene/index/TestDocIDMerger.java index 71825cd3f9d..76e1df7194c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocIDMerger.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocIDMerger.java @@ -20,9 +20,9 @@ import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; import java.util.ArrayList; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestDocIDMerger extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java b/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java index 87a005d1c92..8cb632e01a7 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocInverterPerFieldErrorInfo.java @@ -20,15 +20,15 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.PrintStreamInfoStream; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java b/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java index 5ad74eee2bb..6ac48e807ab 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocValues.java @@ -26,9 +26,9 @@ import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; /** Tests helper methods in DocValues */ public class TestDocValues extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesFieldUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesFieldUpdates.java index 98b81ccee9d..133f6ed61bf 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesFieldUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesFieldUpdates.java @@ -22,7 +22,7 @@ import java.util.Collections; import java.util.List; import org.apache.lucene.index.NumericDocValuesFieldUpdates.SingleValueNumericDocValuesFieldUpdates; import org.apache.lucene.search.DocIdSetIterator; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDocValuesFieldUpdates extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java index 1771faca801..9f8def1a864 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; @@ -33,9 +32,11 @@ import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Tests DocValues integration into IndexWriter */ public class TestDocValuesIndexing extends LuceneTestCase { @@ -177,7 +178,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { bytes[0] = 1; w.addDocument(doc); w.forceMerge(1); - DirectoryReader r = w.getReader(); + DirectoryReader r = DirectoryReader.open(w); SortedDocValues s = DocValues.getSorted(getOnlyLeafReader(r), "field"); assertEquals(0, s.nextDoc()); BytesRef bytes1 = s.lookupOrd(s.ordValue()); @@ -206,7 +207,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { doc.add(new TextField("docId", "" + i, Field.Store.YES)); writer.addDocument(doc); } - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); FieldInfos fi = FieldInfos.getMergedFieldInfos(r); FieldInfo dvInfo = fi.fieldInfo("dv"); assertTrue(dvInfo.getDocValuesType() != DocValuesType.NONE); @@ -239,7 +240,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { w.addDocument(doc); }); - IndexReader ir = w.getReader(); + IndexReader ir = DirectoryReader.open(w); assertEquals(1, ir.numDocs()); ir.close(); w.close(); @@ -262,7 +263,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { w.addDocument(doc2); }); - IndexReader ir = w.getReader(); + IndexReader ir = DirectoryReader.open(w); assertEquals(1, ir.numDocs()); ir.close(); w.close(); @@ -288,7 +289,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { iwriter.addDocument(doc); }); - IndexReader ir = iwriter.getReader(); + IndexReader ir = DirectoryReader.open(iwriter); assertEquals(1, ir.numDocs()); ir.close(); iwriter.close(); @@ -314,7 +315,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { iwriter.addDocument(doc); }); - IndexReader ir = iwriter.getReader(); + IndexReader ir = DirectoryReader.open(iwriter); assertEquals(1, ir.numDocs()); ir.close(); @@ -341,7 +342,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { iwriter.addDocument(doc); }); - IndexReader ir = iwriter.getReader(); + IndexReader ir = DirectoryReader.open(iwriter); assertEquals(1, ir.numDocs()); ir.close(); iwriter.close(); @@ -371,7 +372,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { iwriter.addDocument(hugeDoc); }); - IndexReader ir = iwriter.getReader(); + IndexReader ir = DirectoryReader.open(iwriter); assertEquals(1, ir.numDocs()); ir.close(); iwriter.close(); @@ -401,7 +402,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { iwriter.addDocument(hugeDoc); }); - IndexReader ir = iwriter.getReader(); + IndexReader ir = DirectoryReader.open(iwriter); assertEquals(1, ir.numDocs()); ir.close(); iwriter.close(); @@ -639,7 +640,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { writer.addDocument(doc2); }); - IndexReader ir = writer.getReader(); + IndexReader ir = DirectoryReader.open(writer); assertEquals(1, ir.numDocs()); ir.close(); writer.close(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocsAndPositions.java b/lucene/core/src/test/org/apache/lucene/index/TestDocsAndPositions.java index 05de14dbe5f..888b50654b3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocsAndPositions.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocsAndPositions.java @@ -19,16 +19,17 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestDocsAndPositions extends LuceneTestCase { private String fieldName; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocsWithFieldSet.java b/lucene/core/src/test/org/apache/lucene/index/TestDocsWithFieldSet.java index 650856a4200..52ec0d7ee99 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocsWithFieldSet.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocsWithFieldSet.java @@ -18,8 +18,8 @@ package org.apache.lucene.index; import java.io.IOException; import org.apache.lucene.search.DocIdSetIterator; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestDocsWithFieldSet extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java index d2051cae84f..caf830101e6 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java @@ -19,8 +19,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.function.Function; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -43,10 +41,13 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java index c0b68e45c36..4f28102bd68 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java @@ -27,8 +27,8 @@ import org.apache.lucene.index.PrefixCodedTerms.TermIterator; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.AlreadyClosedException; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRefBuilder; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.ThreadInterruptedException; /** Unit test for {@link DocumentsWriterDeleteQueue} */ diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterPerThreadPool.java b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterPerThreadPool.java index 4b3af6f9ba6..4f52c1f5854 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterPerThreadPool.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterPerThreadPool.java @@ -22,7 +22,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicLong; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Version; public class TestDocumentsWriterPerThreadPool extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java index dacaf06fe0c..c6a7b29793e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ThreadInterruptedException; /** Tests for {@link DocumentsWriterStallControl} */ diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecs.java b/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecs.java index db8abfcd83e..e9ccb4deb95 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecs.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecs.java @@ -18,19 +18,21 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomCodec; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Slow; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Slow; -import org.apache.lucene.util.TestUtil; /** Compares one codec against another */ @Slow diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecsAtNight.java b/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecsAtNight.java index c8082a85c4b..065605d7ea3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecsAtNight.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecsAtNight.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.index; -import org.apache.lucene.util.LuceneTestCase.Nightly; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; /** Just like TestDuelingCodecs, only with a lot more documents. */ @Nightly diff --git a/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java b/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java index 2236803a570..e992bb8c638 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java @@ -17,13 +17,13 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.After; import org.junit.Before; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java index 195d65edb43..84c466e4aed 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java @@ -18,7 +18,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Arrays; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.*; import org.apache.lucene.index.ExitableDirectoryReader.ExitingReaderException; import org.apache.lucene.search.DocIdSetIterator; @@ -26,8 +25,9 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** * Test that uses a default/lucene Implementation of {@link QueryTimeout} to exit out long running diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFieldInfos.java b/lucene/core/src/test/org/apache/lucene/index/TestFieldInfos.java index 48b4e81d9c2..f446613c04e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFieldInfos.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFieldInfos.java @@ -22,13 +22,13 @@ import static org.hamcrest.CoreMatchers.sameInstance; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StringField; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestFieldInfos extends LuceneTestCase { @@ -125,7 +125,7 @@ public class TestFieldInfos extends LuceneTestCase { writer.commit(); writer.forceMerge(1); - IndexReader reader = writer.getReader(); + IndexReader reader = DirectoryReader.open(writer); FieldInfos fis = FieldInfos.getMergedFieldInfos(reader); assertEquals(fis.size(), 2); Iterator it = fis.iterator(); @@ -180,7 +180,7 @@ public class TestFieldInfos extends LuceneTestCase { writer.addDocument(d2); writer.commit(); - IndexReader reader = writer.getReader(); + IndexReader reader = DirectoryReader.open(writer); FieldInfos fis = FieldInfos.getMergedFieldInfos(reader); // test that attributes for f1 are introduced by d1, @@ -203,7 +203,7 @@ public class TestFieldInfos extends LuceneTestCase { Directory dir = newDirectory(); IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))); - IndexReader reader = writer.getReader(); + IndexReader reader = DirectoryReader.open(writer); FieldInfos actual = FieldInfos.getMergedFieldInfos(reader); FieldInfos expected = FieldInfos.EMPTY; @@ -230,7 +230,7 @@ public class TestFieldInfos extends LuceneTestCase { writer.forceMerge(1); - IndexReader reader = writer.getReader(); + IndexReader reader = DirectoryReader.open(writer); FieldInfos actual = FieldInfos.getMergedFieldInfos(reader); FieldInfos expected = reader.leaves().get(0).reader().getFieldInfos(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFieldInvertState.java b/lucene/core/src/test/org/apache/lucene/index/TestFieldInvertState.java index e63837acdad..378388d86cb 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFieldInvertState.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFieldInvertState.java @@ -19,9 +19,6 @@ package org.apache.lucene.index; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -29,9 +26,12 @@ import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestFieldInvertState extends LuceneTestCase { /** Similarity holds onto the FieldInvertState for subsequent verification. */ diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFieldReuse.java b/lucene/core/src/test/org/apache/lucene/index/TestFieldReuse.java index af28507e98f..a1c8bd89f91 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFieldReuse.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFieldReuse.java @@ -20,13 +20,13 @@ import java.io.IOException; import java.io.Reader; import java.util.Collections; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; import org.apache.lucene.util.BytesRef; /** test tokenstream reuse by DefaultIndexingChain */ diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFieldUpdatesBuffer.java b/lucene/core/src/test/org/apache/lucene/index/TestFieldUpdatesBuffer.java index 181b412aa3f..f8b817d3ef4 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFieldUpdatesBuffer.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFieldUpdatesBuffer.java @@ -25,10 +25,10 @@ import java.util.Comparator; import java.util.List; import java.util.SortedMap; import java.util.TreeMap; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.Counter; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestFieldUpdatesBuffer extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java b/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java index f278a609ffd..c9744ec7581 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java @@ -21,7 +21,6 @@ import java.nio.ByteBuffer; import java.nio.file.Path; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.DocumentStoredFieldVisitor; import org.apache.lucene.document.Field; @@ -31,7 +30,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.FilterDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFilterCodecReader.java b/lucene/core/src/test/org/apache/lucene/index/TestFilterCodecReader.java index 5e0563c1024..e1416b022c6 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFilterCodecReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFilterCodecReader.java @@ -21,7 +21,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import org.apache.lucene.document.Document; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestFilterCodecReader extends LuceneTestCase { @@ -34,7 +34,7 @@ public class TestFilterCodecReader extends LuceneTestCase { try (Directory dir = newDirectory(); IndexWriter w = new IndexWriter(dir, newIndexWriterConfig())) { w.addDocument(new Document()); - try (DirectoryReader reader = w.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(w)) { FilterCodecReader r = FilterCodecReader.wrapLiveDocs( (CodecReader) reader.getSequentialSubReaders().get(0), null, 1); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFilterDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestFilterDirectoryReader.java index cc6a1f67a66..620e5d3ff9b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFilterDirectoryReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFilterDirectoryReader.java @@ -24,8 +24,8 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.lucene.document.Document; import org.apache.lucene.index.FilterDirectoryReader.SubReaderWrapper; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestFilterDirectoryReader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java b/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java index 33333dd5550..be1715279fd 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java @@ -19,15 +19,16 @@ package org.apache.lucene.index; import java.io.IOException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.DocIdSetIterator; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; public class TestFilterLeafReader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFilterMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestFilterMergePolicy.java index 5646e8ce94d..82dc43f174e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFilterMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFilterMergePolicy.java @@ -18,7 +18,7 @@ package org.apache.lucene.index; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestFilterMergePolicy extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFlex.java b/lucene/core/src/test/org/apache/lucene/index/TestFlex.java index 406751845c2..aa4f700eb3c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFlex.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFlex.java @@ -16,13 +16,13 @@ */ package org.apache.lucene.index; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestFlex extends LuceneTestCase { @@ -53,7 +53,7 @@ public class TestFlex extends LuceneTestCase { w.forceMerge(1); } - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); TermsEnum terms = MultiTerms.getTerms(r, "field3").iterator(); assertEquals(TermsEnum.SeekStatus.END, terms.seekCeil(new BytesRef("abc"))); @@ -75,7 +75,7 @@ public class TestFlex extends LuceneTestCase { doc.add(newTextField("f", "a b c", Field.Store.NO)); w.addDocument(doc); w.forceMerge(1); - DirectoryReader r = w.getReader(); + DirectoryReader r = DirectoryReader.open(w); TermsEnum terms = getOnlyLeafReader(r).terms("f").iterator(); assertTrue(terms.next() != null); try { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java index 3453895949b..7d2b7f0e151 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java @@ -20,13 +20,13 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java b/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java index 1c275135fac..7c72b3d2e76 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java @@ -16,17 +16,18 @@ */ package org.apache.lucene.index; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.TopDocs; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestForTooMuchCloning extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java b/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java index 105c6532f37..78514b2c3ed 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java @@ -19,11 +19,11 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestForceMergeForever extends LuceneTestCase { @@ -91,7 +91,7 @@ public class TestForceMergeForever extends LuceneTestCase { w.updateDocument( new Term("docid", "" + random().nextInt(numStartDocs)), docs.nextDoc()); // Force deletes to apply - w.getReader().close(); + DirectoryReader.open(w).close(); } } catch (Throwable t) { throw new RuntimeException(t); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFrozenBufferedUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestFrozenBufferedUpdates.java index 6fab043da82..178ddd37b9d 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestFrozenBufferedUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestFrozenBufferedUpdates.java @@ -30,13 +30,13 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.index.FrozenBufferedUpdates.TermDocsIterator; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefArray; import org.apache.lucene.util.BytesRefIterator; import org.apache.lucene.util.Counter; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestFrozenBufferedUpdates extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexCommit.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexCommit.java index dce8b81aafa..6ca5c161d5f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexCommit.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexCommit.java @@ -19,7 +19,7 @@ package org.apache.lucene.index; import java.util.Collection; import java.util.Map; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestIndexCommit extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java index 7c2cbb93282..01cdbbe0c17 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java @@ -20,7 +20,6 @@ import java.io.*; import java.nio.file.Path; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.simpletext.SimpleTextCodec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -30,10 +29,12 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /* Verify we can read the pre-2.1 file format, do searches diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java index 67031a0625d..3d52aa36fee 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexInput.java @@ -24,8 +24,8 @@ import org.apache.lucene.store.DataInput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexManyDocuments.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexManyDocuments.java index 423a3174a6c..75cf7154c94 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexManyDocuments.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexManyDocuments.java @@ -22,9 +22,9 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestIndexManyDocuments extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java index 8342089d10f..3dae50ba62f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexOptions.java @@ -22,8 +22,8 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestIndexOptions extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java index 736d12b50ac..186d4a3df92 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexReaderClose.java @@ -20,12 +20,14 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.AssertingLeafReader; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** */ public class TestIndexReaderClose extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java index 52c4db3a576..7f7f5117cb5 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java @@ -36,8 +36,6 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; @@ -79,12 +77,15 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TopFieldCollector; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; public class TestIndexSorting extends LuceneTestCase { static class AssertingNeedsIndexSortCodec extends FilterCodec { @@ -1733,7 +1734,7 @@ public class TestIndexSorting extends LuceneTestCase { doc.add(new NumericDocValuesField("id", i)); w.addDocument(doc); if (random().nextInt(5) == 0) { - w.getReader().close(); + DirectoryReader.open(w).close(); } else if (random().nextInt(30) == 0) { w.forceMerge(2); } else if (random().nextInt(4) == 0) { @@ -1744,7 +1745,7 @@ public class TestIndexSorting extends LuceneTestCase { } // Check that segments are sorted - DirectoryReader reader = w.getReader(); + DirectoryReader reader = DirectoryReader.open(w); for (LeafReaderContext ctx : reader.leaves()) { final SegmentReader leaf = (SegmentReader) ctx.reader(); SegmentInfo info = leaf.getSegmentInfo().info; @@ -1806,7 +1807,7 @@ public class TestIndexSorting extends LuceneTestCase { doc.add(new NumericDocValuesField("id", i)); w.addDocument(doc); if (random().nextInt(5) == 0) { - w.getReader().close(); + DirectoryReader.open(w).close(); } else if (random().nextInt(30) == 0) { w.forceMerge(2); } else if (random().nextInt(4) == 0) { @@ -1816,7 +1817,7 @@ public class TestIndexSorting extends LuceneTestCase { } } - DirectoryReader reader = w.getReader(); + DirectoryReader reader = DirectoryReader.open(w); // Now check that the index is consistent IndexSearcher searcher = newSearcher(reader); for (int i = 0; i < numDocs; ++i) { @@ -2093,7 +2094,7 @@ public class TestIndexSorting extends LuceneTestCase { } IndexWriter w2 = new IndexWriter(dir2, iwc2); w2.addDocument(new Document()); - final IndexReader reader = w2.getReader(); + final IndexReader reader = DirectoryReader.open(w2); w2.close(); IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> w.addIndexes(dir2)); @@ -2158,7 +2159,7 @@ public class TestIndexSorting extends LuceneTestCase { } else { w2.addIndexes(dir); } - final IndexReader reader2 = w2.getReader(); + final IndexReader reader2 = DirectoryReader.open(w2); final IndexSearcher searcher = newSearcher(reader); final IndexSearcher searcher2 = newSearcher(reader2); for (int i = 0; i < numDocs; ++i) { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexTooManyDocs.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexTooManyDocs.java index 91d6a918d4b..189f7507676 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexTooManyDocs.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexTooManyDocs.java @@ -25,8 +25,8 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestIndexTooManyDocs extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java index 49b537999c1..e1ae2b25899 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.index; -import static org.apache.lucene.index.DocHelper.TEXT_TYPE_STORED_WITH_TVS; +import static org.apache.lucene.tests.index.DocHelper.TEXT_TYPE_STORED_WITH_TVS; import com.carrotsearch.randomizedtesting.generators.RandomPicks; import java.io.ByteArrayOutputStream; @@ -51,11 +51,6 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Predicate; import java.util.stream.Collectors; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; @@ -75,9 +70,6 @@ import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriterConfig.OpenMode; -import org.apache.lucene.mockfile.ExtrasFS; -import org.apache.lucene.mockfile.FilterPath; -import org.apache.lucene.mockfile.WindowsFS; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; @@ -88,7 +80,6 @@ import org.apache.lucene.search.SearcherManager; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.AlreadyClosedException; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; @@ -98,20 +89,31 @@ import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.LockObtainFailedException; import org.apache.lucene.store.MMapDirectory; -import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.NIOFSDirectory; import org.apache.lucene.store.NoLockFactory; import org.apache.lucene.store.SimpleFSLockFactory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.index.SuppressingConcurrentMergeScheduler; +import org.apache.lucene.tests.mockfile.ExtrasFS; +import org.apache.lucene.tests.mockfile.FilterPath; +import org.apache.lucene.tests.mockfile.WindowsFS; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.Constants; import org.apache.lucene.util.IOSupplier; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.SetOnce; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; import org.apache.lucene.util.Version; import org.apache.lucene.util.automaton.Automata; @@ -1302,7 +1304,7 @@ public class TestIndexWriter extends LuceneTestCase { DirectoryReader r; if (iter == 0) { // use NRT - r = w.getReader(); + r = DirectoryReader.open(w); } else { // don't use NRT w.commit(); @@ -1691,18 +1693,18 @@ public class TestIndexWriter extends LuceneTestCase { Document doc = new Document(); doc.add(newStringField("id", "0", Field.Store.YES)); w.addDocument(doc); - DirectoryReader r = w.getReader(); + DirectoryReader r = DirectoryReader.open(w); long version = r.getVersion(); r.close(); w.addDocument(doc); - r = w.getReader(); + r = DirectoryReader.open(w); long version2 = r.getVersion(); r.close(); assert (version2 > version); w.deleteDocuments(new Term("id", "0")); - r = w.getReader(); + r = DirectoryReader.open(w); w.close(); long version3 = r.getVersion(); r.close(); @@ -2106,7 +2108,7 @@ public class TestIndexWriter extends LuceneTestCase { } } } - DirectoryReader reader = w.getReader(); + DirectoryReader reader = DirectoryReader.open(w); assertEquals(docCount, reader.numDocs()); List leaves = reader.leaves(); for (LeafReaderContext leafReaderContext : leaves) { @@ -2154,7 +2156,7 @@ public class TestIndexWriter extends LuceneTestCase { } } } - DirectoryReader reader = w.getReader(); + DirectoryReader reader = DirectoryReader.open(w); assertEquals(docCount, reader.numDocs()); List leaves = reader.leaves(); for (LeafReaderContext leafReaderContext : leaves) { @@ -2404,7 +2406,7 @@ public class TestIndexWriter extends LuceneTestCase { // match field a's "foo": w.deleteDocuments(new Term("a", "xxx")); w.deleteDocuments(new Term("b", "foo")); - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); w.close(); // Make sure document was not (incorrectly) deleted: @@ -2927,7 +2929,7 @@ public class TestIndexWriter extends LuceneTestCase { .setIndexDeletionPolicy(NoDeletionPolicy.INSTANCE); IndexWriter w = new IndexWriter(dir, iwc); w.commit(); - reader = w.getReader(); + reader = DirectoryReader.open(w); // we pull this commit to open it again later to check that we fail if a future file delete is // pending indexCommit = reader.getIndexCommit(); @@ -3597,7 +3599,7 @@ public class TestIndexWriter extends LuceneTestCase { } }); t.start(); - try (IndexReader reader = writer.getReader()) { + try (IndexReader reader = DirectoryReader.open(writer)) { assertEquals(1, reader.numDocs()); } ; @@ -3655,7 +3657,7 @@ public class TestIndexWriter extends LuceneTestCase { d = new Document(); d.add(new StringField("id", "doc-1", Field.Store.YES)); writer.addDocument(d); - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); SegmentCommitInfo segmentInfo = ((SegmentReader) reader.leaves().get(0).reader()).getSegmentInfo(); SegmentCommitInfo originalInfo = @@ -4271,7 +4273,7 @@ public class TestIndexWriter extends LuceneTestCase { assertEquals(6, writer.commit()); assertEquals(6, writer.getMaxCompletedSequenceNumber()); assertEquals(7, writer.addDocument(new Document())); - writer.getReader().close(); + DirectoryReader.open(writer).close(); // getReader moves seqNo by 2 since there is one DWPT that could still be in-flight assertEquals(9, writer.getMaxCompletedSequenceNumber()); } @@ -4381,7 +4383,7 @@ public class TestIndexWriter extends LuceneTestCase { new Thread( () -> { try { - writer.getReader().close(); + DirectoryReader.open(writer).close(); } catch (IOException e) { throw new AssertionError(e); } @@ -4577,7 +4579,7 @@ public class TestIndexWriter extends LuceneTestCase { w.commit(); w.updateDocument(new Term("id", "1"), d); w.commit(); - try (DirectoryReader reader = w.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(w)) { assertEquals(1, reader.numDocs()); } IOUtils.close(w, dir); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java index c18d5fc905a..1cba793c8c8 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java @@ -29,9 +29,13 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockFixedLengthPayloadFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestIndexWriterCommit extends LuceneTestCase { /* diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java index a1f78d0c7cf..7f4258d18fa 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterConfig.java @@ -21,7 +21,6 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.HashSet; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; @@ -29,8 +28,10 @@ import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; public class TestIndexWriterConfig extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java index fdf2ed700db..2115dc0cb72 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java @@ -30,8 +30,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -42,11 +40,15 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.MockRandomMergePolicy; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; import org.junit.Ignore; @SuppressCodecs("SimpleText") // too slow here @@ -449,7 +451,7 @@ public class TestIndexWriterDelete extends LuceneTestCase { } modifier.commit(); - IndexReader reader = modifier.getReader(); + IndexReader reader = DirectoryReader.open(modifier); assertEquals(7, reader.numDocs()); reader.close(); @@ -459,7 +461,7 @@ public class TestIndexWriterDelete extends LuceneTestCase { // Delete all modifier.deleteAll(); - reader = modifier.getReader(); + reader = DirectoryReader.open(modifier); assertEquals(0, reader.numDocs()); reader.close(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java index fc2aca1fae5..659c403b753 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java @@ -29,8 +29,6 @@ import java.util.Random; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.BooleanSupplier; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; @@ -51,22 +49,25 @@ import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.store.AlreadyClosedException; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FilterDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOSupplier; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; @SuppressCodecs("SimpleText") // too slow here public class TestIndexWriterExceptions extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java index 1134ac69297..217d524d5db 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions2.java @@ -21,13 +21,8 @@ import java.io.PrintStream; import java.util.Arrays; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CrankyTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.MockVariableLengthPayloadFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.asserting.AssertingCodec; -import org.apache.lucene.codecs.cranky.CrankyCodec; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -41,13 +36,18 @@ import org.apache.lucene.document.StoredField; import org.apache.lucene.document.TextField; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.CrankyTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.MockVariableLengthPayloadFilter; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.codecs.cranky.CrankyCodec; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.Rethrow; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.Rethrow; -import org.apache.lucene.util.TestUtil; /** * Causes a bunch of non-aborting and aborting exceptions and checks that no index corruption is diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java index 6851fa3b056..e1e10c9aaaf 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java @@ -19,16 +19,16 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Locale; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestIndexWriterForceMerge extends LuceneTestCase { public void testPartialMerge() throws IOException { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java index dea2358f809..aa841e05380 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java @@ -23,8 +23,8 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestIndexWriterFromReader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java index 0a2ad9f1dcf..8c96e3603fa 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java @@ -19,10 +19,10 @@ package org.apache.lucene.index; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.NoSuchFileException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; /** * This tests the patch for issue #LUCENE-715 (IndexWriter does not release its write lock when diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java index e4a54634944..23e5a2613c2 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMaxDocs.java @@ -31,12 +31,12 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TopScoreDocCollector; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FilterDirectory; -import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.NoLockFactory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.TimeUnits; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.TimeUnits; @SuppressCodecs({"SimpleText", "Direct"}) @TimeoutSuite(millis = 8 * TimeUnits.HOUR) @@ -528,7 +528,7 @@ public class TestIndexWriterMaxDocs extends LuceneTestCase { Directory dir = newDirectory(); IndexWriter w = new IndexWriter(dir, new IndexWriterConfig(null)); w.addDocument(new Document()); - w.getReader().close(); + DirectoryReader.open(w).close(); w.addDocument(new Document()); expectThrows( IllegalArgumentException.class, diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java index d5431fa8f03..1176a993f2f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java @@ -22,18 +22,20 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexWriterConfig.OpenMode; -import org.apache.lucene.mockfile.HandleLimitFS; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.MockIndexWriterEventListener; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.mockfile.HandleLimitFS; +import org.apache.lucene.tests.util.LuceneTestCase; @HandleLimitFS.MaxOpenHandles(limit = HandleLimitFS.MaxOpenHandles.MAX_OPEN_FILES * 2) // Some of these tests are too intense for SimpleText @@ -382,7 +384,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase { assertEquals(1, mergedReader.leaves().size()); mergedReader.close(); - try (IndexReader reader = writerWithMergePolicy.getReader()) { + try (IndexReader reader = DirectoryReader.open(writerWithMergePolicy)) { IndexSearcher searcher = new IndexSearcher(reader); assertEquals(6, reader.numDocs()); assertEquals(6, searcher.count(new MatchAllDocsQuery())); @@ -591,7 +593,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase { boolean success = false; try { if (useGetReader) { - writer.getReader().close(); + DirectoryReader.open(writer).close(); } else { writer.commit(); } @@ -648,7 +650,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase { Thread t = new Thread( () -> { - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { assertEquals(2, reader.maxDoc()); } catch (IOException e) { throw new AssertionError(e); @@ -694,7 +696,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase { writer.addDocument(d2); writer.flush(); mergeAndFail.set(true); - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { assertNotNull(reader); // make compiler happy and use the reader fail(); } catch (RuntimeException e) { @@ -830,7 +832,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase { } TestIndexWriter.addDoc(writerWithMergePolicy); - try (DirectoryReader mergedReader = writerWithMergePolicy.getReader()) { + try (DirectoryReader mergedReader = DirectoryReader.open(writerWithMergePolicy)) { // Doc added, do merge on getReader. assertEquals(1, mergedReader.leaves().size()); } diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java index a0237f03eb8..d302f462afd 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMerging.java @@ -19,7 +19,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Random; import java.util.concurrent.atomic.AtomicReference; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -27,7 +26,8 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestIndexWriterMerging extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java index 77ae60081f5..156a87c8eeb 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterNRTIsCurrent.java @@ -19,14 +19,14 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Random; import java.util.concurrent.CountDownLatch; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestIndexWriterNRTIsCurrent extends LuceneTestCase { @@ -90,7 +90,7 @@ public class TestIndexWriterNRTIsCurrent extends LuceneTestCase { Document doc = new Document(); doc.add(new TextField("id", "1", Field.Store.NO)); writer.addDocument(doc); - holder.reader = currentReader = writer.getReader(); + holder.reader = currentReader = DirectoryReader.open(writer); Term term = new Term("id"); for (int i = 0; i < numOps && !holder.stop; i++) { float nextOp = random.nextFloat(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java index d54f08fdcef..4001fb982ba 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java @@ -17,7 +17,6 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -32,10 +31,11 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOSupplier; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Tests for IndexWriter when the disk runs out of space */ public class TestIndexWriterOnDiskFull extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java index dd695bfe0e6..fca6b065c0c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java @@ -32,10 +32,10 @@ import java.nio.file.SimpleFileVisitor; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Constants; import org.apache.lucene.util.SuppressForbidden; -import org.apache.lucene.util.TestUtil; /** * Runs TestNRTThreads in a separate process, crashes the JRE in the middle of execution, then runs diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnVMError.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnVMError.java index 36f8c11233f..7b1a4d821a7 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnVMError.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnVMError.java @@ -22,8 +22,6 @@ import java.io.PrintStream; import java.util.Arrays; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.MockVariableLengthPayloadFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; @@ -37,14 +35,16 @@ import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.TextField; import org.apache.lucene.store.AlreadyClosedException; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.Failure; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.MockVariableLengthPayloadFilter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.Failure; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.Rethrow; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.Rethrow; -import org.apache.lucene.util.TestUtil; /** * Causes a bunch of fake VM errors and checks that no other exceptions are delivered instead, no diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java index 7a2989953e9..22b26f9cae4 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java @@ -19,14 +19,14 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.HashSet; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.PrintStreamInfoStream; -import org.apache.lucene.util.TestUtil; public class TestIndexWriterOutOfFileDescriptors extends LuceneTestCase { public void test() throws Exception { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java index fd844106a06..248890dffd5 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Random; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.LongPoint; @@ -40,14 +39,17 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.AssertingDirectoryReader; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; import org.apache.lucene.util.Version; import org.junit.Test; @@ -81,7 +83,7 @@ public class TestIndexWriterReader extends LuceneTestCase { IndexWriter writer = new IndexWriter(dir1, iwc); for (int i = 0; i < 97; i++) { - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); if (i == 0) { writer.addDocument(DocHelper.createDocument(i, "x", 1 + random().nextInt(5))); } else { @@ -107,13 +109,13 @@ public class TestIndexWriterReader extends LuceneTestCase { reader.close(); } writer.forceMerge(1); // make sure all merging is done etc. - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); writer.commit(); // no changes that are not visible to the reader // A commit is now seen as a change to an NRT reader: assertFalse(reader.isCurrent()); reader.close(); - reader = writer.getReader(); + reader = DirectoryReader.open(writer); assertTrue(reader.isCurrent()); writer.close(); @@ -150,7 +152,7 @@ public class TestIndexWriterReader extends LuceneTestCase { // writer.flush(false, true, true); // get a reader - DirectoryReader r1 = writer.getReader(); + DirectoryReader r1 = DirectoryReader.open(writer); assertTrue(r1.isCurrent()); String id10 = r1.document(10).getField("id").stringValue(); @@ -162,7 +164,7 @@ public class TestIndexWriterReader extends LuceneTestCase { assertFalse(r1.isCurrent()); System.out.println("TEST: now get reader"); - DirectoryReader r2 = writer.getReader(); + DirectoryReader r2 = DirectoryReader.open(writer); assertTrue(r2.isCurrent()); assertEquals(0, count(new Term("id", id10), r2)); if (VERBOSE) { @@ -214,7 +216,7 @@ public class TestIndexWriterReader extends LuceneTestCase { writer = new IndexWriter(dir, iwc); doc = new Document(); doc.add(newTextField("field", "a b c", Field.Store.NO)); - DirectoryReader nrtReader = writer.getReader(); + DirectoryReader nrtReader = DirectoryReader.open(writer); assertTrue(nrtReader.isCurrent()); writer.addDocument(doc); assertFalse(nrtReader.isCurrent()); // should see the changes @@ -223,7 +225,7 @@ public class TestIndexWriterReader extends LuceneTestCase { nrtReader.close(); DirectoryReader dirReader = DirectoryReader.open(dir); - nrtReader = writer.getReader(); + nrtReader = DirectoryReader.open(writer); assertTrue(dirReader.isCurrent()); assertTrue(nrtReader.isCurrent()); // nothing was committed yet so we are still current @@ -264,13 +266,13 @@ public class TestIndexWriterReader extends LuceneTestCase { createIndexNoClose(!doFullMerge, "index2", writer2); writer2.close(); - DirectoryReader r0 = writer.getReader(); + DirectoryReader r0 = DirectoryReader.open(writer); assertTrue(r0.isCurrent()); writer.addIndexes(dir2); assertFalse(r0.isCurrent()); r0.close(); - DirectoryReader r1 = writer.getReader(); + DirectoryReader r1 = DirectoryReader.open(writer); assertTrue(r1.isCurrent()); writer.commit(); @@ -319,7 +321,7 @@ public class TestIndexWriterReader extends LuceneTestCase { writer.addIndexes(dir2); writer.addIndexes(dir2); - IndexReader r1 = writer.getReader(); + IndexReader r1 = DirectoryReader.open(writer); assertEquals(500, r1.maxDoc()); r1.close(); @@ -341,13 +343,13 @@ public class TestIndexWriterReader extends LuceneTestCase { createIndexNoClose(!doFullMerge, "index1", writer); writer.flush(false, true); // get a reader - IndexReader r1 = writer.getReader(); + IndexReader r1 = DirectoryReader.open(writer); String id10 = r1.document(10).getField("id").stringValue(); // deleted IW docs should not show up in the next getReader writer.deleteDocuments(new Term("id", id10)); - IndexReader r2 = writer.getReader(); + IndexReader r2 = DirectoryReader.open(writer); assertEquals(1, count(new Term("id", id10), r1)); assertEquals(0, count(new Term("id", id10), r2)); @@ -356,13 +358,13 @@ public class TestIndexWriterReader extends LuceneTestCase { writer.deleteDocuments(new Term("id", id50)); - IndexReader r3 = writer.getReader(); + IndexReader r3 = DirectoryReader.open(writer); assertEquals(0, count(new Term("id", id10), r3)); assertEquals(0, count(new Term("id", id50), r3)); String id75 = r1.document(75).getField("id").stringValue(); writer.deleteDocuments(new TermQuery(new Term("id", id75))); - IndexReader r4 = writer.getReader(); + IndexReader r4 = DirectoryReader.open(writer); assertEquals(1, count(new Term("id", id75), r3)); assertEquals(0, count(new Term("id", id75), r4)); @@ -377,7 +379,7 @@ public class TestIndexWriterReader extends LuceneTestCase { new IndexWriter( dir1, newIndexWriterConfig(new MockAnalyzer(random())).setMaxFullFlushMergeWaitMillis(0)); - IndexReader w2r1 = writer.getReader(); + IndexReader w2r1 = DirectoryReader.open(writer); assertEquals(0, count(new Term("id", id10), w2r1)); w2r1.close(); writer.close(); @@ -554,15 +556,15 @@ public class TestIndexWriterReader extends LuceneTestCase { new IndexWriter( dir1, newIndexWriterConfig(new MockAnalyzer(random())).setMaxFullFlushMergeWaitMillis(0)); - IndexReader r1 = writer.getReader(); + IndexReader r1 = DirectoryReader.open(writer); assertEquals(0, r1.maxDoc()); createIndexNoClose(false, "index1", writer); writer.flush(!doFullMerge, true); - IndexReader iwr1 = writer.getReader(); + IndexReader iwr1 = DirectoryReader.open(writer); assertEquals(100, iwr1.maxDoc()); - IndexReader r2 = writer.getReader(); + IndexReader r2 = DirectoryReader.open(writer); assertEquals(r2.maxDoc(), 100); // add 100 documents for (int x = 10000; x < 10000 + 100; x++) { @@ -571,11 +573,11 @@ public class TestIndexWriterReader extends LuceneTestCase { } writer.flush(false, true); // verify the reader was reopened internally - IndexReader iwr2 = writer.getReader(); + IndexReader iwr2 = DirectoryReader.open(writer); assertTrue(iwr2 != r1); assertEquals(200, iwr2.maxDoc()); // should have flushed out a segment - IndexReader r3 = writer.getReader(); + IndexReader r3 = DirectoryReader.open(writer); assertTrue(r2 != r3); assertEquals(200, r3.maxDoc()); @@ -593,7 +595,7 @@ public class TestIndexWriterReader extends LuceneTestCase { new IndexWriter( dir1, newIndexWriterConfig(new MockAnalyzer(random())).setMaxFullFlushMergeWaitMillis(0)); - IndexReader w2r1 = writer.getReader(); + IndexReader w2r1 = DirectoryReader.open(writer); // insure the deletes were actually flushed to the directory assertEquals(200, w2r1.maxDoc()); w2r1.close(); @@ -655,7 +657,7 @@ public class TestIndexWriterReader extends LuceneTestCase { createIndexNoClose(false, "test", writer); // get a reader to put writer into near real-time mode - IndexReader r1 = writer.getReader(); + IndexReader r1 = DirectoryReader.open(writer); ((LogMergePolicy) writer.getConfig().getMergePolicy()).setMergeFactor(2); @@ -691,7 +693,7 @@ public class TestIndexWriterReader extends LuceneTestCase { createIndexNoClose(false, "test", writer); // get a reader to put writer into near real-time mode - DirectoryReader r1 = writer.getReader(); + DirectoryReader r1 = DirectoryReader.open(writer); TestUtil.checkIndex(dir1); writer.commit(); TestUtil.checkIndex(dir1); @@ -724,7 +726,7 @@ public class TestIndexWriterReader extends LuceneTestCase { // create the index createIndexNoClose(false, "test", writer); - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); writer.close(); TestUtil.checkIndex(dir1); @@ -765,7 +767,7 @@ public class TestIndexWriterReader extends LuceneTestCase { dirs[i] = new MockDirectoryWrapper(random(), TestUtil.ramCopyOf(dir1)); } - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); final int numIterations = 10; final List excs = Collections.synchronizedList(new ArrayList()); @@ -862,7 +864,7 @@ public class TestIndexWriterReader extends LuceneTestCase { createIndexNoClose(false, "test", writer); writer.commit(); - DirectoryReader r = writer.getReader(); + DirectoryReader r = DirectoryReader.open(writer); final int iters = TEST_NIGHTLY ? 1000 : 10; final List excs = Collections.synchronizedList(new ArrayList<>()); @@ -949,7 +951,7 @@ public class TestIndexWriterReader extends LuceneTestCase { w.addDocument(doc); w.deleteDocuments(new Term("id", "0")); - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); w.forceMergeDeletes(); w.close(); r.close(); @@ -971,17 +973,17 @@ public class TestIndexWriterReader extends LuceneTestCase { w.addDocument(doc); id.setStringValue("1"); w.addDocument(doc); - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); assertEquals(2, r.numDocs()); r.close(); w.deleteDocuments(new Term("id", "0")); - r = w.getReader(); + r = DirectoryReader.open(w); assertEquals(1, r.numDocs()); r.close(); w.deleteDocuments(new Term("id", "1")); - r = w.getReader(); + r = DirectoryReader.open(w); assertEquals(0, r.numDocs()); r.close(); @@ -993,7 +995,7 @@ public class TestIndexWriterReader extends LuceneTestCase { // Ensures that getReader works on an empty index, which hasn't been committed yet. Directory dir = newDirectory(); IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))); - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); assertEquals(0, r.numDocs()); r.close(); w.close(); @@ -1076,7 +1078,7 @@ public class TestIndexWriterReader extends LuceneTestCase { new IndexWriter( d, newIndexWriterConfig(new MockAnalyzer(random())).setMaxFullFlushMergeWaitMillis(0)); - DirectoryReader r = w.getReader(); // start pooling readers + DirectoryReader r = DirectoryReader.open(w); // start pooling readers DirectoryReader r2 = DirectoryReader.openIfChanged(r); assertNull(r2); @@ -1137,7 +1139,7 @@ public class TestIndexWriterReader extends LuceneTestCase { // create a segment and open an NRT reader writer.addDocument(new Document()); - writer.getReader().close(); + DirectoryReader.open(writer).close(); // add a new document so a new NRT reader is required writer.addDocument(new Document()); @@ -1150,7 +1152,7 @@ public class TestIndexWriterReader extends LuceneTestCase { expectThrows( FakeIOException.class, () -> { - writer.getReader().close(); + DirectoryReader.open(writer).close(); }); } @@ -1249,7 +1251,7 @@ public class TestIndexWriterReader extends LuceneTestCase { // Test1: test that leafReaders are sorted according to leafSorter provided in IndexWriterConfig { - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { assertLeavesSorted(reader, leafSorter); // add more documents that should be sorted first diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java index 81485d4547f..893c72c41e8 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterThreadsToSegments.java @@ -24,7 +24,6 @@ import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -33,10 +32,12 @@ import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; @LuceneTestCase.SuppressCodecs({"SimpleText", "Direct"}) diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterUnicode.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterUnicode.java index 5ad00086e6a..23c02715c17 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterUnicode.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterUnicode.java @@ -23,14 +23,15 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Random; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.CharsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.UnicodeUtil; public class TestIndexWriterUnicode extends LuceneTestCase { @@ -233,7 +234,7 @@ public class TestIndexWriterUnicode extends LuceneTestCase { doc = new Document(); doc.add(newTextField("field", "a", Field.Store.NO)); w.addDocument(doc); - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); assertEquals(1, r.docFreq(new Term("field", "a\uffffb"))); r.close(); w.close(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java index 44f35b2ecad..120cc6a37d2 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java @@ -24,7 +24,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -33,16 +32,19 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.AlreadyClosedException; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; import org.apache.lucene.store.LockObtainFailedException; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.index.SuppressingConcurrentMergeScheduler; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Slow; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Slow; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; /** MultiThreaded IndexWriter tests */ diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java index ed4a9f74047..1eec50555bd 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java @@ -34,9 +34,10 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestIndexableField extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java index 2d20940c934..b8feffbb407 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java @@ -33,9 +33,10 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestIndexingSequenceNumbers extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestInfoStream.java b/lucene/core/src/test/org/apache/lucene/index/TestInfoStream.java index 5eabedf939c..80681ee126b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestInfoStream.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestInfoStream.java @@ -20,8 +20,8 @@ import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.lucene.document.Document; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; /** Tests indexwriter's infostream */ public class TestInfoStream extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java b/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java index 093d31c880b..7be4ac25fd1 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIntBlockPool.java @@ -18,9 +18,9 @@ package org.apache.lucene.index; import java.util.ArrayList; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Counter; import org.apache.lucene.util.IntBlockPool; -import org.apache.lucene.util.LuceneTestCase; /** tests basic {@link IntBlockPool} functionality */ public class TestIntBlockPool extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIsCurrent.java b/lucene/core/src/test/org/apache/lucene/index/TestIsCurrent.java index 964ffe8eae3..6414492d525 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIsCurrent.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIsCurrent.java @@ -20,7 +20,8 @@ import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.*; -import org.apache.lucene.util.*; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestIsCurrent extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java b/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java index b035a2ff272..46b6b6d920b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java @@ -41,10 +41,10 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.VectorUtil; import org.apache.lucene.util.hnsw.HnswGraphBuilder; import org.junit.After; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestLazyProxSkipping.java b/lucene/core/src/test/org/apache/lucene/index/TestLazyProxSkipping.java index 9507be67f1b..61c563bdbf9 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestLazyProxSkipping.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestLazyProxSkipping.java @@ -27,10 +27,12 @@ import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Tests lazy skipping on the proximity file. */ public class TestLazyProxSkipping extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java index 7dbf49db15f..53b88f778b8 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestLogMergePolicy.java @@ -19,6 +19,7 @@ package org.apache.lucene.index; import java.io.IOException; import org.apache.lucene.index.MergePolicy.MergeSpecification; import org.apache.lucene.index.MergePolicy.OneMerge; +import org.apache.lucene.tests.index.BaseMergePolicyTestCase; public class TestLogMergePolicy extends BaseMergePolicyTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java b/lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java index 0dabd15e059..5a737e6036e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java @@ -18,7 +18,6 @@ package org.apache.lucene.index; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute; import org.apache.lucene.document.Document; @@ -27,11 +26,13 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; @SuppressCodecs({"SimpleText", "Direct"}) public class TestLongPostings extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestManyFields.java b/lucene/core/src/test/org/apache/lucene/index/TestManyFields.java index c2237bd363d..23b623c3456 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestManyFields.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestManyFields.java @@ -17,7 +17,6 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -25,7 +24,8 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; /** Test that creates way, way, way too many fields */ @LuceneTestCase.SuppressCodecs("SimpleText") diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java b/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java index ab04fbeb0b8..4a5b5d8574f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMaxPosition.java @@ -16,13 +16,13 @@ */ package org.apache.lucene.index; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.document.Document; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; // LUCENE-6382 public class TestMaxPosition extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java b/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java index 9a81c14f9c2..a0c05f19bef 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMaxTermFrequency.java @@ -20,16 +20,17 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests the maxTermFrequency statistic in FieldInvertState */ public class TestMaxTermFrequency extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestMergePolicy.java index 32b5057605a..4f455fdd5db 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMergePolicy.java @@ -26,9 +26,9 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; public class TestMergePolicy extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMergeRateLimiter.java b/lucene/core/src/test/org/apache/lucene/index/TestMergeRateLimiter.java index 5b6da6a1da2..983b51b609a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMergeRateLimiter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMergeRateLimiter.java @@ -18,7 +18,8 @@ package org.apache.lucene.index; import org.apache.lucene.document.Document; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMergeRateLimiter extends LuceneTestCase { public void testInitDefaults() throws Exception { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMixedCodecs.java b/lucene/core/src/test/org/apache/lucene/index/TestMixedCodecs.java index 07d667a1109..382cfb6bd6e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMixedCodecs.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMixedCodecs.java @@ -18,13 +18,14 @@ package org.apache.lucene.index; import java.util.HashSet; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestMixedCodecs extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMixedDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestMixedDocValuesUpdates.java index d5e08268480..6e284e734a9 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMixedDocValuesUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMixedDocValuesUpdates.java @@ -27,7 +27,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReentrantLock; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -41,11 +40,12 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestMixedDocValuesUpdates extends LuceneTestCase { @@ -469,7 +469,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase { writer, new NumericDocValuesField("numericId", doc + 1), new BinaryDocValuesField("binaryId", new BytesRef(new byte[] {(byte) (doc + 1)}))); - IndexReader reader = writer.getReader(); + IndexReader reader = DirectoryReader.open(writer); NumericDocValues numericIdValues = null; BinaryDocValues binaryIdValues = null; for (LeafReaderContext c : reader.leaves()) { @@ -556,7 +556,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase { for (Thread t : threads) { t.join(); } - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { for (int i = 0; i < locks.length; i++) { locks[i].lock(); try { @@ -588,7 +588,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase { static void doUpdate(Term doc, IndexWriter writer, Field... fields) throws IOException { long seqId = -1; do { // retry if we just committing a merge - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { TopDocs topDocs = new IndexSearcher(reader).search(new TermQuery(doc), 10); assertEquals(1, topDocs.totalHits.value); int theDoc = topDocs.scoreDocs[0].doc; @@ -610,7 +610,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase { if (random().nextBoolean()) { writer.commit(); } - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { assertEquals(1, reader.leaves().size()); LeafReader r = reader.leaves().get(0).reader(); NumericDocValues ndv = r.getNumericDocValues("val"); @@ -625,7 +625,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase { } writer.updateDocValues(new Term("id", "0"), new BinaryDocValuesField("val-bin", null)); - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { assertEquals(1, reader.leaves().size()); LeafReader r = reader.leaves().get(0).reader(); NumericDocValues ndv = r.getNumericDocValues("val"); @@ -671,7 +671,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase { numHits++; } } - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { IndexSearcher searcher = new IndexSearcher(reader); TopDocs is_live = searcher.search(new DocValuesFieldExistsQuery("is_live"), 5); @@ -733,7 +733,7 @@ public class TestMixedDocValuesUpdates extends LuceneTestCase { doc.add(new StringField("id", "1", Store.YES)); writer.addDocument(doc); if (random().nextBoolean()) { - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { NumericDocValues id = reader.leaves().get(0).reader().getNumericDocValues("id"); assertNull(id); } diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java b/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java index 0cbde112e13..018d7592bf1 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java @@ -29,9 +29,10 @@ import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Tests MultiDocValues versus ordinary segment merging */ public class TestMultiDocValues extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMultiFields.java b/lucene/core/src/test/org/apache/lucene/index/TestMultiFields.java index c63587f2812..3a4a901dc4f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMultiFields.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMultiFields.java @@ -23,16 +23,16 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOSupplier; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; public class TestMultiFields extends LuceneTestCase { @@ -126,7 +126,7 @@ public class TestMultiFields extends LuceneTestCase { } } - IndexReader reader = w.getReader(); + IndexReader reader = DirectoryReader.open(w); w.close(); if (VERBOSE) { System.out.println("TEST: reader=" + reader); @@ -182,7 +182,7 @@ public class TestMultiFields extends LuceneTestCase { w.addDocument(d); w.commit(); w.addDocument(d); - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); w.close(); PostingsEnum d1 = TestUtil.docs(random(), r, "f", new BytesRef("j"), null, PostingsEnum.NONE); PostingsEnum d2 = TestUtil.docs(random(), r, "f", new BytesRef("j"), null, PostingsEnum.NONE); @@ -200,7 +200,7 @@ public class TestMultiFields extends LuceneTestCase { w.addDocument(d); w.commit(); w.addDocument(d); - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); w.close(); PostingsEnum de = MultiTerms.getTermPostingsEnum(r, "f", new BytesRef("j"), (int) PostingsEnum.FREQS); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java b/lucene/core/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java index cde8e282bf1..ea948c7b33e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java @@ -26,10 +26,11 @@ import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Before; /** diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMultiTermsEnum.java b/lucene/core/src/test/org/apache/lucene/index/TestMultiTermsEnum.java index 534e362e0bf..0f35bda4e59 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestMultiTermsEnum.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestMultiTermsEnum.java @@ -19,16 +19,16 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Iterator; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestMultiTermsEnum extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java index dae36821d5a..eea2864e66b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java @@ -17,14 +17,15 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems; import org.apache.lucene.util.Constants; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems; /** LUCENE-5574 */ @SuppressFileSystems("WindowsFS") // the bug doesn't happen on windows. diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java index 490576531d5..20720363055 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java @@ -18,11 +18,12 @@ package org.apache.lucene.index; import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestNRTReaderWithThreads extends LuceneTestCase { AtomicInteger seq = new AtomicInteger(1); @@ -39,7 +40,7 @@ public class TestNRTReaderWithThreads extends LuceneTestCase { newIndexWriterConfig(new MockAnalyzer(random())) .setMaxBufferedDocs(10) .setMergePolicy(newLogMergePolicy(false, 2)))); - IndexReader reader = writer.getReader(); // start pooling readers + IndexReader reader = DirectoryReader.open(writer); // start pooling readers reader.close(); int numThreads = TEST_NIGHTLY ? 4 : 2; int numIterations = TEST_NIGHTLY ? 2000 : 50; @@ -93,7 +94,7 @@ public class TestNRTReaderWithThreads extends LuceneTestCase { } else if (type == 1) { // we may or may not delete because the term may not exist, // however we're opening and closing the reader rapidly - IndexReader reader = writer.getReader(); + IndexReader reader = DirectoryReader.open(writer); int id = r.nextInt(seq.intValue()); Term term = new Term("id", Integer.toString(id)); int count = TestIndexWriterReader.count(term, reader); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNRTThreads.java b/lucene/core/src/test/org/apache/lucene/index/TestNRTThreads.java index d54728fdb37..86278809283 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNRTThreads.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNRTThreads.java @@ -20,8 +20,9 @@ import java.util.Set; import java.util.concurrent.ExecutorService; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.index.ThreadedIndexingAndSearchingTestCase; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; import org.junit.Before; // TODO @@ -111,7 +112,7 @@ public class TestNRTThreads extends ThreadedIndexingAndSearchingTestCase { // Force writer to do reader pooling, always, so that // all merged segments, even for merges before // doSearching is called, are warmed: - writer.getReader().close(); + DirectoryReader.open(writer).close(); } private IndexSearcher fixedSearcher; @@ -134,13 +135,13 @@ public class TestNRTThreads extends ThreadedIndexingAndSearchingTestCase { final IndexReader r2; if (useNonNrtReaders) { if (random().nextBoolean()) { - r2 = writer.getReader(); + r2 = DirectoryReader.open(writer); } else { writer.commit(); r2 = DirectoryReader.open(dir); } } else { - r2 = writer.getReader(); + r2 = DirectoryReader.open(writer); } return newSearcher(r2); } diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java b/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java index c87195c5470..5461b78061b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java @@ -19,12 +19,13 @@ package org.apache.lucene.index; import java.nio.file.Path; import java.util.HashSet; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; // Make sure if you use NoDeletionPolicy that no file // referenced by a commit point is ever deleted diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNewestSegment.java b/lucene/core/src/test/org/apache/lucene/index/TestNewestSegment.java index b47374c30a0..36534daeac3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNewestSegment.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNewestSegment.java @@ -16,9 +16,9 @@ */ package org.apache.lucene.index; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestNewestSegment extends LuceneTestCase { public void testNewestSegment() throws Exception { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNoDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestNoDeletionPolicy.java index 6621365dd90..0a349e8d952 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNoDeletionPolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNoDeletionPolicy.java @@ -20,11 +20,11 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestNoDeletionPolicy extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java index 81b1a61c87d..360426e2941 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNoMergePolicy.java @@ -22,6 +22,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; import org.apache.lucene.index.MergePolicy.MergeSpecification; +import org.apache.lucene.tests.index.BaseMergePolicyTestCase; import org.junit.Test; public class TestNoMergePolicy extends BaseMergePolicyTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNoMergeScheduler.java b/lucene/core/src/test/org/apache/lucene/index/TestNoMergeScheduler.java index eb96051a915..3b1bf3549c5 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNoMergeScheduler.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNoMergeScheduler.java @@ -21,7 +21,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestNoMergeScheduler extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNorms.java b/lucene/core/src/test/org/apache/lucene/index/TestNorms.java index 29ad25d30f4..6fdb906979e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNorms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNorms.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.Random; import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; @@ -31,8 +30,10 @@ import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** * Test that norms info is preserved during index life - including separate norms, addDocument, diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java index 332330a36af..cbd0338c8e1 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java @@ -27,11 +27,7 @@ import java.util.Random; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.codecs.DocValuesFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; -import org.apache.lucene.codecs.asserting.AssertingDocValuesFormat; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -49,11 +45,16 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopFieldDocs; import org.apache.lucene.store.Directory; import org.apache.lucene.store.NRTCachingDirectory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.codecs.asserting.AssertingDocValuesFormat; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; @SuppressWarnings("resource") public class TestNumericDocValuesUpdates extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOmitNorms.java b/lucene/core/src/test/org/apache/lucene/index/TestOmitNorms.java index f0b5583d178..1d088ca7dd3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestOmitNorms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestOmitNorms.java @@ -17,13 +17,13 @@ package org.apache.lucene.index; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestOmitNorms extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java b/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java index 7052280eda4..46bf5adc8dc 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java @@ -17,16 +17,17 @@ package org.apache.lucene.index; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** @lucene.experimental */ public class TestOmitPositions extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java index 2549396fe5b..272a6ee46f9 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java @@ -18,7 +18,6 @@ package org.apache.lucene.index; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -36,8 +35,10 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.similarities.TFIDFSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestOmitTf extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOneMergeWrappingMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestOneMergeWrappingMergePolicy.java index 55b1129903d..94398c51a72 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestOneMergeWrappingMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestOneMergeWrappingMergePolicy.java @@ -23,9 +23,9 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOrdinalMap.java b/lucene/core/src/test/org/apache/lucene/index/TestOrdinalMap.java index 61ba3a6980b..faa2aae329f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestOrdinalMap.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestOrdinalMap.java @@ -19,16 +19,17 @@ package org.apache.lucene.index; import java.io.IOException; import java.lang.reflect.Field; import java.util.HashMap; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.RamUsageTester; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.LongValues; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.RamUsageTester; -import org.apache.lucene.util.TestUtil; public class TestOrdinalMap extends LuceneTestCase { @@ -134,7 +135,7 @@ public class TestOrdinalMap extends LuceneTestCase { } iw.commit(); - DirectoryReader r = iw.getReader(); + DirectoryReader r = DirectoryReader.open(iw); SortedDocValues sdv = MultiDocValues.getSortedValues(r, "sdv"); assertNotNull(sdv); assertTrue(sdv instanceof MultiDocValues.MultiSortedDocValues); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java b/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java index 2a987d11fd3..c4f90c4bb7b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestParallelCompositeReader.java @@ -18,7 +18,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.BooleanClause.Occur; @@ -29,7 +28,8 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestParallelCompositeReader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java b/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java index 8c0e04c1d80..ca6f26c78fd 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestParallelLeafReader.java @@ -18,7 +18,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -26,9 +25,10 @@ import org.apache.lucene.search.*; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestParallelLeafReader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java b/lucene/core/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java index 36d4a8159ad..d918b9c3ffd 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java @@ -19,14 +19,14 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; /** Some tests for {@link ParallelLeafReader}s with empty indexes */ public class TestParallelReaderEmptyIndex extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java b/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java index 85176575ce7..4a19dfb100e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java @@ -17,14 +17,14 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestParallelTermEnum extends LuceneTestCase { private LeafReader ir1; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPayloads.java b/lucene/core/src/test/org/apache/lucene/index/TestPayloads.java index 80ff34536d4..4174b77827b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPayloads.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPayloads.java @@ -25,10 +25,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -40,9 +36,14 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestPayloads extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java b/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java index ae891ef29a3..53716f73296 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPayloadsOnVectors.java @@ -17,10 +17,6 @@ package org.apache.lucene.index; import java.io.StringReader; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; @@ -29,8 +25,13 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestPayloadsOnVectors extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPendingDeletes.java b/lucene/core/src/test/org/apache/lucene/index/TestPendingDeletes.java index 852a7bb868f..5cba67078f7 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPendingDeletes.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPendingDeletes.java @@ -24,10 +24,10 @@ import org.apache.lucene.codecs.Codec; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; public class TestPendingDeletes extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPendingSoftDeletes.java b/lucene/core/src/test/org/apache/lucene/index/TestPendingSoftDeletes.java index ecd3795dcef..14b6d4cdfa7 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPendingSoftDeletes.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPendingSoftDeletes.java @@ -174,7 +174,7 @@ public class TestPendingSoftDeletes extends TestPendingDeletes { } writer.forceMerge(1); writer.commit(); - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); assertEquals(1, reader.leaves().size()); SegmentReader segmentReader = (SegmentReader) reader.leaves().get(0).reader(); PendingSoftDeletes deletes = newPendingDeletes(commitInfo); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java b/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java index 963279fa554..c6f79f5ecaa 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java @@ -19,16 +19,17 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Map; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestPerSegmentDeletes extends LuceneTestCase { public void testDeletes1() throws Exception { @@ -74,7 +75,7 @@ public class TestPerSegmentDeletes extends LuceneTestCase { // get reader flushes pending deletes // so there should not be anymore - IndexReader r1 = writer.getReader(); + IndexReader r1 = DirectoryReader.open(writer); assertFalse(writer.hasChangesInRam()); r1.close(); @@ -93,7 +94,7 @@ public class TestPerSegmentDeletes extends LuceneTestCase { // id:2 shouldn't exist anymore because // it's been applied in the merge and now it's gone - IndexReader r2 = writer.getReader(); + IndexReader r2 = DirectoryReader.open(writer); int[] id2docs = toDocsArray(new Term("id", "2"), null, r2); assertTrue(id2docs == null); r2.close(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java index 17814d88560..fdbd2b16632 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java @@ -20,7 +20,7 @@ import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java b/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java index 3af9215be6b..334db5dccc2 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPointValues.java @@ -18,7 +18,6 @@ package org.apache.lucene.index; import java.io.ByteArrayOutputStream; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.BinaryPoint; import org.apache.lucene.document.Document; @@ -34,9 +33,11 @@ import org.apache.lucene.index.PointValues.Relation; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Test Indexing/IndexWriter with points */ public class TestPointValues extends LuceneTestCase { @@ -644,7 +645,7 @@ public class TestPointValues extends LuceneTestCase { w.deleteDocuments(new Term("id", "0")); w.forceMerge(1); - DirectoryReader r = w.getReader(); + DirectoryReader r = DirectoryReader.open(w); assertNull(r.leaves().get(0).reader().getPointValues("int")); w.close(); r.close(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java index f38168762d5..8bb77fcb698 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java @@ -22,11 +22,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockPayloadAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -36,11 +31,17 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockPayloadAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.English; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; // TODO: we really need to test indexingoffsets, but then getting only docs / docs + freqs. // not all codecs store prx separate... diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java index ff545317402..4ac262216a3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java @@ -20,8 +20,8 @@ import java.util.Iterator; import java.util.Set; import java.util.TreeSet; import org.apache.lucene.index.PrefixCodedTerms.TermIterator; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestPrefixCodedTerms extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestReadOnlyIndex.java b/lucene/core/src/test/org/apache/lucene/index/TestReadOnlyIndex.java index 3a1a4430058..d2be8c176c5 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestReadOnlyIndex.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestReadOnlyIndex.java @@ -21,7 +21,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.PropertyPermission; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.IndexSearcher; @@ -31,7 +30,9 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestReaderClosed.java b/lucene/core/src/test/org/apache/lucene/index/TestReaderClosed.java index b3811281153..ac23b9b5287 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestReaderClosed.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestReaderClosed.java @@ -17,16 +17,18 @@ package org.apache.lucene.index; import java.util.concurrent.RejectedExecutionException; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.OwnCacheKeyMultiReader; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestReaderClosed extends LuceneTestCase { private DirectoryReader reader; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestReaderPool.java b/lucene/core/src/test/org/apache/lucene/index/TestReaderPool.java index 6d9901ee72e..338cf0fb2b2 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestReaderPool.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestReaderPool.java @@ -30,11 +30,11 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.NullInfoStream; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOSupplier; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.NullInfoStream; public class TestReaderPool extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestReaderWrapperDVTypeCheck.java b/lucene/core/src/test/org/apache/lucene/index/TestReaderWrapperDVTypeCheck.java index 55f3236c60c..7ec0083b9e1 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestReaderWrapperDVTypeCheck.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestReaderWrapperDVTypeCheck.java @@ -18,15 +18,16 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestReaderWrapperDVTypeCheck extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestRollback.java b/lucene/core/src/test/org/apache/lucene/index/TestRollback.java index 5a30500996b..b7a04c24740 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestRollback.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestRollback.java @@ -16,11 +16,12 @@ */ package org.apache.lucene.index; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestRollback extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java index 5e005a9d21d..c16ef947f68 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java @@ -17,7 +17,6 @@ package org.apache.lucene.index; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.memory.DirectPostingsFormat; import org.apache.lucene.document.*; @@ -25,6 +24,11 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.*; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.*; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java b/lucene/core/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java index d888cf5ec98..893a282051a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java @@ -24,7 +24,8 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.document.Document; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSameTokenSamePosition extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentInfos.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentInfos.java index f090f89b9ac..87369a770a4 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentInfos.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentInfos.java @@ -23,16 +23,16 @@ import java.util.HashMap; import java.util.Map; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.CodecUtil; -import org.apache.lucene.mockfile.ExtrasFS; import org.apache.lucene.search.Sort; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.mockfile.ExtrasFS; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; public class TestSegmentInfos extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java index 1d175f3c10c..63b697da2c9 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java @@ -26,12 +26,13 @@ import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.MergeInfo; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; import org.apache.lucene.util.packed.PackedLongValues; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java index 55bc6928db3..da8abbaf5c0 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java @@ -24,9 +24,10 @@ import org.apache.lucene.document.Document; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; public class TestSegmentReader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java index d98d22d0c8b..5d5ddf6bec2 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java @@ -17,14 +17,15 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; public class TestSegmentTermDocs extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermEnum.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermEnum.java index 3a45377b301..18e2ee598a1 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermEnum.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermEnum.java @@ -17,14 +17,14 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestSegmentTermEnum extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSegmentToThreadMapping.java b/lucene/core/src/test/org/apache/lucene/index/TestSegmentToThreadMapping.java index 1ca823bd055..564c70bdb41 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSegmentToThreadMapping.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSegmentToThreadMapping.java @@ -30,9 +30,10 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; import org.apache.lucene.util.Version; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java b/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java index b4403a54da1..fbf1f8533f9 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSizeBoundedForceMerge.java @@ -22,7 +22,7 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSizeBoundedForceMerge extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java index 06a60f68ae1..9635bdcda81 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java @@ -22,13 +22,13 @@ import java.util.Collection; import java.util.List; import java.util.Random; import java.util.concurrent.CountDownLatch; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IndexInput; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ThreadInterruptedException; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSoftDeletesDirectoryReaderWrapper.java b/lucene/core/src/test/org/apache/lucene/index/TestSoftDeletesDirectoryReaderWrapper.java index 4b587a5eb52..d1adaeb0e9b 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSoftDeletesDirectoryReaderWrapper.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSoftDeletesDirectoryReaderWrapper.java @@ -29,8 +29,8 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestSoftDeletesDirectoryReaderWrapper extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSoftDeletesRetentionMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestSoftDeletesRetentionMergePolicy.java index 21b34f81c95..2418a42a9a8 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSoftDeletesRetentionMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSoftDeletesRetentionMergePolicy.java @@ -46,9 +46,9 @@ import org.apache.lucene.search.SearcherManager; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { @@ -73,7 +73,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { doc.add(new StringField("id", "2", Field.Store.YES)); doc.add(new NumericDocValuesField("soft_delete", 1)); writer.addDocument(doc); - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); { assertEquals(2, reader.leaves().size()); final SegmentReader segmentReader = (SegmentReader) reader.leaves().get(0).reader(); @@ -89,7 +89,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { writer.forceMerge(1); reader.close(); } - reader = writer.getReader(); + reader = DirectoryReader.open(writer); { assertEquals(1, reader.leaves().size()); SegmentReader segmentReader = (SegmentReader) reader.leaves().get(0).reader(); @@ -122,7 +122,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { doc.add(new StringField("id", "1", Field.Store.YES)); doc.add(new NumericDocValuesField("soft_delete", 1)); writer.addDocument(doc); - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); assertEquals(1, reader.leaves().size()); MergePolicy policy = new SoftDeletesRetentionMergePolicy( @@ -139,7 +139,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { doc.add(new NumericDocValuesField("soft_delete", 1)); writer.addDocument(doc); - DirectoryReader reader1 = writer.getReader(); + DirectoryReader reader1 = DirectoryReader.open(writer); assertEquals(2, reader1.leaves().size()); assertFalse( policy.keepFullyDeletedSegment(() -> (SegmentReader) reader1.leaves().get(0).reader())); @@ -218,7 +218,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { writer.flush(); } writer.forceMerge(1); - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); assertEquals(1, reader.numDocs()); assertEquals(3, reader.maxDoc()); Set versions = new HashSet<>(); @@ -258,7 +258,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { writer.softUpdateDocument( new Term("id", "1"), doc, new NumericDocValuesField("soft_delete", 1)); writer.commit(); - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); assertEquals(0, reader.numDocs()); assertEquals(3, reader.maxDoc()); assertEquals(0, writer.getDocStats().numDocs); @@ -266,7 +266,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { assertEquals(3, reader.leaves().size()); reader.close(); writer.forceMerge(1); - reader = writer.getReader(); + reader = DirectoryReader.open(writer); assertEquals(0, reader.numDocs()); assertEquals(3, reader.maxDoc()); assertEquals(0, writer.getDocStats().numDocs); @@ -479,7 +479,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { writer.deleteDocuments(new Term("id", "1")); } writer.commit(); - IndexReader reader = writer.getReader(); + IndexReader reader = DirectoryReader.open(writer); assertEquals(reader.numDocs(), 1); reader.close(); assertEquals(1, writer.cloneSegmentInfos().size()); @@ -567,7 +567,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { } writer.flush(); - DirectoryReader reader = writer.getReader(); + DirectoryReader reader = DirectoryReader.open(writer); writer.softUpdateDocument( new Term("id", "0"), new Document(), new NumericDocValuesField(softDelete, 1)); writer.flush(); @@ -611,12 +611,12 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { d.add(new StringField("id", "1", Field.Store.YES)); writer.addDocument(d); writer.updateDocValues(new Term("id", "0"), new NumericDocValuesField("soft_delete", 1)); - try (IndexReader reader = writer.getReader()) { + try (IndexReader reader = DirectoryReader.open(writer)) { assertEquals(2, reader.maxDoc()); assertEquals(1, reader.numDocs()); } doUpdate(new Term("id", "0"), writer, new NumericDocValuesField("soft_delete", null)); - try (IndexReader reader = writer.getReader()) { + try (IndexReader reader = DirectoryReader.open(writer)) { assertEquals(2, reader.maxDoc()); assertEquals(2, reader.numDocs()); } @@ -641,12 +641,12 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { d.add(new StringField("id", "1", Field.Store.YES)); d.add(new NumericDocValuesField("soft_delete", 1)); writer.addDocument(d); - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { assertEquals(2, reader.maxDoc()); assertEquals(1, reader.numDocs()); } while (true) { - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { TopDocs topDocs = new IndexSearcher(new IncludeSoftDeletesWrapper(reader)) .search(new TermQuery(new Term("id", "1")), 1); @@ -736,7 +736,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { liveDocs.remove(delId); } } - try (DirectoryReader unwrapped = writer.getReader()) { + try (DirectoryReader unwrapped = DirectoryReader.open(writer)) { DirectoryReader reader = new IncludeSoftDeletesWrapper(unwrapped); assertEquals(liveDocs.size(), reader.numDocs()); } @@ -780,7 +780,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { static void doUpdate(Term doc, IndexWriter writer, Field... fields) throws IOException { long seqId = -1; do { // retry if we just committing a merge - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { TopDocs topDocs = new IndexSearcher(new IncludeSoftDeletesWrapper(reader)).search(new TermQuery(doc), 10); assertEquals(1, topDocs.totalHits.value); @@ -793,7 +793,7 @@ public class TestSoftDeletesRetentionMergePolicy extends LuceneTestCase { static void doDelete(Term doc, IndexWriter writer) throws IOException { long seqId; do { // retry if we just committing a merge - try (DirectoryReader reader = writer.getReader()) { + try (DirectoryReader reader = DirectoryReader.open(writer)) { TopDocs topDocs = new IndexSearcher(new IncludeSoftDeletesWrapper(reader)).search(new TermQuery(doc), 10); assertEquals(1, topDocs.totalHits.value); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSortedSetDocValues.java b/lucene/core/src/test/org/apache/lucene/index/TestSortedSetDocValues.java index b744d98461d..17213a0ce48 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSortedSetDocValues.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSortedSetDocValues.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.index; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSortedSetDocValues extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSortingCodecReader.java b/lucene/core/src/test/org/apache/lucene/index/TestSortingCodecReader.java index 587edf6f3a1..09a8e9ee36e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSortingCodecReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSortingCodecReader.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.TermVectorsReader; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; @@ -48,9 +47,11 @@ import org.apache.lucene.search.SortedSetSortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestSortingCodecReader extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java b/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java index f6615b8bf8c..54d62c97baf 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java @@ -24,9 +24,10 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestStressAdvance extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressDeletes.java b/lucene/core/src/test/org/apache/lucene/index/TestStressDeletes.java index ceef19edaa3..ceecf32928d 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestStressDeletes.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestStressDeletes.java @@ -19,15 +19,15 @@ package org.apache.lucene.index; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestStressDeletes extends LuceneTestCase { @@ -104,7 +104,7 @@ public class TestStressDeletes extends LuceneTestCase { thread.join(); } - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); IndexSearcher s = newSearcher(r); for (Map.Entry ent : exists.entrySet()) { int id = ent.getKey(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java b/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java index c65b1f3087e..41f4baed4e1 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java @@ -16,11 +16,13 @@ */ package org.apache.lucene.index; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.*; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.*; -import org.apache.lucene.util.*; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestStressIndexing extends LuceneTestCase { private abstract static class TimedThread extends Thread { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java b/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java index 2fcb01cbd42..e219944f71a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.concurrent.ConcurrentHashMap; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -36,10 +35,12 @@ import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Before; public class TestStressIndexing2 extends LuceneTestCase { @@ -63,7 +64,7 @@ public class TestStressIndexing2 extends LuceneTestCase { // TODO: verify equals using IW.getReader DocsAndWriter dw = indexRandomIWReader(5, 3, 100, dir); - DirectoryReader reader = dw.writer.getReader(); + DirectoryReader reader = DirectoryReader.open(dw.writer); dw.writer.commit(); verifyEquals(random(), reader, dir, "id"); reader.close(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java b/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java index f4b2938ef16..c3ed3025ff6 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java @@ -24,7 +24,6 @@ import java.util.Random; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -34,8 +33,10 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestStressNRT extends LuceneTestCase { volatile DirectoryReader reader; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSumDocFreq.java b/lucene/core/src/test/org/apache/lucene/index/TestSumDocFreq.java index 1283274b165..2dfe1006a75 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSumDocFreq.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSumDocFreq.java @@ -20,8 +20,9 @@ import java.util.Collection; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** * Tests {@link Terms#getSumDocFreq()} diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java b/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java index d11f50dc375..8884295151a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java @@ -21,15 +21,16 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems; +import org.apache.lucene.tests.util.TestUtil; /** Test that the same file name, but from a different index, is detected as foreign. */ @SuppressFileSystems("ExtrasFS") diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTerm.java b/lucene/core/src/test/org/apache/lucene/index/TestTerm.java index 1c2b3db9631..fc1ea752520 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTerm.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTerm.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.index; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestTerm extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermStates.java b/lucene/core/src/test/org/apache/lucene/index/TestTermStates.java index ccfbcfb5da5..85142c2caa3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTermStates.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTermStates.java @@ -19,8 +19,9 @@ package org.apache.lucene.index; import org.apache.lucene.document.Document; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestTermStates extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermVectors.java b/lucene/core/src/test/org/apache/lucene/index/TestTermVectors.java index 6c120e3e4cd..7f4bae3d663 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTermVectors.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTermVectors.java @@ -19,17 +19,18 @@ package org.apache.lucene.index; import static com.carrotsearch.randomizedtesting.RandomizedTest.randomIntBetween; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.BaseTermVectorsFormatTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestTermVectors extends LuceneTestCase { @@ -152,7 +153,7 @@ public class TestTermVectors extends LuceneTestCase { writer.addDocument(doc); } - IndexReader reader1 = writer.getReader(); + IndexReader reader1 = DirectoryReader.open(writer); assertEquals(2, reader1.leaves().size()); assertEquals( hasPayloads, @@ -162,7 +163,7 @@ public class TestTermVectors extends LuceneTestCase { reader1.leaves().get(1).reader().getFieldInfos().fieldInfo("c").hasPayloads()); writer.forceMerge(1); - IndexReader reader2 = writer.getReader(); + IndexReader reader2 = DirectoryReader.open(writer); assertEquals(1, reader2.leaves().size()); // assert that in the merged segments payloads set up for the field assertTrue(reader2.leaves().get(0).reader().getFieldInfos().fieldInfo("c").hasPayloads()); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java index 3ab1d5bba32..64bf38faf38 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java @@ -32,9 +32,11 @@ import org.apache.lucene.document.StoredField; import org.apache.lucene.document.TextField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestTermVectorsReader extends LuceneTestCase { // Must be lexicographically sorted, will do in setup, versus trying to maintain here diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java index c019db8e980..632b94bb810 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java @@ -22,9 +22,6 @@ import static org.hamcrest.CoreMatchers.startsWith; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CachingTokenFilter; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -34,10 +31,14 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.hamcrest.MatcherAssert; /** tests for writing term vectors */ diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermdocPerf.java b/lucene/core/src/test/org/apache/lucene/index/TestTermdocPerf.java index 26c021cba4b..58a9b3a8233 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTermdocPerf.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTermdocPerf.java @@ -26,9 +26,9 @@ import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; class RepeatingTokenizer extends Tokenizer { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTerms.java b/lucene/core/src/test/org/apache/lucene/index/TestTerms.java index 06cbd5e92ab..84067ced62c 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTerms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTerms.java @@ -16,14 +16,15 @@ */ package org.apache.lucene.index; -import org.apache.lucene.analysis.CannedBinaryTokenStream; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedBinaryTokenStream; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestTerms extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java b/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java index 547e80c2b63..841e5558687 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java @@ -28,17 +28,19 @@ import java.util.Map; import java.util.Random; import java.util.Set; import java.util.TreeSet; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.PerThreadPKLookup; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.CompiledAutomaton; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum2.java b/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum2.java index eb5c7566412..4cac33011f3 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum2.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum2.java @@ -23,19 +23,21 @@ import java.util.Collections; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.TermsEnum.SeekStatus; import org.apache.lucene.search.AutomatonQuery; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.*; public class TestTermsEnum2 extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTermsHashPerField.java b/lucene/core/src/test/org/apache/lucene/index/TestTermsHashPerField.java index 73bee8a0baf..8711c16fdd0 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTermsHashPerField.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTermsHashPerField.java @@ -28,11 +28,11 @@ import java.util.Map; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ByteBlockPool; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.Counter; import org.apache.lucene.util.IntBlockPool; -import org.apache.lucene.util.LuceneTestCase; public class TestTermsHashPerField extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestThreadedForceMerge.java b/lucene/core/src/test/org/apache/lucene/index/TestThreadedForceMerge.java index de1640fa880..f2fd56eabcd 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestThreadedForceMerge.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestThreadedForceMerge.java @@ -18,15 +18,15 @@ package org.apache.lucene.index; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.BeforeClass; public class TestThreadedForceMerge extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java index 09c06b361e7..dfec4c566cc 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTieredMergePolicy.java @@ -24,15 +24,16 @@ import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.MergePolicy.MergeSpecification; import org.apache.lucene.index.MergePolicy.OneMerge; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.BaseMergePolicyTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; public class TestTieredMergePolicy extends BaseMergePolicyTestCase { @@ -241,7 +242,7 @@ public class TestTieredMergePolicy extends BaseMergePolicyTestCase { } w.forceMerge(1); - IndexReader r = w.getReader(); + IndexReader r = DirectoryReader.open(w); assertEquals(numDocs, r.maxDoc()); assertEquals(numDocs, r.numDocs()); r.close(); @@ -252,14 +253,14 @@ public class TestTieredMergePolicy extends BaseMergePolicyTestCase { w.deleteDocuments(new Term("id", "" + (42 + 17))); - r = w.getReader(); + r = DirectoryReader.open(w); assertEquals(numDocs, r.maxDoc()); assertEquals(numDocs - 1, r.numDocs()); r.close(); w.forceMergeDeletes(); - r = w.getReader(); + r = DirectoryReader.open(w); assertEquals(numDocs - 1, r.maxDoc()); assertEquals(numDocs - 1, r.numDocs()); r.close(); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTragicIndexWriterDeadlock.java b/lucene/core/src/test/org/apache/lucene/index/TestTragicIndexWriterDeadlock.java index a5d0cb8b405..8abbfca8d21 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTragicIndexWriterDeadlock.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTragicIndexWriterDeadlock.java @@ -22,8 +22,9 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.lucene.document.Document; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.SuppressingConcurrentMergeScheduler; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestTragicIndexWriterDeadlock extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTransactionRollback.java b/lucene/core/src/test/org/apache/lucene/index/TestTransactionRollback.java index 2753ffaded0..1efae1a6fab 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTransactionRollback.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTransactionRollback.java @@ -23,12 +23,12 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.LuceneTestCase; /** * Test class to illustrate using IndexDeletionPolicy to provide multi-level rollback capability. diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTransactions.java b/lucene/core/src/test/org/apache/lucene/index/TestTransactions.java index 85d3a7e79cd..fd3905c4152 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTransactions.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTransactions.java @@ -17,17 +17,17 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StringField; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.English; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestTransactions extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTryDelete.java b/lucene/core/src/test/org/apache/lucene/index/TestTryDelete.java index 8d3265ecab5..78d00a1eec4 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTryDelete.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTryDelete.java @@ -17,7 +17,6 @@ package org.apache.lucene.index; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; @@ -30,7 +29,8 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestTryDelete extends LuceneTestCase { private static IndexWriter getWriter(Directory directory) throws IOException { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTwoPhaseCommitTool.java b/lucene/core/src/test/org/apache/lucene/index/TestTwoPhaseCommitTool.java index 585a1273665..39193340bad 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTwoPhaseCommitTool.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTwoPhaseCommitTool.java @@ -18,7 +18,7 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Map; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestTwoPhaseCommitTool extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestUniqueTermCount.java b/lucene/core/src/test/org/apache/lucene/index/TestUniqueTermCount.java index 481df5cbec7..234ea194779 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestUniqueTermCount.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestUniqueTermCount.java @@ -18,16 +18,17 @@ package org.apache.lucene.index; import java.util.ArrayList; import java.util.HashSet; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests the uniqueTermCount statistic in FieldInvertState */ public class TestUniqueTermCount extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java index c7531aa87ae..e9dad198a18 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestUpgradeIndexMergePolicy.java @@ -18,7 +18,8 @@ package org.apache.lucene.index; import java.io.IOException; import org.apache.lucene.index.MergePolicy.MergeSpecification; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.BaseMergePolicyTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestUpgradeIndexMergePolicy extends BaseMergePolicyTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/internal/tests/TestTestSecrets.java b/lucene/core/src/test/org/apache/lucene/internal/tests/TestTestSecrets.java new file mode 100644 index 00000000000..6da41fb3c8b --- /dev/null +++ b/lucene/core/src/test/org/apache/lucene/internal/tests/TestTestSecrets.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.internal.tests; + +import org.apache.lucene.tests.util.LuceneTestCase; + +public class TestTestSecrets extends LuceneTestCase { + + public void testCallerOfGetter() { + final UnsupportedOperationException expected = + expectThrows(UnsupportedOperationException.class, TestTestSecrets::illegalCaller); + assertEquals( + "Lucene TestSecrets can only be used by the test-framework.", expected.getMessage()); + } + + private static void illegalCaller() { + TestSecrets.getIndexWriterAccess(); + } + + public void testCannotSet() { + expectThrows(AssertionError.class, () -> TestSecrets.setIndexWriterAccess(null)); + expectThrows(AssertionError.class, () -> TestSecrets.setConcurrentMergeSchedulerAccess(null)); + expectThrows(AssertionError.class, () -> TestSecrets.setIndexPackageAccess(null)); + expectThrows(AssertionError.class, () -> TestSecrets.setSegmentReaderAccess(null)); + } +} diff --git a/lucene/core/src/test/org/apache/lucene/search/TestApproximationSearchEquivalence.java b/lucene/core/src/test/org/apache/lucene/search/TestApproximationSearchEquivalence.java index 386e8fe4505..faee48b5c53 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestApproximationSearchEquivalence.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestApproximationSearchEquivalence.java @@ -18,6 +18,8 @@ package org.apache.lucene.search; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.tests.search.RandomApproximationQuery; +import org.apache.lucene.tests.search.SearchEquivalenceTestBase; /** Basic equivalence tests for approximations. */ public class TestApproximationSearchEquivalence extends SearchEquivalenceTestBase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestAutomatonQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestAutomatonQuery.java index 706f39e1b15..548945c4f76 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestAutomatonQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestAutomatonQuery.java @@ -27,19 +27,19 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiTerms; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SingleTermsEnum; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.Rethrow; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Rethrow; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.Operations; public class TestAutomatonQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestAutomatonQueryUnicode.java b/lucene/core/src/test/org/apache/lucene/search/TestAutomatonQueryUnicode.java index da00d5fc1f7..951dbd872d9 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestAutomatonQueryUnicode.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestAutomatonQueryUnicode.java @@ -20,10 +20,10 @@ import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBaseRangeFilter.java b/lucene/core/src/test/org/apache/lucene/search/TestBaseRangeFilter.java index f3820219c1d..ad1d81b00c9 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBaseRangeFilter.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBaseRangeFilter.java @@ -18,7 +18,6 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.DoublePoint; import org.apache.lucene.document.Field; @@ -29,11 +28,12 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig.OpenMode; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBlendedTermQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestBlendedTermQuery.java index 9710c4c57a2..9f584b879b7 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBlendedTermQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBlendedTermQuery.java @@ -21,10 +21,11 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestBlendedTermQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBlockMaxConjunction.java b/lucene/core/src/test/org/apache/lucene/search/TestBlockMaxConjunction.java index 8a3cf59d9c1..35812ab7775 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBlockMaxConjunction.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBlockMaxConjunction.java @@ -26,8 +26,12 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.search.AssertingQuery; +import org.apache.lucene.tests.search.BlockScoreQueryWrapper; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.RandomApproximationQuery; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestBlockMaxConjunction extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java index 5181c67a930..67ba9449486 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java @@ -19,7 +19,6 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.Collections; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -28,14 +27,17 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2ScorerSupplier.java b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2ScorerSupplier.java index 2dc968f13de..b35969aab86 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2ScorerSupplier.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2ScorerSupplier.java @@ -25,8 +25,8 @@ import java.util.EnumMap; import java.util.Map; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.BooleanClause.Occur; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestBoolean2ScorerSupplier extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java index fee63f3d60e..e3e609e3bc9 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java @@ -23,10 +23,12 @@ import java.util.Random; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanOr.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanOr.java index a955cb6190c..b464a5d225b 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanOr.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanOr.java @@ -23,17 +23,18 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestBooleanOr extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java index b287f0e8794..77d952cc699 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java @@ -27,7 +27,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -36,15 +35,17 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; -import org.apache.lucene.util.TestUtil; public class TestBooleanQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanQueryVisitSubscorers.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanQueryVisitSubscorers.java index f2290907775..3e58ce2cae3 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanQueryVisitSubscorers.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanQueryVisitSubscorers.java @@ -24,7 +24,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.TextField; @@ -32,13 +31,15 @@ import org.apache.lucene.index.FieldInvertState; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.ScorerIndexSearcher; +import org.apache.lucene.tests.util.LuceneTestCase; // TODO: refactor to a base class, that collects freqs from the scorer tree // and test all queries with it diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java index 4870cd8343b..c282f511dcb 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java @@ -28,12 +28,12 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestBooleanRewrites extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java index f49a44140f2..907bb397bf3 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java @@ -24,13 +24,14 @@ import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.Weight.DefaultBulkScorer; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.LuceneTestCase; public class TestBooleanScorer extends LuceneTestCase { private static final String FIELD = "category"; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBoostQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestBoostQuery.java index 51a4f5b1b6f..6da06785ebf 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBoostQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBoostQuery.java @@ -20,7 +20,7 @@ import java.io.IOException; import org.apache.lucene.index.MultiReader; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestBoostQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java index 8b88a5287a9..4b07e06dd0a 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java @@ -17,7 +17,7 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCachingCollector extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestCollectorManager.java b/lucene/core/src/test/org/apache/lucene/search/TestCollectorManager.java index 749888fdab5..7c1adf543b9 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestCollectorManager.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestCollectorManager.java @@ -34,9 +34,9 @@ import java.util.stream.IntStream; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCollectorManager extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestComplexExplanations.java b/lucene/core/src/test/org/apache/lucene/search/TestComplexExplanations.java index 5f02458d972..da18b5091d0 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestComplexExplanations.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestComplexExplanations.java @@ -20,6 +20,7 @@ import java.util.Arrays; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.ClassicSimilarity; +import org.apache.lucene.tests.search.BaseExplanationTestCase; /** * TestExplanations subclass that builds up super crazy complex queries on the assumption that if diff --git a/lucene/core/src/test/org/apache/lucene/search/TestComplexExplanationsOfNonMatches.java b/lucene/core/src/test/org/apache/lucene/search/TestComplexExplanationsOfNonMatches.java index c092b77d511..3fdfe390ddb 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestComplexExplanationsOfNonMatches.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestComplexExplanationsOfNonMatches.java @@ -16,6 +16,8 @@ */ package org.apache.lucene.search; +import org.apache.lucene.tests.search.CheckHits; + /** subclass of TestSimpleExplanations that verifies non matches. */ public class TestComplexExplanationsOfNonMatches extends TestComplexExplanations { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestConjunctionDISI.java b/lucene/core/src/test/org/apache/lucene/search/TestConjunctionDISI.java index 7d5b46a5b1d..436982ffc59 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestConjunctionDISI.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestConjunctionDISI.java @@ -22,10 +22,10 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BitDocIdSet; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestConjunctionDISI extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java b/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java index 24968aeae35..4fd4129a153 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java @@ -21,7 +21,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; @@ -32,12 +31,13 @@ import org.apache.lucene.index.FieldInvertState; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestConjunctions extends LuceneTestCase { Analyzer analyzer; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java index fbbf51731a1..058c5614977 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java @@ -22,12 +22,13 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; /** * This class only tests some basic functionality in CSQ, the main parts are mostly tested by diff --git a/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreScorer.java index d43aed3ac85..d4623106323 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreScorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreScorer.java @@ -23,17 +23,17 @@ import static org.hamcrest.CoreMatchers.equalTo; import java.io.IOException; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestConstantScoreScorer extends LuceneTestCase { private static final String FIELD = "f"; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java index c1882e0683a..2488c1a5429 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java @@ -22,7 +22,6 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -34,15 +33,16 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SnapshotDeletionPolicy; import org.apache.lucene.index.Term; -import org.apache.lucene.index.ThreadedIndexingAndSearchingTestCase; import org.apache.lucene.store.Directory; import org.apache.lucene.store.NRTCachingDirectory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.index.ThreadedIndexingAndSearchingTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; import org.apache.lucene.util.ThreadInterruptedException; @SuppressCodecs({"SimpleText", "Direct"}) diff --git a/lucene/core/src/test/org/apache/lucene/search/TestCustomSearcherSort.java b/lucene/core/src/test/org/apache/lucene/search/TestCustomSearcherSort.java index f47fc74a8a5..e9dc8555694 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestCustomSearcherSort.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestCustomSearcherSort.java @@ -29,11 +29,11 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Unit test for sorting code. */ public class TestCustomSearcherSort extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDateSort.java b/lucene/core/src/test/org/apache/lucene/search/TestDateSort.java index fdbad355a30..d33fddf5786 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDateSort.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDateSort.java @@ -22,10 +22,10 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** * Test date sorting, i.e. auto-sorting of fields with type "long". See diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java index e3818267126..d9d7f909b8b 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -37,12 +36,15 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; /** Test of the DisjunctionMaxQuery. */ @LuceneTestCase.SuppressCodecs("SimpleText") diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionScoreBlockBoundaryPropagator.java b/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionScoreBlockBoundaryPropagator.java index 0ba0b4eb99a..57b0efb0179 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionScoreBlockBoundaryPropagator.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDisjunctionScoreBlockBoundaryPropagator.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDisjunctionScoreBlockBoundaryPropagator extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDocIdSetIterator.java b/lucene/core/src/test/org/apache/lucene/search/TestDocIdSetIterator.java index 7b66cd74476..bfa5e1a4501 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDocIdSetIterator.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDocIdSetIterator.java @@ -19,7 +19,7 @@ package org.apache.lucene.search; import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDocIdSetIterator extends LuceneTestCase { public void testRangeBasic() throws Exception { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDocValuesFieldExistsQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestDocValuesFieldExistsQuery.java index ef400610720..c03be974684 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDocValuesFieldExistsQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDocValuesFieldExistsQuery.java @@ -27,14 +27,14 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestDocValuesFieldExistsQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java index 8c01a0b949b..2f4b74b7f46 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java @@ -25,11 +25,12 @@ import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; public class TestDocValuesQueries extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDocValuesRewriteMethod.java b/lucene/core/src/test/org/apache/lucene/search/TestDocValuesRewriteMethod.java index 2a0415c1ffc..a694ed6a1a7 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDocValuesRewriteMethod.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDocValuesRewriteMethod.java @@ -20,20 +20,22 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.RegExp; /** Tests the DocValuesRewriteMethod */ diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDoubleRangeFieldQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestDoubleRangeFieldQueries.java index 3e5a98a5194..5d1e2912069 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDoubleRangeFieldQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDoubleRangeFieldQueries.java @@ -20,8 +20,9 @@ import java.util.Arrays; import org.apache.lucene.document.Document; import org.apache.lucene.document.DoubleRange; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.BaseRangeFieldQueryTestCase; /** Random testing for RangeFieldQueries. */ public class TestDoubleRangeFieldQueries extends BaseRangeFieldQueryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java b/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java index 42b8b0bd16d..4861c6d670e 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java @@ -27,13 +27,14 @@ import org.apache.lucene.document.FloatDocValuesField; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestEarlyTermination.java b/lucene/core/src/test/org/apache/lucene/search/TestEarlyTermination.java index 3895812019e..c8daf443aba 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestEarlyTermination.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestEarlyTermination.java @@ -20,9 +20,9 @@ import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestEarlyTermination extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java b/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java index a5b1c75358f..2cb8e3a6477 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java @@ -19,7 +19,6 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; @@ -34,8 +33,9 @@ import org.apache.lucene.search.FieldValueHitQueue.Entry; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestElevationComparator extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheRewriteMethod.java b/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheRewriteMethod.java index 7b6dfce0ac6..ca78ac3c682 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheRewriteMethod.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestFieldCacheRewriteMethod.java @@ -18,6 +18,8 @@ package org.apache.lucene.search; import java.io.IOException; import org.apache.lucene.index.Term; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; import org.apache.lucene.util.automaton.RegExp; /** Tests the FieldcacheRewriteMethod with random regular expressions */ diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFilterWeight.java b/lucene/core/src/test/org/apache/lucene/search/TestFilterWeight.java index 2d817e1024c..121aa7cb5fc 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestFilterWeight.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestFilterWeight.java @@ -19,7 +19,7 @@ package org.apache.lucene.search; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestFilterWeight extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFloatRangeFieldQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestFloatRangeFieldQueries.java index 4ac8c1f4f5f..9dce6fbb006 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestFloatRangeFieldQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestFloatRangeFieldQueries.java @@ -20,8 +20,9 @@ import java.util.Arrays; import org.apache.lucene.document.Document; import org.apache.lucene.document.FloatRange; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.BaseRangeFieldQueryTestCase; /** Random testing for FloatRange Queries. */ public class TestFloatRangeFieldQueries extends BaseRangeFieldQueryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java index c1f3f05e8ed..5fe69b9d1ca 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java @@ -25,24 +25,24 @@ import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.ByteRunAutomaton; import org.apache.lucene.util.automaton.LevenshteinAutomata; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFuzzyTermOnShortTerms.java b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyTermOnShortTerms.java index b60d70c77ff..73b755bf66a 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestFuzzyTermOnShortTerms.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyTermOnShortTerms.java @@ -18,17 +18,17 @@ package org.apache.lucene.search; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Test; public class TestFuzzyTermOnShortTerms extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestIndexOrDocValuesQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestIndexOrDocValuesQuery.java index 61b316b6441..8fb6be0930c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestIndexOrDocValuesQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestIndexOrDocValuesQuery.java @@ -29,8 +29,8 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestIndexOrDocValuesQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java b/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java index bfd9c2c1fc6..c3bcda9d47a 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java @@ -41,14 +41,14 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; -import org.apache.lucene.util.TestUtil; import org.junit.Test; public class TestIndexSearcher extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestIndriAndQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestIndriAndQuery.java index 5be257ecbdc..dae1b3d6b05 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestIndriAndQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestIndriAndQuery.java @@ -17,20 +17,20 @@ package org.apache.lucene.search; import java.util.Arrays; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.IndriDirichletSimilarity; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestIndriAndQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestInetAddressRangeQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestInetAddressRangeQueries.java index 4d955feae32..e4c2aca4e0b 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestInetAddressRangeQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestInetAddressRangeQueries.java @@ -21,7 +21,8 @@ import java.net.UnknownHostException; import java.util.Arrays; import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.document.InetAddressRange; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.search.BaseRangeFieldQueryTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; /** Random testing for {@link InetAddressRange} */ @SuppressCodecs({"Direct"}) diff --git a/lucene/core/src/test/org/apache/lucene/search/TestIntRangeFieldQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestIntRangeFieldQueries.java index 56804de2157..bb3e71fad9a 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestIntRangeFieldQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestIntRangeFieldQueries.java @@ -20,9 +20,10 @@ import java.util.Arrays; import org.apache.lucene.document.Document; import org.apache.lucene.document.IntRange; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.BaseRangeFieldQueryTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Random testing for IntRange Queries. */ public class TestIntRangeFieldQueries extends BaseRangeFieldQueryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestKnnVectorQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestKnnVectorQuery.java index 6e64d30c535..cde24ee545a 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestKnnVectorQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestKnnVectorQuery.java @@ -36,12 +36,12 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.VectorSimilarityFunction; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.VectorUtil; /** TestKnnVectorQuery tests KnnVectorQuery. */ diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java b/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java index 76496295212..648f13322c8 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java @@ -56,18 +56,20 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.AssertingIndexSearcher; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.RamUsageTester; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Accountable; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.Constants; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.RamUsageTester; -import org.apache.lucene.util.TestUtil; public class TestLRUQueryCache extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLatLonDocValuesQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestLatLonDocValuesQueries.java index 2d3e6b2e10f..3e88aeb986c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLatLonDocValuesQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLatLonDocValuesQueries.java @@ -19,10 +19,10 @@ package org.apache.lucene.search; import org.apache.lucene.document.Document; import org.apache.lucene.document.LatLonDocValuesField; import org.apache.lucene.document.ShapeField; -import org.apache.lucene.geo.BaseGeoPointTestCase; import org.apache.lucene.geo.GeoEncodingUtils; import org.apache.lucene.geo.LatLonGeometry; import org.apache.lucene.geo.Polygon; +import org.apache.lucene.tests.geo.BaseGeoPointTestCase; public class TestLatLonDocValuesQueries extends BaseGeoPointTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLatLonPointQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestLatLonPointQueries.java index c2cea11f40f..b6f78727994 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLatLonPointQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLatLonPointQueries.java @@ -20,7 +20,6 @@ import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.document.LatLonPoint; import org.apache.lucene.document.ShapeField; -import org.apache.lucene.geo.BaseGeoPointTestCase; import org.apache.lucene.geo.GeoEncodingUtils; import org.apache.lucene.geo.LatLonGeometry; import org.apache.lucene.geo.Polygon; @@ -28,6 +27,7 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.geo.BaseGeoPointTestCase; import org.apache.lucene.util.bkd.BKDConfig; public class TestLatLonPointQueries extends BaseGeoPointTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java b/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java index 2c9e6661787..03f3770ab35 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java @@ -25,7 +25,6 @@ import java.util.Locale; import java.util.Map; import java.util.Random; import java.util.concurrent.CountDownLatch; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StoredField; @@ -34,8 +33,9 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLiveFieldValues extends LuceneTestCase { public void test() throws Exception { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLongRangeFieldQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestLongRangeFieldQueries.java index 0df2224cd18..7258e539066 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLongRangeFieldQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLongRangeFieldQueries.java @@ -20,9 +20,10 @@ import java.util.Arrays; import org.apache.lucene.document.Document; import org.apache.lucene.document.LongRange; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.BaseRangeFieldQueryTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Random testing for LongRange Queries. */ // See: https://issues.apache.org/jira/browse/SOLR-12028 Tests cannot remove files on Windows diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java b/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java index f90302a494c..ac3b6e7bd7e 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java @@ -24,13 +24,14 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestLongValuesSource extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java index 37a7e5a406a..5963af7aef1 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java @@ -18,7 +18,6 @@ package org.apache.lucene.search; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -26,7 +25,8 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; /** Tests MatchAllDocsQuery. */ public class TestMatchAllDocsQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMatchNoDocsQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestMatchNoDocsQuery.java index f92e15e433d..d8e558b450e 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMatchNoDocsQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMatchNoDocsQuery.java @@ -18,7 +18,6 @@ package org.apache.lucene.search; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -26,7 +25,9 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; /** Tests MatchNoDocsQuery. */ public class TestMatchNoDocsQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMatchesIterator.java b/lucene/core/src/test/org/apache/lucene/search/TestMatchesIterator.java index 484dd133989..b62d1ec69f1 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMatchesIterator.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMatchesIterator.java @@ -33,6 +33,8 @@ import org.apache.lucene.index.ReaderUtil; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.tests.search.AssertingMatches; +import org.apache.lucene.tests.search.MatchesTestBase; import org.apache.lucene.util.BytesRef; public class TestMatchesIterator extends MatchesTestBase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMaxClauseLimit.java b/lucene/core/src/test/org/apache/lucene/search/TestMaxClauseLimit.java index 7519723352f..d633b3e83db 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMaxClauseLimit.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMaxClauseLimit.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.util.Arrays; import org.apache.lucene.index.MultiReader; import org.apache.lucene.index.Term; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMaxClauseLimit extends LuceneTestCase { public void testIllegalArgumentExceptionOnZero() { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMaxScoreAccumulator.java b/lucene/core/src/test/org/apache/lucene/search/TestMaxScoreAccumulator.java index 28bec9cc15d..700fba697c5 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMaxScoreAccumulator.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMaxScoreAccumulator.java @@ -17,7 +17,7 @@ package org.apache.lucene.search; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMaxScoreAccumulator extends LuceneTestCase { public void testSimple() { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMaxScoreSumPropagator.java b/lucene/core/src/test/org/apache/lucene/search/TestMaxScoreSumPropagator.java index 70a42c6ccbd..8fc378405fa 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMaxScoreSumPropagator.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMaxScoreSumPropagator.java @@ -25,8 +25,8 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestMaxScoreSumPropagator extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMinShouldMatch2.java b/lucene/core/src/test/org/apache/lucene/search/TestMinShouldMatch2.java index 918dca79800..e293854fecb 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMinShouldMatch2.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMinShouldMatch2.java @@ -29,16 +29,17 @@ import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermStates; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.Similarity.SimScorer; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.BulkScorerWrapperScorer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java index eef4447efc8..2c276d59efc 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiCollector.java @@ -29,10 +29,10 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Test; public class TestMultiCollector extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiCollectorManager.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiCollectorManager.java index fb4e766cbce..22017a863cc 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiCollectorManager.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiCollectorManager.java @@ -29,9 +29,9 @@ import java.util.stream.Collectors; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMultiCollectorManager extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseEnum.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseEnum.java index 7b309ffe5c4..96f5bdd3206 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseEnum.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseEnum.java @@ -27,7 +27,7 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.PostingsEnum; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** simple tests for unionpostingsenum */ public class TestMultiPhraseEnum extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java index 1e7a238394b..296a4648922 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java @@ -18,8 +18,6 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.LinkedList; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -28,13 +26,15 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.MultiTerms; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Ignore; /** This class tests the MultiPhraseQuery class. */ diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiSliceMerge.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiSliceMerge.java index 495604f8a8c..9f6a0dffb21 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiSliceMerge.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiSliceMerge.java @@ -23,10 +23,11 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestMultiSliceMerge extends LuceneTestCase { Directory dir1; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java index 0cd8013e3dd..fa61910ad42 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java @@ -17,16 +17,17 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java index 77d4d59ffb2..fb36de732e1 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiTermQueryRewrites.java @@ -17,21 +17,21 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.FilteredTermsEnum; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java index dfd3d2b6db2..91403717d97 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java @@ -17,7 +17,6 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.*; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.Fields; @@ -26,8 +25,9 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMultiThreadTermVectors extends LuceneTestCase { private Directory directory; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiset.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiset.java index 207981e7059..282bb13fe54 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestMultiset.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiset.java @@ -18,7 +18,7 @@ package org.apache.lucene.search; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMultiset extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestNGramPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestNGramPhraseQuery.java index e04cd8b60a1..f42a576ce54 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestNGramPhraseQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestNGramPhraseQuery.java @@ -18,10 +18,10 @@ package org.apache.lucene.search; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java b/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java index 309af27e933..57ecad5bde3 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java @@ -23,11 +23,11 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestNeedsScores extends LuceneTestCase { Directory dir; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java index 73fb21158aa..cb5da03134c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java @@ -27,13 +27,13 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestNormsFieldExistsQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestNot.java b/lucene/core/src/test/org/apache/lucene/search/TestNot.java index 5924480789a..daaa77a592c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestNot.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestNot.java @@ -19,10 +19,10 @@ package org.apache.lucene.search; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** Similarity unit test. */ public class TestNot extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java index 80dcb2565bb..85d859ff942 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java @@ -22,12 +22,12 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiTerms; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** This class tests PhrasePrefixQuery class. */ public class TestPhrasePrefixQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java index 9968c8fc8b0..8361b868c2c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestPhraseQuery.java @@ -25,11 +25,6 @@ import java.util.Random; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.document.Document; @@ -44,16 +39,23 @@ import org.apache.lucene.index.ImpactsSource; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig.OpenMode; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java index 723f6772e05..073985aa22d 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java @@ -30,7 +30,6 @@ import java.util.NoSuchElementException; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.PointsFormat; @@ -56,16 +55,17 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.index.PointValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.bkd.BKDConfig; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPositionIncrement.java b/lucene/core/src/test/org/apache/lucene/search/TestPositionIncrement.java index f7a122c400e..c6343ae5533 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestPositionIncrement.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestPositionIncrement.java @@ -27,11 +27,11 @@ import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiTerms; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Term position unit test. */ public class TestPositionIncrement extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java index de077d9d57f..dcf644ad1a0 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java @@ -19,10 +19,10 @@ package org.apache.lucene.search; import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestPositiveScoresOnlyCollector extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java index 2230319948b..e0e3928778b 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java @@ -19,10 +19,10 @@ package org.apache.lucene.search; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java index 49eb4f067e4..9e8761a8b2b 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java @@ -24,13 +24,13 @@ import java.util.Set; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; /** Tests {@link PrefixQuery} class. */ public class TestPrefixQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPrefixRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestPrefixRandom.java index 5243a535ff0..2d0cdec8f1c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestPrefixRandom.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestPrefixRandom.java @@ -17,22 +17,23 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.FilteredTermsEnum; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; /** * Create an index with random unicode terms Generates random prefix queries, and validates against diff --git a/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java b/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java index ff72f6a22c0..6867d6501d2 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java @@ -27,15 +27,16 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestQueryRescorer extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestQueryVisitor.java b/lucene/core/src/test/org/apache/lucene/search/TestQueryVisitor.java index 29966fe65c2..3c2c22c611c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestQueryVisitor.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestQueryVisitor.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import org.apache.lucene.index.Term; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestQueryVisitor extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRangeFieldsDocValuesQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestRangeFieldsDocValuesQuery.java index a9cd67218ef..4c2ff0be01e 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestRangeFieldsDocValuesQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestRangeFieldsDocValuesQuery.java @@ -24,9 +24,9 @@ import org.apache.lucene.document.FloatRangeDocValuesField; import org.apache.lucene.document.IntRangeDocValuesField; import org.apache.lucene.document.LongRangeDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestRangeFieldsDocValuesQuery extends LuceneTestCase { public void testDoubleRangeDocValuesIntersectsQuery() throws IOException { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java index 7f05c7a3805..00803103655 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java @@ -23,10 +23,10 @@ import java.util.Arrays; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.AutomatonProvider; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java index 22d67595f71..f39ac709d7f 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java @@ -20,17 +20,17 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.Locale; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** * Create an index with terms from 000-999. Generates random regexps according to simple patterns, diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom2.java b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom2.java index dca393a09ad..d856d245bf2 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom2.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom2.java @@ -20,26 +20,27 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.FilteredTermsEnum; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CharsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestReqExclBulkScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestReqExclBulkScorer.java index 5ba08dd11ee..4efda423c2e 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestReqExclBulkScorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestReqExclBulkScorer.java @@ -17,11 +17,11 @@ package org.apache.lucene.search; import java.io.IOException; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.DocIdSetBuilder; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestReqExclBulkScorer extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestReqOptSumScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestReqOptSumScorer.java index 677b83ab3f7..13c687d1926 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestReqOptSumScorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestReqOptSumScorer.java @@ -31,11 +31,13 @@ import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.RandomApproximationQuery; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestReqOptSumScorer extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java b/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java index 45cd88b174d..02f86826f69 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java @@ -22,20 +22,20 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CountDownLatch; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.MultiTerms; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestSameScoresWithThreads extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java index b5f1bcf9595..28e84eae4f5 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java @@ -18,10 +18,10 @@ package org.apache.lucene.search; import java.io.IOException; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestScoreCachingWrappingScorer extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestScorerPerf.java b/lucene/core/src/test/org/apache/lucene/search/TestScorerPerf.java index 9b4a6c880aa..03a5e27a033 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestScorerPerf.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestScorerPerf.java @@ -18,7 +18,6 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.BitSet; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -27,9 +26,10 @@ import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BitSetIterator; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; public class TestScorerPerf extends LuceneTestCase { private final boolean validate = true; // set to false when doing performance testing diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java b/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java index aa731512517..bf2287d0415 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java @@ -30,13 +30,13 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Tests IndexSearcher's searchAfter() method */ public class TestSearchAfter extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSearchWithThreads.java b/lucene/core/src/test/org/apache/lucene/search/TestSearchWithThreads.java index 901f8761b39..9bb14ca448c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSearchWithThreads.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSearchWithThreads.java @@ -21,10 +21,10 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSearchWithThreads extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java index e84b641beb0..52a0cc7519d 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java @@ -26,7 +26,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.ConcurrentMergeScheduler; @@ -38,15 +37,16 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; -import org.apache.lucene.index.ThreadedIndexingAndSearchingTestCase; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.index.ThreadedIndexingAndSearchingTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.NamedThreadFactory; -import org.apache.lucene.util.TestUtil; @SuppressCodecs({"SimpleText", "Direct"}) public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSegmentCacheables.java b/lucene/core/src/test/org/apache/lucene/search/TestSegmentCacheables.java index aec3148c0d5..be7b4543f4b 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSegmentCacheables.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSegmentCacheables.java @@ -29,7 +29,7 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSegmentCacheables extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java b/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java index 825ba829598..f30c2846c0d 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java @@ -26,9 +26,10 @@ import org.apache.lucene.index.MultiReader; import org.apache.lucene.index.MultiTerms; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.tests.search.ShardSearchingTestBase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; // TODO // - other queries besides PrefixQuery & TermQuery (but: diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java index ac7b683ed10..51a286cc88e 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSimilarity.java @@ -17,16 +17,16 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** Similarity unit test. */ public class TestSimilarity extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java b/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java index 81d1b97375a..faf4c251fe3 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java @@ -16,7 +16,6 @@ */ package org.apache.lucene.search; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -24,12 +23,13 @@ import org.apache.lucene.index.FieldInvertState; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSimilarityProvider extends LuceneTestCase { private Directory directory; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanations.java b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanations.java index 70b778b8947..26f1a19fd77 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanations.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanations.java @@ -18,6 +18,7 @@ package org.apache.lucene.search; import java.util.Arrays; import org.apache.lucene.index.Term; +import org.apache.lucene.tests.search.BaseExplanationTestCase; import org.junit.Test; /** TestExplanations subclass focusing on basic query types */ diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsOfNonMatches.java b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsOfNonMatches.java index acc44bb1a79..c5180c5734e 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsOfNonMatches.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsOfNonMatches.java @@ -16,6 +16,8 @@ */ package org.apache.lucene.search; +import org.apache.lucene.tests.search.CheckHits; + /** subclass of TestSimpleExplanations that verifies non matches. */ public class TestSimpleExplanationsOfNonMatches extends TestSimpleExplanations { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java index 949c63b5b8b..32bdd5bd846 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java @@ -18,10 +18,10 @@ package org.apache.lucene.search; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.TestUtil; import org.junit.Assume; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimpleSearchEquivalence.java b/lucene/core/src/test/org/apache/lucene/search/TestSimpleSearchEquivalence.java index 58ba19fea20..30680d0cf00 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSimpleSearchEquivalence.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSimpleSearchEquivalence.java @@ -19,6 +19,8 @@ package org.apache.lucene.search; import java.util.Arrays; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.tests.search.AssertingQuery; +import org.apache.lucene.tests.search.SearchEquivalenceTestBase; /** Basic equivalence tests for core queries */ public class TestSimpleSearchEquivalence extends SearchEquivalenceTestBase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java index f8fe426b9f8..c3ed22bfaa3 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java @@ -17,19 +17,21 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.AssertingScorable; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSloppyPhraseQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery2.java b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery2.java index cfa590174d7..050dd67193a 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery2.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery2.java @@ -18,7 +18,8 @@ package org.apache.lucene.search; import java.util.Random; import org.apache.lucene.index.Term; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.search.SearchEquivalenceTestBase; +import org.apache.lucene.tests.util.TestUtil; /** random sloppy phrase query tests */ public class TestSloppyPhraseQuery2 extends SearchEquivalenceTestBase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSort.java b/lucene/core/src/test/org/apache/lucene/search/TestSort.java index f94d932641d..1ef4883b318 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSort.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSort.java @@ -25,9 +25,9 @@ import org.apache.lucene.document.FloatDocValuesField; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /* * Very simple tests of sorting. diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortOptimization.java b/lucene/core/src/test/org/apache/lucene/search/TestSortOptimization.java index ff915693105..5dcf15c6200 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSortOptimization.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSortOptimization.java @@ -39,11 +39,11 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestSortOptimization extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java index 5637279a437..6e7e976e45b 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java @@ -33,13 +33,13 @@ import org.apache.lucene.index.DocValues; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BitSetIterator; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** random sorting tests */ public class TestSortRandom extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java b/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java index d69a093e997..b6807f5c364 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java @@ -24,12 +24,12 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestSortRescorer extends LuceneTestCase { IndexSearcher searcher; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java b/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java index febc2096ccc..e44b7df40d4 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java @@ -21,10 +21,10 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; /** Simple tests for SortedNumericSortField */ diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java b/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java index b2f6e5b3f86..1bf887e3653 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java @@ -20,10 +20,10 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; /** * Tests for SortedSetSortField selectors other than MIN, these require optional codec support diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java b/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java index d70db36b9c8..9b1ff79e6d0 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java @@ -21,10 +21,10 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** Simple tests for SortedSetSortField, indexing the sortedset up front */ public class TestSortedSetSortField extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSubScorerFreqs.java b/lucene/core/src/test/org/apache/lucene/search/TestSubScorerFreqs.java index 5b2ce4e337f..86675ffb477 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSubScorerFreqs.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSubScorerFreqs.java @@ -23,18 +23,19 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.FieldInvertState; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.AssertingScorable; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java index 1772e248cda..4c185b9e043 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java @@ -33,13 +33,15 @@ import org.apache.lucene.index.ImpactsSource; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestSynonymQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermInSetQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestTermInSetQuery.java index f2dae324202..13a3faf31c9 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTermInSetQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTermInSetQuery.java @@ -33,17 +33,18 @@ import org.apache.lucene.index.FilterDirectoryReader; import org.apache.lucene.index.FilterLeafReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.RamUsageTester; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.RamUsageTester; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.ByteRunAutomaton; public class TestTermInSetQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java index 5a35ff49ff7..d73675ec1b8 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java @@ -27,17 +27,18 @@ import org.apache.lucene.index.FilterLeafReader; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.MultiReader; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermState; import org.apache.lucene.index.TermStates; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestTermQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java index 0efdbc96fc8..6cde85a5b55 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java @@ -19,8 +19,6 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.document.Document; @@ -30,7 +28,9 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestTermRangeQuery extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java index 841613f0156..a591c53a4cd 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTermScorer.java @@ -19,7 +19,6 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; @@ -31,13 +30,15 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestTermScorer extends LuceneTestCase { protected Directory directory; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java index 43827ee5afc..ad8a90c0872 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java @@ -18,20 +18,20 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.BitSet; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.TimeLimitingCollector.TimeExceededException; import org.apache.lucene.search.TimeLimitingCollector.TimerThread; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Counter; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; /** diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java index ceecb82613e..5caec9c3ef8 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java @@ -29,14 +29,15 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MultiTerms; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; public class TestTopDocsCollector extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java index d678cb96983..38af05fcc0c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java @@ -31,14 +31,14 @@ import org.apache.lucene.index.CompositeReaderContext; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexReaderContext; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.ReaderUtil; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestTopDocsMerge extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java index 9d99f87ed90..afba5e6252d 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java @@ -32,13 +32,14 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.FieldValueHitQueue.Entry; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestTopFieldCollector extends LuceneTestCase { private IndexSearcher is; diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java b/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java index 5cdfb8b1745..d20db957545 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java @@ -23,7 +23,6 @@ import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.NumericDocValuesField; @@ -31,13 +30,15 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.MockRandomMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.MockRandomMergePolicy; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestTopFieldCollectorEarlyTermination extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTotalHitCountCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTotalHitCountCollector.java index b02779ca0c3..688664dc256 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTotalHitCountCollector.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTotalHitCountCollector.java @@ -20,9 +20,9 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestTotalHitCountCollector extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTotalHits.java b/lucene/core/src/test/org/apache/lucene/search/TestTotalHits.java index 4bd74bf06a0..b27d551a46d 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTotalHits.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTotalHits.java @@ -18,7 +18,7 @@ package org.apache.lucene.search; import com.carrotsearch.randomizedtesting.RandomizedTest; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestTotalHits extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java b/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java index 40e98391a7d..14c7490da01 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java @@ -21,11 +21,11 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.IntPoint; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestUsageTrackingFilterCachingPolicy extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestWANDScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestWANDScorer.java index 3d480c4588a..e09f3131eb5 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestWANDScorer.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestWANDScorer.java @@ -28,8 +28,11 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.search.AssertingQuery; +import org.apache.lucene.tests.search.BlockScoreQueryWrapper; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestWANDScorer extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestWildcard.java b/lucene/core/src/test/org/apache/lucene/search/TestWildcard.java index 4c5c2db3a11..83cf933aa81 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestWildcard.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestWildcard.java @@ -17,17 +17,17 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiTerms; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** TestWildcard tests the '*' and '?' wildcard characters. */ public class TestWildcard extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java index 69ddd240c0e..f41185c57fe 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java @@ -20,15 +20,15 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.Locale; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** * Create an index with terms from 000-999. Generates random wildcards according to patterns, and diff --git a/lucene/core/src/test/org/apache/lucene/search/TestXYDocValuesQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestXYDocValuesQueries.java index 8a7c8f75a26..3e1a7bc9266 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestXYDocValuesQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestXYDocValuesQueries.java @@ -18,9 +18,9 @@ package org.apache.lucene.search; import org.apache.lucene.document.Document; import org.apache.lucene.document.XYDocValuesField; -import org.apache.lucene.geo.BaseXYPointTestCase; import org.apache.lucene.geo.XYGeometry; import org.apache.lucene.geo.XYPolygon; +import org.apache.lucene.tests.geo.BaseXYPointTestCase; public class TestXYDocValuesQueries extends BaseXYPointTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestXYPointDistanceSort.java b/lucene/core/src/test/org/apache/lucene/search/TestXYPointDistanceSort.java index 3586e50648a..0ca58723286 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestXYPointDistanceSort.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestXYPointDistanceSort.java @@ -22,14 +22,14 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.XYDocValuesField; -import org.apache.lucene.geo.ShapeTestUtil; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.geo.ShapeTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Simple tests for {@link XYDocValuesField#newDistanceSort} */ public class TestXYPointDistanceSort extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/TestXYPointQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestXYPointQueries.java index 6337a895e4c..ef428d60338 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestXYPointQueries.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestXYPointQueries.java @@ -18,9 +18,9 @@ package org.apache.lucene.search; import org.apache.lucene.document.Document; import org.apache.lucene.document.XYPointField; -import org.apache.lucene.geo.BaseXYPointTestCase; import org.apache.lucene.geo.XYGeometry; import org.apache.lucene.geo.XYPolygon; +import org.apache.lucene.tests.geo.BaseXYPointTestCase; public class TestXYPointQueries extends BaseXYPointTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/AxiomaticTestCase.java b/lucene/core/src/test/org/apache/lucene/search/similarities/AxiomaticTestCase.java index f242aecbe8a..6211c723644 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/AxiomaticTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/AxiomaticTestCase.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public abstract class AxiomaticTestCase extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/BasicModelTestCase.java b/lucene/core/src/test/org/apache/lucene/search/similarities/BasicModelTestCase.java index 2439be63797..19b05c0de42 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/BasicModelTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/BasicModelTestCase.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public abstract class BasicModelTestCase extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/DistributionTestCase.java b/lucene/core/src/test/org/apache/lucene/search/similarities/DistributionTestCase.java index 7e1bfd15600..7febf079d97 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/DistributionTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/DistributionTestCase.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public abstract class DistributionTestCase extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java index e32e642a25d..b3c0245affa 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestAxiomaticSimilarity.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.search.similarities; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestAxiomaticSimilarity extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java index c77ef632671..463d62e85cd 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBM25Similarity.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public class TestBM25Similarity extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java index 16316c7ae67..037df625a67 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java @@ -25,7 +25,6 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.FieldInvertState; import org.apache.lucene.index.IndexOptions; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.IndexSearcher; @@ -33,7 +32,9 @@ import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Version; public class TestBooleanSimilarity extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java index f37a3fe4cab..9a7db0f8348 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java @@ -36,8 +36,9 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; public class TestClassicSimilarity extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceChiSquared.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceChiSquared.java index 650269a59f1..bc14a3bd1b0 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceChiSquared.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceChiSquared.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public class TestIndependenceChiSquared extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceSaturated.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceSaturated.java index d323767104d..0c8d8dd47f1 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceSaturated.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceSaturated.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public class TestIndependenceSaturated extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceStandardized.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceStandardized.java index b98e856a430..31379261c4d 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceStandardized.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndependenceStandardized.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public class TestIndependenceStandardized extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndriDirichletSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndriDirichletSimilarity.java index 39300d0c93c..b6ed29ab650 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndriDirichletSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestIndriDirichletSimilarity.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public class TestIndriDirichletSimilarity extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestLMDirichletSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestLMDirichletSimilarity.java index e4ce17b7650..b382935dd88 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestLMDirichletSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestLMDirichletSimilarity.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public class TestLMDirichletSimilarity extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestLMJelinekMercerSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestLMJelinekMercerSimilarity.java index c747c37058e..fb8c14f135d 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestLMJelinekMercerSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestLMJelinekMercerSimilarity.java @@ -17,6 +17,7 @@ package org.apache.lucene.search.similarities; import java.util.Random; +import org.apache.lucene.tests.search.similarities.BaseSimilarityTestCase; public class TestLMJelinekMercerSimilarity extends BaseSimilarityTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarity2.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarity2.java index 785d9cfdc77..e75b82ca9a4 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarity2.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarity2.java @@ -25,7 +25,6 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -34,8 +33,9 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests against all the similarities we have */ public class TestSimilarity2 extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java index 77788f3b347..b16a87c3432 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestSimilarityBase.java @@ -26,7 +26,6 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.FieldInvertState; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.Explanation; @@ -37,9 +36,10 @@ import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.similarities.SimilarityBase.BasicSimScorer; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; /** diff --git a/lucene/core/src/test/org/apache/lucene/store/BaseDataOutputTestCase.java b/lucene/core/src/test/org/apache/lucene/store/BaseDataOutputTestCase.java index 8d5e24d1716..e6907e7632b 100644 --- a/lucene/core/src/test/org/apache/lucene/store/BaseDataOutputTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/store/BaseDataOutputTestCase.java @@ -27,9 +27,9 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.IOUtils.IOConsumer; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; public abstract class BaseDataOutputTestCase extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestBufferedChecksum.java b/lucene/core/src/test/org/apache/lucene/store/TestBufferedChecksum.java index 12f296feed6..47d8be79728 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestBufferedChecksum.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestBufferedChecksum.java @@ -18,7 +18,7 @@ package org.apache.lucene.store; import java.util.zip.CRC32; import java.util.zip.Checksum; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestBufferedChecksum extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java b/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java index 3a468525da6..546a2249397 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java @@ -19,8 +19,8 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.ByteBuffer; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; public class TestBufferedIndexInput extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestByteArrayDataInput.java b/lucene/core/src/test/org/apache/lucene/store/TestByteArrayDataInput.java index df0e8eaa5cd..1af0c152f3f 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestByteArrayDataInput.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestByteArrayDataInput.java @@ -18,7 +18,7 @@ package org.apache.lucene.store; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestByteArrayDataInput extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDataInput.java b/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDataInput.java index fdbcd42a650..c0786c56a12 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDataInput.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDataInput.java @@ -26,9 +26,9 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.IOUtils.IOConsumer; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; public final class TestByteBuffersDataInput extends RandomizedTest { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDataOutput.java b/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDataOutput.java index 4594420fb4d..065606c3ba3 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDataOutput.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDataOutput.java @@ -21,10 +21,10 @@ import java.nio.ByteBuffer; import java.util.List; import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.RamUsageEstimator; -import org.apache.lucene.util.TestUtil; import org.junit.Assert; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDirectory.java index c376d169647..87cfee6e7c4 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDirectory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestByteBuffersDirectory.java @@ -22,13 +22,14 @@ import java.io.IOException; import java.nio.file.Path; import java.util.Arrays; import java.util.function.Supplier; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; -import org.apache.lucene.util.English; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; +import org.apache.lucene.tests.util.English; import org.junit.Test; public class TestByteBuffersDirectory extends BaseDirectoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestChecksumIndexInput.java b/lucene/core/src/test/org/apache/lucene/store/TestChecksumIndexInput.java index 05abce0f9a6..a23ff5dab6b 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestChecksumIndexInput.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestChecksumIndexInput.java @@ -17,8 +17,8 @@ package org.apache.lucene.store; import java.io.IOException; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestChecksumIndexInput extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java index b0fa2ec5bf9..eef3d70340d 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java @@ -25,8 +25,8 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; -import org.apache.lucene.mockfile.ExtrasFS; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.mockfile.ExtrasFS; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDirectory extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java index 0ff95b4ed78..e09d71c3098 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java @@ -26,7 +26,6 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.function.Function; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingStoredFieldsWriter; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexNotFoundException; @@ -34,10 +33,13 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.TestIndexWriterReader; -import org.apache.lucene.mockfile.FilterPath; -import org.apache.lucene.mockfile.WindowsFS; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.mockfile.FilterPath; +import org.apache.lucene.tests.mockfile.WindowsFS; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Constants; -import org.apache.lucene.util.TestUtil; public class TestFileSwitchDirectory extends BaseDirectoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestFilterDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestFilterDirectory.java index e48c472a9fb..058b6be059e 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestFilterDirectory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestFilterDirectory.java @@ -21,6 +21,7 @@ import java.lang.reflect.Method; import java.nio.file.Path; import java.util.HashSet; import java.util.Set; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; import org.junit.Test; public class TestFilterDirectory extends BaseDirectoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestIndexOutputAlignment.java b/lucene/core/src/test/org/apache/lucene/store/TestIndexOutputAlignment.java index c71a151f42b..0570a17e119 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestIndexOutputAlignment.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestIndexOutputAlignment.java @@ -19,7 +19,7 @@ package org.apache.lucene.store; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.stream.IntStream; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestIndexOutputAlignment extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestInputStreamDataInput.java b/lucene/core/src/test/org/apache/lucene/store/TestInputStreamDataInput.java index 26f8fd406b8..123cbd0964e 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestInputStreamDataInput.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestInputStreamDataInput.java @@ -21,8 +21,8 @@ import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; diff --git a/lucene/core/src/test/org/apache/lucene/store/TestLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestLockFactory.java index 0c099c630dc..518c8369a52 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestLockFactory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestLockFactory.java @@ -20,13 +20,14 @@ import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLockFactory extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestMmapDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestMmapDirectory.java index 46c59346abb..0149e9f5eb2 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestMmapDirectory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestMmapDirectory.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.nio.file.Path; import java.util.Random; import java.util.concurrent.CountDownLatch; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; import org.junit.BeforeClass; import org.junit.Ignore; diff --git a/lucene/core/src/test/org/apache/lucene/store/TestMultiByteBuffersDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestMultiByteBuffersDirectory.java index 643f7c8b215..77dc36c2fe3 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestMultiByteBuffersDirectory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestMultiByteBuffersDirectory.java @@ -19,6 +19,7 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.file.Path; import java.util.function.Supplier; +import org.apache.lucene.tests.store.BaseChunkedDirectoryTestCase; import org.apache.lucene.util.BitUtil; /** Tests ByteBuffersDirectory's chunking */ diff --git a/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java b/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java index 317e4a8334d..b1275a27911 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestMultiMMap.java @@ -18,6 +18,7 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.file.Path; +import org.apache.lucene.tests.store.BaseChunkedDirectoryTestCase; import org.apache.lucene.util.BytesRef; import org.junit.BeforeClass; diff --git a/lucene/core/src/test/org/apache/lucene/store/TestNIOFSDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestNIOFSDirectory.java index e702b682461..01c79c1a4eb 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestNIOFSDirectory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestNIOFSDirectory.java @@ -24,9 +24,10 @@ import java.nio.file.OpenOption; import java.nio.file.Path; import java.nio.file.attribute.FileAttribute; import java.util.Set; -import org.apache.lucene.mockfile.FilterFileChannel; -import org.apache.lucene.mockfile.FilterPath; -import org.apache.lucene.mockfile.LeakFS; +import org.apache.lucene.tests.mockfile.FilterFileChannel; +import org.apache.lucene.tests.mockfile.FilterPath; +import org.apache.lucene.tests.mockfile.LeakFS; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; /** Tests NIOFSDirectory */ public class TestNIOFSDirectory extends BaseDirectoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java index ee40c3aef61..b81c3aeed6b 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestNRTCachingDirectory.java @@ -21,18 +21,19 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.TestUtil; public class TestNRTCachingDirectory extends BaseDirectoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java index cc1eff29ac9..0c87b5a0a0d 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java @@ -25,10 +25,11 @@ import java.nio.file.OpenOption; import java.nio.file.Path; import java.nio.file.attribute.FileAttribute; import java.util.Set; -import org.apache.lucene.mockfile.FilterFileSystemProvider; -import org.apache.lucene.mockfile.FilterPath; +import org.apache.lucene.tests.mockfile.FilterFileSystemProvider; +import org.apache.lucene.tests.mockfile.FilterPath; +import org.apache.lucene.tests.store.BaseLockFactoryTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; /** Simple tests for NativeFSLockFactory */ public class TestNativeFSLockFactory extends BaseLockFactoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestOutputStreamIndexOutput.java b/lucene/core/src/test/org/apache/lucene/store/TestOutputStreamIndexOutput.java index 9798dd32d87..d7e9fa57d9f 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestOutputStreamIndexOutput.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestOutputStreamIndexOutput.java @@ -19,7 +19,7 @@ package org.apache.lucene.store; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestOutputStreamIndexOutput extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestRateLimiter.java b/lucene/core/src/test/org/apache/lucene/store/TestRateLimiter.java index 137b83b20bf..5a7255e5615 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestRateLimiter.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestRateLimiter.java @@ -19,8 +19,8 @@ package org.apache.lucene.store; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicLong; import org.apache.lucene.store.RateLimiter.SimpleRateLimiter; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; /** Simple testcase for RateLimiter.SimpleRateLimiter */ diff --git a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java index f9058933d69..3bfc921df36 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java @@ -18,6 +18,7 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.file.Path; +import org.apache.lucene.tests.store.BaseLockFactoryTestCase; import org.apache.lucene.util.IOUtils; /** Simple tests for SimpleFSLockFactory */ diff --git a/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java index 16b0f3dde10..72526d097e5 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestSingleInstanceLockFactory.java @@ -18,10 +18,11 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.file.Path; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseLockFactoryTestCase; /** Simple tests for SingleInstanceLockFactory */ public class TestSingleInstanceLockFactory extends BaseLockFactoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestSleepingLockWrapper.java b/lucene/core/src/test/org/apache/lucene/store/TestSleepingLockWrapper.java index 55bca402310..99ba2589856 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestSleepingLockWrapper.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestSleepingLockWrapper.java @@ -18,7 +18,8 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.file.Path; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.store.BaseLockFactoryTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Simple tests for SleepingLockWrapper */ public class TestSleepingLockWrapper extends BaseLockFactoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/store/TestStressLockFactories.java b/lucene/core/src/test/org/apache/lucene/store/TestStressLockFactories.java index c364efdcf6d..0ff235389f0 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestStressLockFactories.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestStressLockFactories.java @@ -23,7 +23,7 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.SuppressForbidden; @LuceneTestCase.SuppressFileSystems("*") diff --git a/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java b/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java index 2feda0f7e4d..87bba47d734 100644 --- a/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java +++ b/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java @@ -19,6 +19,7 @@ package org.apache.lucene.store; import java.io.IOException; import java.nio.file.Path; import java.util.Collections; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; public class TestTrackingDirectoryWrapper extends BaseDirectoryTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/BaseSortTestCase.java b/lucene/core/src/test/org/apache/lucene/util/BaseSortTestCase.java index 0e052995ac1..e887448578f 100644 --- a/lucene/core/src/test/org/apache/lucene/util/BaseSortTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/util/BaseSortTestCase.java @@ -18,6 +18,8 @@ package org.apache.lucene.util; import java.util.Arrays; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public abstract class BaseSortTestCase extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/Test2BPagedBytes.java b/lucene/core/src/test/org/apache/lucene/util/Test2BPagedBytes.java index 764a1591e55..062d53dc72b 100644 --- a/lucene/core/src/test/org/apache/lucene/util/Test2BPagedBytes.java +++ b/lucene/core/src/test/org/apache/lucene/util/Test2BPagedBytes.java @@ -17,12 +17,14 @@ package org.apache.lucene.util; import java.util.Random; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.TestUtil; @Monster("You must increase heap to > 2 G to run this") public class Test2BPagedBytes extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java b/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java index bc2c3556b09..cec1a0e3e41 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestArrayUtil.java @@ -23,6 +23,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestArrayUtil extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java b/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java index f4b16d7ba43..ea403e1fd9f 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestAttributeSource.java @@ -19,9 +19,10 @@ package org.apache.lucene.util; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.*; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestAttributeSource extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java b/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java index d136fd42c35..d958204b464 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java @@ -20,6 +20,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestByteBlockPool extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestBytesRef.java b/lucene/core/src/test/org/apache/lucene/util/TestBytesRef.java index 004f5581738..e775e724a6e 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestBytesRef.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestBytesRef.java @@ -16,6 +16,9 @@ */ package org.apache.lucene.util; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; + public class TestBytesRef extends LuceneTestCase { public void testEmpty() { BytesRef b = new BytesRef(); diff --git a/lucene/core/src/test/org/apache/lucene/util/TestBytesRefArray.java b/lucene/core/src/test/org/apache/lucene/util/TestBytesRefArray.java index 72886a69a6b..d0cc3d3c2d3 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestBytesRefArray.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestBytesRefArray.java @@ -18,6 +18,8 @@ package org.apache.lucene.util; import java.io.IOException; import java.util.*; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestBytesRefArray extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java b/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java index be1c8f5cb52..8a7db41c32a 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java @@ -28,6 +28,8 @@ import java.util.SortedSet; import java.util.TreeSet; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRefHash.MaxBytesLengthExceededException; import org.junit.Before; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java b/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java index 673c7145871..404fe73f61d 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestCharsRef.java @@ -17,6 +17,8 @@ package org.apache.lucene.util; import java.util.Arrays; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestCharsRef extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestCharsRefBuilder.java b/lucene/core/src/test/org/apache/lucene/util/TestCharsRefBuilder.java index 61a7e8ba497..5662b21a209 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestCharsRefBuilder.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestCharsRefBuilder.java @@ -16,6 +16,9 @@ */ package org.apache.lucene.util; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; + public class TestCharsRefBuilder extends LuceneTestCase { public void testAppend() { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestClassLoaderUtils.java b/lucene/core/src/test/org/apache/lucene/util/TestClassLoaderUtils.java index 92726825076..5c699794708 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestClassLoaderUtils.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestClassLoaderUtils.java @@ -18,6 +18,7 @@ package org.apache.lucene.util; import java.net.URL; import java.net.URLClassLoader; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestClassLoaderUtils extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestCloseableThreadLocal.java b/lucene/core/src/test/org/apache/lucene/util/TestCloseableThreadLocal.java index 58e0e851087..5a450bb32c7 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestCloseableThreadLocal.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestCloseableThreadLocal.java @@ -16,6 +16,8 @@ */ package org.apache.lucene.util; +import org.apache.lucene.tests.util.LuceneTestCase; + public class TestCloseableThreadLocal extends LuceneTestCase { public static final String TEST_VALUE = "initvaluetest"; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestCollectionUtil.java b/lucene/core/src/test/org/apache/lucene/util/TestCollectionUtil.java index fa95487fdc4..d9a93860551 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestCollectionUtil.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestCollectionUtil.java @@ -22,6 +22,7 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCollectionUtil extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestDocIdSetBuilder.java b/lucene/core/src/test/org/apache/lucene/util/TestDocIdSetBuilder.java index 1c7171a8422..2fa146581c6 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestDocIdSetBuilder.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestDocIdSetBuilder.java @@ -22,6 +22,8 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.DocIdSet; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestDocIdSetBuilder extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java b/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java index dccc48dc02f..a96cf4d40de 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestFilterIterator.java @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Set; import java.util.TreeSet; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestFilterIterator extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestFixedBitDocIdSet.java b/lucene/core/src/test/org/apache/lucene/util/TestFixedBitDocIdSet.java index ea3f9f5b176..4cd4d208bc0 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestFixedBitDocIdSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestFixedBitDocIdSet.java @@ -18,6 +18,7 @@ package org.apache.lucene.util; import java.io.IOException; import java.util.BitSet; +import org.apache.lucene.tests.util.BaseDocIdSetTestCase; public class TestFixedBitDocIdSet extends BaseDocIdSetTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java b/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java index 280ec3eb3b4..558b0590159 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java @@ -20,6 +20,8 @@ import java.io.IOException; import java.util.Arrays; import java.util.Random; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.tests.util.BaseBitSetTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestFixedBitSet extends BaseBitSetTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestFixedLengthBytesRefArray.java b/lucene/core/src/test/org/apache/lucene/util/TestFixedLengthBytesRefArray.java index e8d4116e1d3..d962e9ccece 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestFixedLengthBytesRefArray.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestFixedLengthBytesRefArray.java @@ -19,6 +19,8 @@ package org.apache.lucene.util; import java.util.Arrays; import java.util.Comparator; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestFixedLengthBytesRefArray extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestFrequencyTrackingRingBuffer.java b/lucene/core/src/test/org/apache/lucene/util/TestFrequencyTrackingRingBuffer.java index ddab10d42d9..eea1487485f 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestFrequencyTrackingRingBuffer.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestFrequencyTrackingRingBuffer.java @@ -20,6 +20,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.RamUsageTester; public class TestFrequencyTrackingRingBuffer extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java index 0319bfec192..288e25523f1 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java @@ -32,8 +32,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Objects; import java.util.Set; -import org.apache.lucene.mockfile.FilterFileSystemProvider; -import org.apache.lucene.mockfile.FilterPath; +import org.apache.lucene.tests.mockfile.FilterFileSystemProvider; +import org.apache.lucene.tests.mockfile.FilterPath; +import org.apache.lucene.tests.util.LuceneTestCase; /** Simple test methods for IOUtils */ public class TestIOUtils extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestIntArrayDocIdSet.java b/lucene/core/src/test/org/apache/lucene/util/TestIntArrayDocIdSet.java index 52d5f0de8f8..5a4112229ed 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestIntArrayDocIdSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestIntArrayDocIdSet.java @@ -19,6 +19,7 @@ package org.apache.lucene.util; import java.io.IOException; import java.util.BitSet; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.tests.util.BaseDocIdSetTestCase; public class TestIntArrayDocIdSet extends BaseDocIdSetTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestIntroSelector.java b/lucene/core/src/test/org/apache/lucene/util/TestIntroSelector.java index ef8b40993c0..713451097c5 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestIntroSelector.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestIntroSelector.java @@ -18,6 +18,8 @@ package org.apache.lucene.util; import java.util.Arrays; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestIntroSelector extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestIntsRef.java b/lucene/core/src/test/org/apache/lucene/util/TestIntsRef.java index 8144657385a..800c2f4772a 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestIntsRef.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestIntsRef.java @@ -16,6 +16,8 @@ */ package org.apache.lucene.util; +import org.apache.lucene.tests.util.LuceneTestCase; + public class TestIntsRef extends LuceneTestCase { public void testEmpty() { IntsRef i = new IntsRef(); diff --git a/lucene/core/src/test/org/apache/lucene/util/TestLSBRadixSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestLSBRadixSorter.java index 9f8f024ef1a..dbaeb84ed9a 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestLSBRadixSorter.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestLSBRadixSorter.java @@ -17,6 +17,8 @@ package org.apache.lucene.util; import java.util.Arrays; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; public class TestLSBRadixSorter extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java b/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java index 9d534f3b550..24b2f5b8c52 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java @@ -17,6 +17,8 @@ package org.apache.lucene.util; import java.io.IOException; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLongBitSet extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestLongHeap.java b/lucene/core/src/test/org/apache/lucene/util/TestLongHeap.java index 9f2e3ba93b1..fa1a449b45a 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestLongHeap.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestLongHeap.java @@ -21,6 +21,8 @@ import static org.apache.lucene.util.LongHeap.Order.MIN; import java.util.ArrayList; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestLongHeap extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestLongsRef.java b/lucene/core/src/test/org/apache/lucene/util/TestLongsRef.java index 75437d8b6a4..f8c15d94ce9 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestLongsRef.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestLongsRef.java @@ -16,6 +16,8 @@ */ package org.apache.lucene.util; +import org.apache.lucene.tests.util.LuceneTestCase; + public class TestLongsRef extends LuceneTestCase { public void testEmpty() { LongsRef i = new LongsRef(); diff --git a/lucene/core/src/test/org/apache/lucene/util/TestMSBRadixSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestMSBRadixSorter.java index c2a9d75e5d0..304b9f6e510 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestMSBRadixSorter.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestMSBRadixSorter.java @@ -19,6 +19,8 @@ package org.apache.lucene.util; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestMSBRadixSorter extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestMathUtil.java b/lucene/core/src/test/org/apache/lucene/util/TestMathUtil.java index cd1ac5fea2a..1d8f0c3583f 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestMathUtil.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestMathUtil.java @@ -19,6 +19,7 @@ package org.apache.lucene.util; import com.carrotsearch.randomizedtesting.generators.RandomPicks; import java.math.BigInteger; import java.util.Arrays; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMathUtil extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestMergedIterator.java b/lucene/core/src/test/org/apache/lucene/util/TestMergedIterator.java index d5a654630cb..36e03278314 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestMergedIterator.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestMergedIterator.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMergedIterator extends LuceneTestCase { private static final int REPEATS = 2; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java b/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java index 62ff9d1b642..ce8c7b77f2b 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestNamedSPILoader.java @@ -18,6 +18,8 @@ package org.apache.lucene.util; import java.util.Set; import org.apache.lucene.codecs.Codec; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; // TODO: maybe we should test this with mocks, but it's easy // enough to test the basics via Codec diff --git a/lucene/core/src/test/org/apache/lucene/util/TestNotDocIdSet.java b/lucene/core/src/test/org/apache/lucene/util/TestNotDocIdSet.java index be52a7cd7cb..c747f97e18c 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestNotDocIdSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestNotDocIdSet.java @@ -19,6 +19,7 @@ package org.apache.lucene.util; import java.io.IOException; import java.util.BitSet; import org.apache.lucene.search.DocIdSet; +import org.apache.lucene.tests.util.BaseDocIdSetTestCase; public class TestNotDocIdSet extends BaseDocIdSetTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestNumericUtils.java b/lucene/core/src/test/org/apache/lucene/util/TestNumericUtils.java index 619607ff366..9089b5b4c53 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestNumericUtils.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestNumericUtils.java @@ -18,6 +18,8 @@ package org.apache.lucene.util; import java.math.BigInteger; import java.util.Arrays; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests for NumericUtils static methods. */ public class TestNumericUtils extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java index 627ac1ba777..6423e1e807c 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java @@ -30,12 +30,14 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.store.ChecksumIndexInput; -import org.apache.lucene.store.CorruptingIndexOutput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FilterDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.store.CorruptingIndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.OfflineSorter.BufferSize; import org.apache.lucene.util.OfflineSorter.ByteSequencesWriter; import org.apache.lucene.util.OfflineSorter.SortInfo; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestPagedBytes.java b/lucene/core/src/test/org/apache/lucene/util/TestPagedBytes.java index 7bdf4b0b85e..0163ed4f6bd 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestPagedBytes.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestPagedBytes.java @@ -18,13 +18,16 @@ package org.apache.lucene.util; import java.io.IOException; import java.util.*; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.DataInput; import org.apache.lucene.store.DataOutput; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.RamUsageTester; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Ignore; public class TestPagedBytes extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java b/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java index b580d140a40..b6e131a38d6 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java @@ -21,6 +21,8 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestQueryBuilder.java b/lucene/core/src/test/org/apache/lucene/util/TestQueryBuilder.java index e7cafbeeb3d..2ea575d5274 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestQueryBuilder.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestQueryBuilder.java @@ -19,10 +19,6 @@ package org.apache.lucene.util; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.AnalyzerWrapper; -import org.apache.lucene.analysis.CannedBinaryTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockSynonymFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -39,6 +35,11 @@ import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.SynonymQuery; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.analysis.CannedBinaryTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockSynonymFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestRadixSelector.java b/lucene/core/src/test/org/apache/lucene/util/TestRadixSelector.java index ee9ce7685df..1f60dfb3555 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestRadixSelector.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestRadixSelector.java @@ -17,6 +17,8 @@ package org.apache.lucene.util; import java.util.Arrays; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestRadixSelector extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestRamUsageEstimator.java b/lucene/core/src/test/org/apache/lucene/util/TestRamUsageEstimator.java index f120af50b9b..5e405b912a4 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestRamUsageEstimator.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestRamUsageEstimator.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.util; +import static org.apache.lucene.tests.util.RamUsageTester.ramUsed; import static org.apache.lucene.util.RamUsageEstimator.*; -import static org.apache.lucene.util.RamUsageTester.ramUsed; import java.util.ArrayList; import java.util.Arrays; @@ -31,6 +31,7 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestRamUsageEstimator extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestRecyclingByteBlockAllocator.java b/lucene/core/src/test/org/apache/lucene/util/TestRecyclingByteBlockAllocator.java index 7411b9be588..6a85f555da7 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestRecyclingByteBlockAllocator.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestRecyclingByteBlockAllocator.java @@ -19,6 +19,7 @@ package org.apache.lucene.util; import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Before; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestRecyclingIntBlockAllocator.java b/lucene/core/src/test/org/apache/lucene/util/TestRecyclingIntBlockAllocator.java index efcdef91c87..bb9bc8792b5 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestRecyclingIntBlockAllocator.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestRecyclingIntBlockAllocator.java @@ -19,6 +19,7 @@ package org.apache.lucene.util; import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Before; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestRoaringDocIdSet.java b/lucene/core/src/test/org/apache/lucene/util/TestRoaringDocIdSet.java index cae43dcafc1..fed8075b0f2 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestRoaringDocIdSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestRoaringDocIdSet.java @@ -18,6 +18,7 @@ package org.apache.lucene.util; import java.io.IOException; import java.util.BitSet; +import org.apache.lucene.tests.util.BaseDocIdSetTestCase; public class TestRoaringDocIdSet extends BaseDocIdSetTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestRollingBuffer.java b/lucene/core/src/test/org/apache/lucene/util/TestRollingBuffer.java index 2bfd913eea9..45fc3a01171 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestRollingBuffer.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestRollingBuffer.java @@ -17,6 +17,7 @@ package org.apache.lucene.util; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestRollingBuffer extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestSentinelIntSet.java b/lucene/core/src/test/org/apache/lucene/util/TestSentinelIntSet.java index 93e317cdc33..17424a276a3 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestSentinelIntSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestSentinelIntSet.java @@ -17,6 +17,7 @@ package org.apache.lucene.util; import java.util.HashSet; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** */ diff --git a/lucene/core/src/test/org/apache/lucene/util/TestSetOnce.java b/lucene/core/src/test/org/apache/lucene/util/TestSetOnce.java index bf237136bf9..72f4d269ef2 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestSetOnce.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestSetOnce.java @@ -17,6 +17,7 @@ package org.apache.lucene.util; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.SetOnce.AlreadySetException; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/util/TestSloppyMath.java b/lucene/core/src/test/org/apache/lucene/util/TestSloppyMath.java index 8ef8aab8512..18c128aeff7 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestSloppyMath.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestSloppyMath.java @@ -22,7 +22,8 @@ import static org.apache.lucene.util.SloppyMath.haversinMeters; import static org.apache.lucene.util.SloppyMath.haversinSortKey; import java.util.Random; -import org.apache.lucene.geo.GeoTestUtil; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSloppyMath extends LuceneTestCase { // accuracy for cos() diff --git a/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java b/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java index 54483040fbc..4bd1c982fcd 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestSmallFloat.java @@ -17,6 +17,8 @@ package org.apache.lucene.util; import java.util.Arrays; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Ignore; public class TestSmallFloat extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitDocIdSet.java b/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitDocIdSet.java index 93832298733..ef648c2ce45 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitDocIdSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitDocIdSet.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.BitSet; import java.util.Collections; import java.util.List; +import org.apache.lucene.tests.util.BaseDocIdSetTestCase; public class TestSparseFixedBitDocIdSet extends BaseDocIdSetTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitSet.java b/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitSet.java index e84bcdf75a8..594fbf57245 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestSparseFixedBitSet.java @@ -18,6 +18,8 @@ package org.apache.lucene.util; import java.io.IOException; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.tests.util.BaseBitSetTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestSparseFixedBitSet extends BaseBitSetTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestStableMSBRadixSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestStableMSBRadixSorter.java index 387b6b60d0c..4e7e0621727 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestStableMSBRadixSorter.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestStableMSBRadixSorter.java @@ -19,6 +19,8 @@ package org.apache.lucene.util; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestStableMSBRadixSorter extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestStressRamUsageEstimator.java b/lucene/core/src/test/org/apache/lucene/util/TestStressRamUsageEstimator.java index 6e9ff7e576e..fe77b6b6d5d 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestStressRamUsageEstimator.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestStressRamUsageEstimator.java @@ -16,6 +16,8 @@ */ package org.apache.lucene.util; +import org.apache.lucene.tests.util.LuceneTestCase; + /** * Estimates how {@link RamUsageEstimator} estimates physical memory consumption of Java objects. */ diff --git a/lucene/core/src/test/org/apache/lucene/util/TestStringHelper.java b/lucene/core/src/test/org/apache/lucene/util/TestStringHelper.java index ea8b98fbe39..b78c9a07bb9 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestStringHelper.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestStringHelper.java @@ -16,6 +16,8 @@ */ package org.apache.lucene.util; +import org.apache.lucene.tests.util.LuceneTestCase; + public class TestStringHelper extends LuceneTestCase { public void testBytesDifference() { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestStringMSBRadixSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestStringMSBRadixSorter.java index 1065913afb9..aa06ac78635 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestStringMSBRadixSorter.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestStringMSBRadixSorter.java @@ -17,6 +17,8 @@ package org.apache.lucene.util; import java.util.Arrays; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestStringMSBRadixSorter extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestTimSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestTimSorter.java index a2b857ed3e8..e256c09694e 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestTimSorter.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestTimSorter.java @@ -17,6 +17,7 @@ package org.apache.lucene.util; import java.util.Comparator; +import org.apache.lucene.tests.util.TestUtil; public class TestTimSorter extends BaseSortTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestTimSorterWorstCase.java b/lucene/core/src/test/org/apache/lucene/util/TestTimSorterWorstCase.java index d1bb3fb769c..fab69c5f686 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestTimSorterWorstCase.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestTimSorterWorstCase.java @@ -19,7 +19,8 @@ package org.apache.lucene.util; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.util.LinkedList; import java.util.List; -import org.apache.lucene.util.LuceneTestCase.Nightly; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.lucene.util.packed.PackedInts; @Nightly diff --git a/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java b/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java index 065e47e27e8..8e0348b706c 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java @@ -17,6 +17,8 @@ package org.apache.lucene.util; import java.util.Arrays; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /* * Some of this code came from the excellent Unicode diff --git a/lucene/core/src/test/org/apache/lucene/util/TestVectorUtil.java b/lucene/core/src/test/org/apache/lucene/util/TestVectorUtil.java index ae85c7bef46..54ed53efdb1 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestVectorUtil.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestVectorUtil.java @@ -17,6 +17,7 @@ package org.apache.lucene.util; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestVectorUtil extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestVersion.java b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java index d8f506b3ea6..16e392afb75 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestVersion.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java @@ -21,6 +21,7 @@ import java.lang.reflect.Modifier; import java.text.ParseException; import java.util.Locale; import java.util.Random; +import org.apache.lucene.tests.util.LuceneTestCase; @SuppressWarnings("deprecation") public class TestVersion extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java b/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java index 45e706efcdd..d642fbf54a6 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestVirtualMethod.java @@ -16,6 +16,8 @@ */ package org.apache.lucene.util; +import org.apache.lucene.tests.util.LuceneTestCase; + public class TestVirtualMethod extends LuceneTestCase { private static final VirtualMethod publicTestMethod = new VirtualMethod<>(Base.class, "publicTest", String.class); diff --git a/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java b/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java index 6f5a7bd823e..3db8540e30a 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestWeakIdentityMap.java @@ -23,6 +23,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReferenceArray; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestWeakIdentityMap extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java index c40891f4e4f..aba4107ebab 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java @@ -26,14 +26,15 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil.RandomAcceptedStrings; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; -import org.apache.lucene.util.automaton.AutomatonTestUtil.RandomAcceptedStrings; import org.apache.lucene.util.fst.Util; public class TestAutomaton extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestCompiledAutomaton.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestCompiledAutomaton.java index da9d68f846a..d24bed8c793 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestCompiledAutomaton.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestCompiledAutomaton.java @@ -22,10 +22,10 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestCompiledAutomaton extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestDaciukMihovAutomatonBuilder.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestDaciukMihovAutomatonBuilder.java index db79e94f744..4b31eda98c6 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestDaciukMihovAutomatonBuilder.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestDaciukMihovAutomatonBuilder.java @@ -18,9 +18,9 @@ package org.apache.lucene.util.automaton; import java.util.Arrays; import java.util.Collections; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestDaciukMihovAutomatonBuilder extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminism.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminism.java index b3a42380349..65616fa55b9 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminism.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminism.java @@ -18,7 +18,8 @@ package org.apache.lucene.util.automaton; import static org.apache.lucene.util.automaton.Operations.DEFAULT_DETERMINIZE_WORK_LIMIT; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; /** Not completely thorough, but tries to test determinism correctness somewhat randomly. */ public class TestDeterminism extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java index 557c8ebbc61..6aef1562522 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java @@ -20,8 +20,8 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** * Not thorough, but tries to test determinism correctness somewhat randomly, by determinizing a diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestFiniteStringsIterator.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestFiniteStringsIterator.java index 8a1f4b59610..8070d7af479 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestFiniteStringsIterator.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestFiniteStringsIterator.java @@ -23,11 +23,12 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.fst.Util; /** Test for {@link FiniteStringsIterator}. */ diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestIntSet.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestIntSet.java index 6ffdd6bc746..5b02437a38f 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestIntSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestIntSet.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.util.automaton; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestIntSet extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.java index 871109940b4..c112fd3fbc1 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.java @@ -20,7 +20,7 @@ import static org.apache.lucene.util.automaton.Operations.DEFAULT_DETERMINIZE_WO import java.util.ArrayList; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLevenshteinAutomata extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestLimitedFiniteStringsIterator.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestLimitedFiniteStringsIterator.java index 2299df36da9..f99e41d5b09 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestLimitedFiniteStringsIterator.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestLimitedFiniteStringsIterator.java @@ -19,10 +19,11 @@ package org.apache.lucene.util.automaton; import static org.apache.lucene.util.automaton.TestFiniteStringsIterator.getFiniteStrings; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.fst.Util; /** Test for {@link FiniteStringsIterator}. */ diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestMinimize.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestMinimize.java index 343ad8e2380..a43cc8ae8b1 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestMinimize.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestMinimize.java @@ -16,7 +16,8 @@ */ package org.apache.lucene.util.automaton; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; /** This test builds some randomish NFA/DFA and minimizes them. */ public class TestMinimize extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestNFARunAutomaton.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestNFARunAutomaton.java index 6b4c4806001..6f9b73fcbed 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestNFARunAutomaton.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestNFARunAutomaton.java @@ -26,14 +26,15 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.AutomatonQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestNFARunAutomaton extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestOperations.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestOperations.java index f561275dc7a..55131c78126 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestOperations.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestOperations.java @@ -20,6 +20,9 @@ import static org.apache.lucene.util.automaton.Operations.DEFAULT_DETERMINIZE_WO import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.util.*; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.*; public class TestOperations extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java index 7d6d9342228..eedf07caa46 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java @@ -18,8 +18,8 @@ package org.apache.lucene.util.automaton; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestRegExp extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExpParsing.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExpParsing.java index 9671f1b1c12..7d0f062f36b 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExpParsing.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExpParsing.java @@ -19,7 +19,7 @@ package org.apache.lucene.util.automaton; import java.io.IOException; import java.util.Map; import java.util.Set; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** * Simple unit tests for RegExp parsing. diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestUTF32ToUTF8.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestUTF32ToUTF8.java index ec191923502..89400fc6f72 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestUTF32ToUTF8.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestUTF32ToUTF8.java @@ -20,11 +20,12 @@ import java.nio.charset.StandardCharsets; import java.util.HashSet; import java.util.Random; import java.util.Set; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; import org.apache.lucene.util.fst.Util; diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/Test2BBKDPoints.java b/lucene/core/src/test/org/apache/lucene/util/bkd/Test2BBKDPoints.java index 09707fedb95..28bbf2da0ce 100644 --- a/lucene/core/src/test/org/apache/lucene/util/bkd/Test2BBKDPoints.java +++ b/lucene/core/src/test/org/apache/lucene/util/bkd/Test2BBKDPoints.java @@ -24,8 +24,8 @@ import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; import org.apache.lucene.util.NumericUtils; // e.g. run like this: ant test -Dtestcase=Test2BBKDPoints -Dtests.nightly=true -Dtests.verbose=true diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java index c7ffeaa6b90..d187f5e9fd0 100644 --- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java +++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java @@ -29,20 +29,20 @@ import org.apache.lucene.index.MergeState; import org.apache.lucene.index.PointValues; import org.apache.lucene.index.PointValues.IntersectVisitor; import org.apache.lucene.index.PointValues.Relation; -import org.apache.lucene.mockfile.ExtrasFS; import org.apache.lucene.search.DocIdSetIterator; -import org.apache.lucene.store.CorruptingIndexOutput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FilterDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.mockfile.ExtrasFS; +import org.apache.lucene.tests.store.CorruptingIndexOutput; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; public class TestBKD extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDRadixSelector.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDRadixSelector.java index 465f1dd947c..807daef88d4 100644 --- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDRadixSelector.java +++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDRadixSelector.java @@ -20,10 +20,10 @@ package org.apache.lucene.util.bkd; import java.io.IOException; import java.util.Arrays; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; public class TestBKDRadixSelector extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDRadixSort.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDRadixSort.java index 0b1750b6b75..807f2304aaa 100644 --- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDRadixSort.java +++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDRadixSort.java @@ -20,9 +20,9 @@ package org.apache.lucene.util.bkd; import java.io.IOException; import java.util.Arrays; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestBKDRadixSort extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDUtil.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDUtil.java index e264fc691f7..fa123a8b1fa 100644 --- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDUtil.java +++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKDUtil.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.util.bkd; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestBKDUtil extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestDocIdsWriter.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestDocIdsWriter.java index 80d0d9f6e82..5b2281d6b36 100644 --- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestDocIdsWriter.java +++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestDocIdsWriter.java @@ -26,8 +26,8 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestDocIdsWriter extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestMutablePointTreeReaderUtils.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestMutablePointTreeReaderUtils.java index e25824a3493..8c468bf5478 100644 --- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestMutablePointTreeReaderUtils.java +++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestMutablePointTreeReaderUtils.java @@ -20,10 +20,10 @@ import java.util.Arrays; import java.util.Comparator; import org.apache.lucene.codecs.MutablePointTree; import org.apache.lucene.index.PointValues; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestMutablePointTreeReaderUtils extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java b/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java index a9380e35216..8d8dfaeb978 100644 --- a/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java +++ b/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java @@ -22,9 +22,9 @@ import java.nio.charset.StandardCharsets; import java.util.Random; import org.apache.lucene.store.ByteArrayDataInput; import org.apache.lucene.store.ByteBuffersDataOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public abstract class LZ4TestCase extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/compress/TestLowercaseAsciiCompression.java b/lucene/core/src/test/org/apache/lucene/util/compress/TestLowercaseAsciiCompression.java index 0b06e462f8a..fd8374575e8 100644 --- a/lucene/core/src/test/org/apache/lucene/util/compress/TestLowercaseAsciiCompression.java +++ b/lucene/core/src/test/org/apache/lucene/util/compress/TestLowercaseAsciiCompression.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.lucene.store.ByteBuffersDataOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestLowercaseAsciiCompression extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java b/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java index 350f8558583..cfd06d90a1e 100644 --- a/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java +++ b/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java @@ -24,10 +24,10 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.MMapDirectory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TimeUnits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TimeUnits; import org.junit.Ignore; @Ignore("Requires tons of heap to run (30 GB hits OOME but 35 GB passes after ~4.5 hours)") diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestBitTableUtil.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestBitTableUtil.java index 8155f7d8592..00280c2bc51 100644 --- a/lucene/core/src/test/org/apache/lucene/util/fst/TestBitTableUtil.java +++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestBitTableUtil.java @@ -18,7 +18,7 @@ package org.apache.lucene.util.fst; import java.io.IOException; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestBitTableUtil extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestBytesStore.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestBytesStore.java index 4fd823bbeb7..20a4e918e6b 100644 --- a/lucene/core/src/test/org/apache/lucene/util/fst/TestBytesStore.java +++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestBytesStore.java @@ -21,8 +21,8 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestBytesStore extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTDirectAddressing.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTDirectAddressing.java index 60f727c7338..25e780e371f 100644 --- a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTDirectAddressing.java +++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTDirectAddressing.java @@ -34,10 +34,10 @@ import java.util.zip.GZIPInputStream; import org.apache.lucene.store.ByteArrayDataInput; import org.apache.lucene.store.DataInput; import org.apache.lucene.store.InputStreamDataInput; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; public class TestFSTDirectAddressing extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java index bace8409521..cbe7d7ca184 100644 --- a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java +++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java @@ -16,9 +16,9 @@ */ package org.apache.lucene.util.fst; -import static org.apache.lucene.util.fst.FSTTester.getRandomString; -import static org.apache.lucene.util.fst.FSTTester.simpleRandomString; -import static org.apache.lucene.util.fst.FSTTester.toIntsRef; +import static org.apache.lucene.tests.util.fst.FSTTester.getRandomString; +import static org.apache.lucene.tests.util.fst.FSTTester.simpleRandomString; +import static org.apache.lucene.tests.util.fst.FSTTester.toIntsRef; import java.io.BufferedReader; import java.io.IOException; @@ -41,7 +41,6 @@ import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -49,7 +48,6 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.MultiTerms; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; @@ -60,15 +58,18 @@ import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.fst.FSTTester; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.CompiledAutomaton; diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestUtil.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestUtil.java index 17295c55846..1eeb592de9a 100644 --- a/lucene/core/src/test/org/apache/lucene/util/fst/TestUtil.java +++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestUtil.java @@ -18,9 +18,9 @@ package org.apache.lucene.util.fst; import java.util.Arrays; import java.util.List; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; public class TestUtil extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java b/lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java index f7dbaf1feb2..e68b892d01c 100644 --- a/lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java +++ b/lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java @@ -17,14 +17,14 @@ package org.apache.lucene.util.graph; import java.util.Iterator; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute; import org.apache.lucene.index.Term; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; /** {@link GraphTokenStreamFiniteStrings} tests. */ public class TestGraphTokenStreamFiniteStrings extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/hnsw/MockVectorValues.java b/lucene/core/src/test/org/apache/lucene/util/hnsw/MockVectorValues.java index ee52a111cdf..4324a4e54a5 100644 --- a/lucene/core/src/test/org/apache/lucene/util/hnsw/MockVectorValues.java +++ b/lucene/core/src/test/org/apache/lucene/util/hnsw/MockVectorValues.java @@ -20,8 +20,8 @@ package org.apache.lucene.util.hnsw; import org.apache.lucene.index.RandomAccessVectorValues; import org.apache.lucene.index.RandomAccessVectorValuesProducer; import org.apache.lucene.index.VectorValues; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; class MockVectorValues extends VectorValues implements RandomAccessVectorValues, RandomAccessVectorValuesProducer { diff --git a/lucene/core/src/test/org/apache/lucene/util/hnsw/TestHnswGraph.java b/lucene/core/src/test/org/apache/lucene/util/hnsw/TestHnswGraph.java index 69b478ca249..306c5621376 100644 --- a/lucene/core/src/test/org/apache/lucene/util/hnsw/TestHnswGraph.java +++ b/lucene/core/src/test/org/apache/lucene/util/hnsw/TestHnswGraph.java @@ -45,11 +45,11 @@ import org.apache.lucene.index.RandomAccessVectorValuesProducer; import org.apache.lucene.index.VectorSimilarityFunction; import org.apache.lucene.index.VectorValues; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.VectorUtil; /** Tests HNSW KNN graphs */ diff --git a/lucene/core/src/test/org/apache/lucene/util/hnsw/TestNeighbors.java b/lucene/core/src/test/org/apache/lucene/util/hnsw/TestNeighbors.java index 653cade1130..ef207c95dfd 100644 --- a/lucene/core/src/test/org/apache/lucene/util/hnsw/TestNeighbors.java +++ b/lucene/core/src/test/org/apache/lucene/util/hnsw/TestNeighbors.java @@ -17,7 +17,7 @@ package org.apache.lucene.util.hnsw; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestNeighbors extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/hppc/TestIntIntHashMap.java b/lucene/core/src/test/org/apache/lucene/util/hppc/TestIntIntHashMap.java index 62efe25f134..5a8598ac733 100644 --- a/lucene/core/src/test/org/apache/lucene/util/hppc/TestIntIntHashMap.java +++ b/lucene/core/src/test/org/apache/lucene/util/hppc/TestIntIntHashMap.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Test; diff --git a/lucene/core/src/test/org/apache/lucene/util/mutable/TestMutableValues.java b/lucene/core/src/test/org/apache/lucene/util/mutable/TestMutableValues.java index da3d4f0400b..1c02b12a63d 100644 --- a/lucene/core/src/test/org/apache/lucene/util/mutable/TestMutableValues.java +++ b/lucene/core/src/test/org/apache/lucene/util/mutable/TestMutableValues.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.util.mutable; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** Simple test of the basic contract of the various {@link MutableValue} implementaitons. */ public class TestMutableValues extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectMonotonic.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectMonotonic.java index 6739d44b7c6..ff7c3ccce22 100644 --- a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectMonotonic.java +++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectMonotonic.java @@ -25,10 +25,10 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.LongValues; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestDirectMonotonic extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java index c4e4f98d4f4..b4e04e8d862 100644 --- a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java +++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java @@ -22,9 +22,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.LongValues; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestDirectPacked extends LuceneTestCase { diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java index 15875267a46..d1902028688 100644 --- a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java +++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java @@ -31,12 +31,12 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.RamUsageTester; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.LongValues; import org.apache.lucene.util.LongsRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.RamUsageTester; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.packed.PackedInts.Reader; import org.junit.Ignore; diff --git a/lucene/demo/src/test/org/apache/lucene/demo/TestDemo.java b/lucene/demo/src/test/org/apache/lucene/demo/TestDemo.java index da326951451..daefcd86ad2 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/TestDemo.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/TestDemo.java @@ -20,7 +20,7 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.nio.charset.Charset; import java.nio.file.Path; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDemo extends LuceneTestCase { diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestAssociationsFacetsExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestAssociationsFacetsExample.java index ab6e76d0b36..ddb8e8f4c81 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestAssociationsFacetsExample.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestAssociationsFacetsExample.java @@ -18,7 +18,7 @@ package org.apache.lucene.demo.facet; import java.util.List; import org.apache.lucene.facet.FacetResult; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestAssociationsFacetsExample extends LuceneTestCase { diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestDistanceFacetsExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestDistanceFacetsExample.java index b5a2b12e99a..5df2e63b2ef 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestDistanceFacetsExample.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestDistanceFacetsExample.java @@ -18,7 +18,7 @@ package org.apache.lucene.demo.facet; import org.apache.lucene.facet.FacetResult; import org.apache.lucene.search.TopDocs; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDistanceFacetsExample extends LuceneTestCase { diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestExpressionAggregationFacetsExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestExpressionAggregationFacetsExample.java index c7c4b1c8e5c..5f40f22d023 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestExpressionAggregationFacetsExample.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestExpressionAggregationFacetsExample.java @@ -17,7 +17,7 @@ package org.apache.lucene.demo.facet; import org.apache.lucene.facet.FacetResult; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestExpressionAggregationFacetsExample extends LuceneTestCase { diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestMultiCategoryListsFacetsExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestMultiCategoryListsFacetsExample.java index 69d4bba3c76..1e4e401687c 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestMultiCategoryListsFacetsExample.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestMultiCategoryListsFacetsExample.java @@ -18,7 +18,7 @@ package org.apache.lucene.demo.facet; import java.util.List; import org.apache.lucene.facet.FacetResult; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestMultiCategoryListsFacetsExample extends LuceneTestCase { diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestRangeFacetsExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestRangeFacetsExample.java index d49694db285..ccb21ce064d 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestRangeFacetsExample.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestRangeFacetsExample.java @@ -18,7 +18,7 @@ package org.apache.lucene.demo.facet; import org.apache.lucene.facet.FacetResult; import org.apache.lucene.search.TopDocs; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestRangeFacetsExample extends LuceneTestCase { diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleFacetsExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleFacetsExample.java index 50cf2820cb7..30af60cc677 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleFacetsExample.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleFacetsExample.java @@ -18,7 +18,7 @@ package org.apache.lucene.demo.facet; import java.util.List; import org.apache.lucene.facet.FacetResult; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestSimpleFacetsExample extends LuceneTestCase { diff --git a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleSortedSetFacetsExample.java b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleSortedSetFacetsExample.java index 624b5734d92..2f97b86834d 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleSortedSetFacetsExample.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/facet/TestSimpleSortedSetFacetsExample.java @@ -18,7 +18,7 @@ package org.apache.lucene.demo.facet; import java.util.List; import org.apache.lucene.facet.FacetResult; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; // We require sorted set DVs: diff --git a/lucene/demo/src/test/org/apache/lucene/demo/knn/TestDemoEmbeddings.java b/lucene/demo/src/test/org/apache/lucene/demo/knn/TestDemoEmbeddings.java index cbdacc3f1ab..24779b61ce4 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/knn/TestDemoEmbeddings.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/knn/TestDemoEmbeddings.java @@ -21,8 +21,8 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.file.Path; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.VectorUtil; public class TestDemoEmbeddings extends LuceneTestCase { diff --git a/lucene/demo/src/test/org/apache/lucene/demo/knn/TestKnnVectorDict.java b/lucene/demo/src/test/org/apache/lucene/demo/knn/TestKnnVectorDict.java index 351fe8bb4c2..ac42fd6c294 100644 --- a/lucene/demo/src/test/org/apache/lucene/demo/knn/TestKnnVectorDict.java +++ b/lucene/demo/src/test/org/apache/lucene/demo/knn/TestKnnVectorDict.java @@ -20,8 +20,8 @@ import java.io.IOException; import java.nio.file.Path; import java.util.Arrays; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestKnnVectorDict extends LuceneTestCase { diff --git a/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestModularLayer.java b/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestModularLayer.java index 56270899060..182960fedd6 100644 --- a/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestModularLayer.java +++ b/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestModularLayer.java @@ -27,6 +27,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.TreeMap; @@ -146,7 +147,8 @@ public class TestModularLayer { "org.apache.lucene.sandbox", "org.apache.lucene.spatial3d", "org.apache.lucene.spatial_extras", - "org.apache.lucene.suggest"); + "org.apache.lucene.suggest", + "org.apache.lucene.test_framework"); } /** Make sure we don't publish automatic modules. */ @@ -255,6 +257,7 @@ public class TestModularLayer { public void testAllOpenPackagesInSync() throws IOException { for (var module : allCoreModules) { Set jarPackages = getJarPackages(module); + Set moduleExports = new HashSet<>(module.descriptor().exports()); if (module.descriptor().name().equals("org.apache.lucene.luke")) { jarPackages.removeIf( @@ -264,7 +267,25 @@ public class TestModularLayer { }); } - Set moduleExports = module.descriptor().exports(); + if (module.descriptor().name().equals("org.apache.lucene.core")) { + // Internal packages should not be exported to unqualified targets. + jarPackages.removeIf( + entry -> { + return entry.startsWith("org.apache.lucene.internal"); + }); + + // Internal packages should use qualified exports. + moduleExports.removeIf( + export -> { + boolean isInternal = export.source().startsWith("org.apache.lucene.internal"); + if (isInternal) { + Assertions.assertThat(export.targets()) + .containsExactlyInAnyOrder("org.apache.lucene.test_framework"); + } + return isInternal; + }); + } + Assertions.assertThat(moduleExports) .as("Exported packages in module: " + module.descriptor().name()) .allSatisfy( diff --git a/lucene/distribution/binary-release.gradle b/lucene/distribution/binary-release.gradle index be2ae6005ea..1a18838a44e 100644 --- a/lucene/distribution/binary-release.gradle +++ b/lucene/distribution/binary-release.gradle @@ -26,7 +26,6 @@ configure(project(":lucene:distribution")) { docs jars - jarsTestFramework jarsThirdParty binaryDirForTests @@ -35,24 +34,15 @@ configure(project(":lucene:distribution")) { dependencies { DependencyHandler handler -> docs project(path: ':lucene:documentation', configuration: 'site') - // Maven-published submodule JARs are part of the binary distribution - // (with a few exceptions explicitly filtered below). + // Maven-published submodule JARs are part of the binary distribution. // We don't copy their transitive dependencies. - def binaryModules = rootProject.ext.mavenProjects.findAll { p -> !(p in [ - // Placed in a separate folder (module layer conflicts). - project(":lucene:test-framework"), - ]) } + def binaryModules = rootProject.ext.mavenProjects for (Project module : binaryModules) { jars(module, { transitive = false }) } - // The test framework has split packages and breaks the module system layer so - // it's in a separate folder. - jarsTestFramework(project(":lucene:test-framework"), { - transitive = false - }) // The third-party JARs consist of all the transitive dependencies from these modules. // Not sure whether we have to include all the thirdparty JARs from across all the modules. @@ -108,9 +98,6 @@ configure(project(":lucene:distribution")) { from(configurations.jars, { into 'modules' }) - from(configurations.jarsTestFramework, { - into 'modules-test-framework' - }) // Binary modules (with dependencies). Don't duplicate project artifacts. from((configurations.jarsThirdParty - configurations.jars), { diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/TestDemoExpressions.java b/lucene/expressions/src/test/org/apache/lucene/expressions/TestDemoExpressions.java index 1dba2a68ea7..7190a46b5b8 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/TestDemoExpressions.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/TestDemoExpressions.java @@ -26,7 +26,6 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.expressions.js.JavascriptCompiler; import org.apache.lucene.expressions.js.VariableContext; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.FieldDoc; @@ -37,7 +36,8 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopFieldDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** simple demo of using expressions */ public class TestDemoExpressions extends LuceneTestCase { diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java index 56c3188d7d5..57a7b6054dd 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionRescorer.java @@ -22,7 +22,6 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.expressions.js.JavascriptCompiler; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.IndexSearcher; @@ -32,7 +31,8 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestExpressionRescorer extends LuceneTestCase { IndexSearcher searcher; diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionSortField.java b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionSortField.java index 378cd741fec..e02fff5ed1b 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionSortField.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionSortField.java @@ -19,7 +19,7 @@ package org.apache.lucene.expressions; import org.apache.lucene.expressions.js.JavascriptCompiler; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.SortField; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestExpressionSortField extends LuceneTestCase { diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionSorts.java b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionSorts.java index 3f33365b6b0..66d1d534c91 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionSorts.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionSorts.java @@ -25,11 +25,9 @@ import org.apache.lucene.document.FloatDocValuesField; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.expressions.js.JavascriptCompiler; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; @@ -39,10 +37,12 @@ import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** * Tests some basic expressions against different queries, and fieldcache/docvalues fields against diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java index d62d3246a41..dbb98dbf749 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValidation.java @@ -18,7 +18,7 @@ package org.apache.lucene.expressions; import org.apache.lucene.expressions.js.JavascriptCompiler; import org.apache.lucene.search.DoubleValuesSource; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Tests validation of bindings */ public class TestExpressionValidation extends LuceneTestCase { diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValueSource.java b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValueSource.java index 2d60d9828c7..c1ad8c31ab6 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValueSource.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/TestExpressionValueSource.java @@ -17,7 +17,6 @@ package org.apache.lucene.expressions; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -25,12 +24,13 @@ import org.apache.lucene.expressions.js.JavascriptCompiler; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.DoubleValues; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestExpressionValueSource extends LuceneTestCase { DirectoryReader reader; diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java index 7789684d328..0542d7ef4ec 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestCustomFunctions.java @@ -24,7 +24,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.lucene.expressions.Expression; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestExpressionMath.java b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestExpressionMath.java index 8b16730ba6e..5428a9e4e98 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestExpressionMath.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestExpressionMath.java @@ -20,7 +20,7 @@ package org.apache.lucene.expressions.js; import static org.apache.lucene.expressions.js.ExpressionMath.haversinKilometers; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestExpressionMath extends LuceneTestCase { diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java index 295eea8ea57..6c15afb1239 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptCompiler.java @@ -18,7 +18,7 @@ package org.apache.lucene.expressions.js; import java.text.ParseException; import org.apache.lucene.expressions.Expression; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestJavascriptCompiler extends LuceneTestCase { diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptFunction.java b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptFunction.java index d9a9859416f..3976ced9ae1 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptFunction.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptFunction.java @@ -17,7 +17,7 @@ package org.apache.lucene.expressions.js; import org.apache.lucene.expressions.Expression; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestJavascriptFunction extends LuceneTestCase { private static double DELTA = 0.0000001; diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptOperations.java b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptOperations.java index ac1b125fa56..22ccc83d0eb 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptOperations.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestJavascriptOperations.java @@ -17,7 +17,7 @@ package org.apache.lucene.expressions.js; import org.apache.lucene.expressions.Expression; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestJavascriptOperations extends LuceneTestCase { private void assertEvaluatesTo(String expression, long expected) throws Exception { diff --git a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestVariableContext.java b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestVariableContext.java index a0a60d58cc9..5b75b78f071 100644 --- a/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestVariableContext.java +++ b/lucene/expressions/src/test/org/apache/lucene/expressions/js/TestVariableContext.java @@ -21,7 +21,7 @@ import static org.apache.lucene.expressions.js.VariableContext.Type.MEMBER; import static org.apache.lucene.expressions.js.VariableContext.Type.METHOD; import static org.apache.lucene.expressions.js.VariableContext.Type.STR_INDEX; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestVariableContext extends LuceneTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java index 2f2976382f4..e83b3868388 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java @@ -31,9 +31,9 @@ import org.apache.lucene.facet.taxonomy.TaxonomyFacetLabels; import org.apache.lucene.facet.taxonomy.TaxonomyFacetLabels.FacetLabelReader; import org.apache.lucene.facet.taxonomy.TaxonomyReader; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public abstract class FacetTestCase extends LuceneTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestDrillDownQuery.java b/lucene/facet/src/test/org/apache/lucene/facet/TestDrillDownQuery.java index 8f216f3abd3..fdac9935eee 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestDrillDownQuery.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestDrillDownQuery.java @@ -19,8 +19,6 @@ package org.apache.lucene.facet; import java.io.IOException; import java.util.Arrays; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -29,16 +27,18 @@ import org.apache.lucene.facet.taxonomy.TaxonomyWriter; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; import org.apache.lucene.util.IOUtils; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java b/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java index 4250fbf7332..b721f9ca214 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestDrillSideways.java @@ -30,7 +30,6 @@ import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.stream.Collectors; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; @@ -46,7 +45,6 @@ import org.apache.lucene.index.DocValues; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; @@ -75,12 +73,14 @@ import org.apache.lucene.search.TotalHits; import org.apache.lucene.search.TwoPhaseIterator; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.InPlaceMergeSorter; import org.apache.lucene.util.InfoStream; import org.apache.lucene.util.NamedThreadFactory; -import org.apache.lucene.util.TestUtil; public class TestDrillSideways extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestFacetQuery.java b/lucene/facet/src/test/org/apache/lucene/facet/TestFacetQuery.java index 6da83b93e33..da012e3f0a8 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestFacetQuery.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestFacetQuery.java @@ -17,18 +17,18 @@ package org.apache.lucene.facet; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexableField; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.IOUtils; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestFacetUtils.java b/lucene/facet/src/test/org/apache/lucene/facet/TestFacetUtils.java index 910a329c276..adbd6ffaad9 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestFacetUtils.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestFacetUtils.java @@ -24,16 +24,16 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.DocValues; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestFacetUtils extends LuceneTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestFacetsConfig.java b/lucene/facet/src/test/org/apache/lucene/facet/TestFacetsConfig.java index fc15cf240e0..c9aafbb67a5 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestFacetsConfig.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestFacetsConfig.java @@ -17,7 +17,6 @@ package org.apache.lucene.facet; import java.util.Arrays; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; @@ -26,8 +25,9 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; public class TestFacetsConfig extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestLongValueFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/TestLongValueFacetCounts.java index 08d70dcbcb7..af1b74f42fd 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestLongValueFacetCounts.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestLongValueFacetCounts.java @@ -30,14 +30,14 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.LongValuesSource; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** Tests long value facets. */ public class TestLongValueFacetCounts extends LuceneTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestMultipleIndexFields.java b/lucene/facet/src/test/org/apache/lucene/facet/TestMultipleIndexFields.java index 759b53646de..89cdc6fad32 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestMultipleIndexFields.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestMultipleIndexFields.java @@ -19,8 +19,6 @@ package org.apache.lucene.facet; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -32,10 +30,12 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.IOUtils; import org.junit.Test; diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestRandomSamplingFacetsCollector.java b/lucene/facet/src/test/org/apache/lucene/facet/TestRandomSamplingFacetsCollector.java index 45a0a1cbb4f..26d80fc784f 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestRandomSamplingFacetsCollector.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestRandomSamplingFacetsCollector.java @@ -26,13 +26,13 @@ import org.apache.lucene.facet.taxonomy.FastTaxonomyFacetCounts; import org.apache.lucene.facet.taxonomy.TaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MultiCollector; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.IOUtils; public class TestRandomSamplingFacetsCollector extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/TestStringValueFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/TestStringValueFacetCounts.java index 2dc4ccc44bf..765c6759260 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/TestStringValueFacetCounts.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/TestStringValueFacetCounts.java @@ -30,14 +30,14 @@ import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestStringValueFacetCounts extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java index e7959101ce7..1ca5007e93f 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java @@ -45,7 +45,6 @@ import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.DoubleValues; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.Explanation; @@ -59,9 +58,10 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Scorer; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; public class TestRangeFacetCounts extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java b/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java index bd24a75918e..d6e9b0b3bf2 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/sortedset/TestSortedSetDocValuesFacets.java @@ -37,17 +37,17 @@ import org.apache.lucene.facet.FacetsCollector; import org.apache.lucene.facet.FacetsConfig; import org.apache.lucene.facet.LabelAndValue; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Accountable; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; -import org.apache.lucene.util.TestUtil; public class TestSortedSetDocValuesFacets extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java index f1aa8c33638..90403610a62 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestFacetLabel.java @@ -19,8 +19,8 @@ package org.apache.lucene.facet.taxonomy; import org.apache.lucene.facet.FacetField; import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetField; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; import org.junit.Test; public class TestFacetLabel extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestOrdinalMappingLeafReader.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestOrdinalMappingLeafReader.java index d3d15aa92fa..27badb7b0e3 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestOrdinalMappingLeafReader.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestOrdinalMappingLeafReader.java @@ -34,10 +34,10 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.MultiDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.junit.Before; diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java index 2bb98f684bb..3f4c7adeec3 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestSearcherTaxonomyManager.java @@ -22,7 +22,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.facet.FacetField; import org.apache.lucene.facet.FacetResult; @@ -40,9 +39,10 @@ import org.apache.lucene.index.TieredMergePolicy; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.ReferenceManager; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; @LuceneTestCase.SuppressCodecs("SimpleText") public class TestSearcherTaxonomyManager extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java index 966a0ac6fa7..9ba03c4eb92 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java @@ -27,7 +27,7 @@ import org.apache.lucene.facet.SlowDirectory; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; import org.junit.Test; @SuppressCodecs("SimpleText") diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java index a07b4e11eae..41445dbb696 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java @@ -25,10 +25,10 @@ import org.apache.lucene.facet.FacetsConfig; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.IOUtils; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java index 8cb23f0617c..82a1be52c74 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts.java @@ -26,7 +26,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; @@ -44,7 +43,6 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; @@ -54,8 +52,10 @@ import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; public class TestTaxonomyFacetCounts extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts2.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts2.java index 8642a347bcb..0b94272c46a 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts2.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetCounts2.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; @@ -46,6 +45,7 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.IOUtils; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetLabels.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetLabels.java index bdca7d82660..3b510b9157e 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetLabels.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetLabels.java @@ -31,11 +31,11 @@ import org.apache.lucene.facet.FacetsConfig; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.IOUtils; public class TestTaxonomyFacetLabels extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java index 34a4d9af045..654a95bc2b2 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java @@ -20,7 +20,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FloatDocValuesField; @@ -38,7 +37,6 @@ import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.function.FunctionQuery; import org.apache.lucene.queries.function.valuesource.LongFieldSource; @@ -51,8 +49,10 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; public class TestTaxonomyFacetSumValueSource extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java index 58d0a3de78f..88b88c176dd 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java @@ -27,9 +27,9 @@ import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.DiskOr import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.MemoryOrdinalMap; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.OrdinalMap; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; @LuceneTestCase.SuppressCodecs("SimpleText") public class TestAddTaxonomy extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java index cff8dc24a30..b5d16362534 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Random; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.taxonomy.FacetLabel; import org.apache.lucene.facet.taxonomy.TaxonomyReader; @@ -37,6 +36,7 @@ import org.apache.lucene.index.LogMergePolicy; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.util.IOUtils; import org.junit.Test; diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java index 6483c52d320..13115864eb9 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java @@ -23,7 +23,6 @@ import java.util.Map; import java.util.Random; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.facet.DrillDownQuery; import org.apache.lucene.facet.FacetField; @@ -44,8 +43,9 @@ import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; import org.junit.Test; public class TestDirectoryTaxonomyWriter extends FacetTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/Test2GBCharBlockArray.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/Test2GBCharBlockArray.java index 55f06aa8469..64c195cd528 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/Test2GBCharBlockArray.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/Test2GBCharBlockArray.java @@ -16,9 +16,9 @@ */ package org.apache.lucene.facet.taxonomy.writercache; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.TestUtil; @Monster("uses lots of space and takes a few minutes") public class Test2GBCharBlockArray extends LuceneTestCase { diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestUTF8TaxonomyWriterCache.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestUTF8TaxonomyWriterCache.java index 85e60ac1b51..321d0a5098b 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestUTF8TaxonomyWriterCache.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestUTF8TaxonomyWriterCache.java @@ -24,7 +24,7 @@ import java.util.Random; import java.util.Set; import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.taxonomy.FacetLabel; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; public class TestUTF8TaxonomyWriterCache extends FacetTestCase { public void testPageOverflow() throws Exception { diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/AbstractGroupingTestCase.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/AbstractGroupingTestCase.java index 0156acb395a..a847034bf7e 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/AbstractGroupingTestCase.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/AbstractGroupingTestCase.java @@ -18,14 +18,14 @@ package org.apache.lucene.search.grouping; import java.io.Closeable; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Base class for grouping related tests. */ // TODO (MvG) : The grouping tests contain a lot of code duplication. Try to move the common code to diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/BaseGroupSelectorTestCase.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/BaseGroupSelectorTestCase.java index d3e84aff69f..5aa0c4b0bfe 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/BaseGroupSelectorTestCase.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/BaseGroupSelectorTestCase.java @@ -26,7 +26,6 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.TextField; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -37,6 +36,7 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestAllGroupHeadsCollector.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestAllGroupHeadsCollector.java index a822f0965ae..0ab8204eece 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestAllGroupHeadsCollector.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestAllGroupHeadsCollector.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -38,7 +37,6 @@ import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.valuesource.BytesRefFieldSource; @@ -49,11 +47,13 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestAllGroupHeadsCollector extends LuceneTestCase { diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestAllGroupsCollector.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestAllGroupsCollector.java index 73e7dc059fc..220c4ed761a 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestAllGroupsCollector.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestAllGroupsCollector.java @@ -17,21 +17,21 @@ package org.apache.lucene.search.grouping; import java.util.HashMap; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.TextField; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.valuesource.BytesRefFieldSource; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestAllGroupsCollector extends LuceneTestCase { diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestBlockGrouping.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestBlockGrouping.java index e70ed27a8c7..b60f0a4becb 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestBlockGrouping.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestBlockGrouping.java @@ -25,7 +25,6 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.TextField; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -37,6 +36,7 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; public class TestBlockGrouping extends AbstractGroupingTestCase { diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestDistinctValuesCollector.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestDistinctValuesCollector.java index d8fe9e60bad..295add673b8 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestDistinctValuesCollector.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestDistinctValuesCollector.java @@ -29,14 +29,12 @@ import java.util.Locale; import java.util.Map; import java.util.Random; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.function.valuesource.BytesRefFieldSource; import org.apache.lucene.search.IndexSearcher; @@ -44,6 +42,8 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.mutable.MutableValue; import org.apache.lucene.util.mutable.MutableValueStr; diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestDoubleRangeFactory.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestDoubleRangeFactory.java index 0e52ef24e54..d42f5818d5b 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestDoubleRangeFactory.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestDoubleRangeFactory.java @@ -17,7 +17,7 @@ package org.apache.lucene.search.grouping; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDoubleRangeFactory extends LuceneTestCase { diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGroupFacetCollector.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGroupFacetCollector.java index 8060e152311..24b13856fe4 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGroupFacetCollector.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGroupFacetCollector.java @@ -29,7 +29,6 @@ import java.util.NavigableSet; import java.util.Random; import java.util.Set; import java.util.TreeSet; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -38,14 +37,15 @@ import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; public class TestGroupFacetCollector extends AbstractGroupingTestCase { diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java index 1e0134141d3..88877d0700b 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java @@ -27,7 +27,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -41,7 +40,6 @@ import org.apache.lucene.index.IndexReaderContext; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.ReaderUtil; import org.apache.lucene.index.Term; import org.apache.lucene.queries.function.ValueSource; @@ -61,9 +59,11 @@ import org.apache.lucene.search.TotalHits; import org.apache.lucene.search.Weight; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.mutable.MutableValue; import org.apache.lucene.util.mutable.MutableValueStr; diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGroupingSearch.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGroupingSearch.java index bdaa12af5ac..95132d735a5 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGroupingSearch.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGroupingSearch.java @@ -19,14 +19,12 @@ package org.apache.lucene.search.grouping; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.queries.function.valuesource.BytesRefFieldSource; @@ -36,8 +34,10 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.mutable.MutableValueStr; public class TestGroupingSearch extends LuceneTestCase { diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestLongRangeFactory.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestLongRangeFactory.java index 70c1d94c039..eb9ae100175 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestLongRangeFactory.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestLongRangeFactory.java @@ -17,7 +17,7 @@ package org.apache.lucene.search.grouping; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLongRangeFactory extends LuceneTestCase { diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestTopGroups.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestTopGroups.java index c547525398e..8740b639fa7 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestTopGroups.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestTopGroups.java @@ -19,7 +19,7 @@ package org.apache.lucene.search.grouping; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.Sort; import org.apache.lucene.search.TotalHits; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestTopGroups extends LuceneTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestHighlighter.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestHighlighter.java index 52e5c1bbb8e..895a7044cb6 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestHighlighter.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestHighlighter.java @@ -30,14 +30,7 @@ import java.util.StringTokenizer; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CachingTokenFilter; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockPayloadAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.ngram.NGramTokenizer; @@ -88,8 +81,15 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.search.highlight.SynonymTokenizer.TestHighlightRunner; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockPayloadAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestHighlighterPhrase.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestHighlighterPhrase.java index 33d3ee31ba5..1734296ac7b 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestHighlighterPhrase.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestHighlighterPhrase.java @@ -17,10 +17,6 @@ package org.apache.lucene.search.highlight; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; @@ -46,8 +42,12 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.SimpleCollector; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; public class TestHighlighterPhrase extends LuceneTestCase { private static final String FIELD = "text"; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestMisses.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestMisses.java index ddbdb2f2bbd..f61c4140c67 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestMisses.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestMisses.java @@ -18,8 +18,6 @@ package org.apache.lucene.search.highlight; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanNearQuery; import org.apache.lucene.queries.spans.SpanQuery; @@ -29,7 +27,9 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMisses extends LuceneTestCase { public void testTermQuery() throws IOException, InvalidTokenOffsetsException { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestOffsetLimitTokenFilter.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestOffsetLimitTokenFilter.java index aee0ccd78f8..ab0471cc63e 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestOffsetLimitTokenFilter.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestOffsetLimitTokenFilter.java @@ -18,6 +18,8 @@ package org.apache.lucene.search.highlight; import java.io.StringReader; import org.apache.lucene.analysis.*; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestOffsetLimitTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestTokenSources.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestTokenSources.java index a3c7102c0ef..8b622831ac1 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestTokenSources.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TestTokenSources.java @@ -19,10 +19,6 @@ package org.apache.lucene.search.highlight; import com.carrotsearch.randomizedtesting.annotations.Repeat; import java.io.IOException; import java.util.Arrays; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; @@ -32,12 +28,10 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; -import org.apache.lucene.index.BaseTermVectorsFormatTestCase; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.Fields; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanNearQuery; import org.apache.lucene.queries.spans.SpanQuery; @@ -47,8 +41,14 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.BaseTermVectorsFormatTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; // LUCENE-2874 diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/custom/TestHighlightCustomQuery.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/custom/TestHighlightCustomQuery.java index 367b79620f3..97e0baf6e91 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/custom/TestHighlightCustomQuery.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/custom/TestHighlightCustomQuery.java @@ -20,10 +20,6 @@ import java.io.IOException; import java.util.Collections; import java.util.Map; import java.util.Objects; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; @@ -38,7 +34,11 @@ import org.apache.lucene.search.highlight.SimpleFragmenter; import org.apache.lucene.search.highlight.SimpleHTMLFormatter; import org.apache.lucene.search.highlight.WeightedSpanTerm; import org.apache.lucene.search.highlight.WeightedSpanTermExtractor; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; /** * Tests the extensibility of {@link WeightedSpanTermExtractor} and {@link QueryScorer} in a user diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/IndexBuilder.java b/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/IndexBuilder.java index 55d63cf17f2..37546e68698 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/IndexBuilder.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/IndexBuilder.java @@ -33,7 +33,7 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** * Utility class for building an ephemeral document index and running a block of code on its reader. diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestMatchHighlighter.java b/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestMatchHighlighter.java index f22150464d2..c6a6261b8b3 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestMatchHighlighter.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestMatchHighlighter.java @@ -59,8 +59,8 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.CharsRef; -import org.apache.lucene.util.LuceneTestCase; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.Before; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestMatchRegionRetriever.java b/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestMatchRegionRetriever.java index dac77c141b6..16a769e2b9e 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestMatchRegionRetriever.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestMatchRegionRetriever.java @@ -63,7 +63,7 @@ import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.Before; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestPassageSelector.java b/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestPassageSelector.java index e7ffc63ca32..95fa8730991 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestPassageSelector.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/matchhighlight/TestPassageSelector.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.Test; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestCustomSeparatorBreakIterator.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestCustomSeparatorBreakIterator.java index 0c4004f3ddb..eb7dd0b10cf 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestCustomSeparatorBreakIterator.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestCustomSeparatorBreakIterator.java @@ -22,7 +22,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import com.carrotsearch.randomizedtesting.generators.RandomPicks; import java.text.BreakIterator; import java.util.Locale; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCustomSeparatorBreakIterator extends LuceneTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestDefaultPassageFormatter.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestDefaultPassageFormatter.java index 15fb96eb26a..eb772acf0e1 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestDefaultPassageFormatter.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestDefaultPassageFormatter.java @@ -17,7 +17,7 @@ package org.apache.lucene.search.uhighlight; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDefaultPassageFormatter extends LuceneTestCase { public void testBasic() throws Exception { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestLengthGoalBreakIterator.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestLengthGoalBreakIterator.java index 67c62b0b6af..9b5d844a460 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestLengthGoalBreakIterator.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestLengthGoalBreakIterator.java @@ -20,10 +20,10 @@ package org.apache.lucene.search.uhighlight; import java.io.IOException; import java.text.BreakIterator; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.search.Query; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.QueryBuilder; public class TestLengthGoalBreakIterator extends LuceneTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestSplittingBreakIterator.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestSplittingBreakIterator.java index e09056d6d61..084c5c20020 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestSplittingBreakIterator.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestSplittingBreakIterator.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Locale; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSplittingBreakIterator extends LuceneTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java index af147eef198..482644d4243 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java @@ -31,14 +31,11 @@ import java.util.Objects; import java.util.Set; import java.util.function.Predicate; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -57,7 +54,10 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.Weight; import org.apache.lucene.search.uhighlight.UnifiedHighlighter.HighlightFlag; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Before; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterMTQ.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterMTQ.java index 192231f47db..4f7bd056ca1 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterMTQ.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterMTQ.java @@ -24,8 +24,6 @@ import java.util.Collections; import java.util.EnumSet; import java.util.Objects; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordAnalyzer; @@ -34,7 +32,6 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanFirstQuery; import org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper; @@ -64,9 +61,12 @@ import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.search.uhighlight.UnifiedHighlighter.HighlightFlag; -import org.apache.lucene.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.UnicodeUtil; import org.junit.After; import org.junit.Before; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterRanking.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterRanking.java index 3c28afc5537..592c899cf6b 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterRanking.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterRanking.java @@ -22,15 +22,12 @@ import java.util.HashSet; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -40,9 +37,12 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestUnifiedHighlighterRanking extends LuceneTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterReanalysis.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterReanalysis.java index 74c76e8546e..fd7f84847b3 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterReanalysis.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterReanalysis.java @@ -17,10 +17,7 @@ package org.apache.lucene.search.uhighlight; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -28,7 +25,10 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestUnifiedHighlighterReanalysis extends LuceneTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterStrictPhrases.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterStrictPhrases.java index 3f6271153fd..8116ece1c1c 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterStrictPhrases.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterStrictPhrases.java @@ -24,13 +24,10 @@ import java.util.EnumSet; import java.util.Locale; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper; import org.apache.lucene.queries.spans.SpanNearQuery; @@ -57,8 +54,11 @@ import org.apache.lucene.search.Weight; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.search.uhighlight.UnifiedHighlighter.HighlightFlag; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.QueryBuilder; import org.junit.After; import org.junit.Before; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterTermIntervals.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterTermIntervals.java index 7541c502ffa..b3ff90662c5 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterTermIntervals.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterTermIntervals.java @@ -30,14 +30,11 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.intervals.IntervalQuery; import org.apache.lucene.queries.intervals.Intervals; @@ -50,7 +47,10 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.uhighlight.UnifiedHighlighter.HighlightFlag; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Before; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterTermVec.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterTermVec.java index a28bcf7f384..27296a6b0a1 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterTermVec.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterTermVec.java @@ -25,8 +25,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -38,7 +36,6 @@ import org.apache.lucene.index.FilterLeafReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.ParallelLeafReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -47,7 +44,10 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestWholeBreakIterator.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestWholeBreakIterator.java index 16dcd49fdea..1fbca805f6a 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestWholeBreakIterator.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestWholeBreakIterator.java @@ -20,7 +20,7 @@ import java.text.BreakIterator; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.util.Locale; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestWholeBreakIterator extends LuceneTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/visibility/TestUnifiedHighlighterExtensibility.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/visibility/TestUnifiedHighlighterExtensibility.java index 844283ff4ca..d6ce6464d4c 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/visibility/TestUnifiedHighlighterExtensibility.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/visibility/TestUnifiedHighlighterExtensibility.java @@ -25,7 +25,6 @@ import java.util.Map; import java.util.Set; import java.util.function.Predicate; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanQuery; @@ -44,8 +43,9 @@ import org.apache.lucene.search.uhighlight.PhraseHelper; import org.apache.lucene.search.uhighlight.SplittingBreakIterator; import org.apache.lucene.search.uhighlight.UHComponents; import org.apache.lucene.search.uhighlight.UnifiedHighlighter; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /** Helps us be aware of visibility/extensibility concerns. */ diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java index cfb66c1f2d1..8542a45aab7 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java @@ -41,8 +41,10 @@ import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public abstract class AbstractTestCase extends LuceneTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestBreakIteratorBoundaryScanner.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestBreakIteratorBoundaryScanner.java index 6b138b95ec4..3f56d345979 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestBreakIteratorBoundaryScanner.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestBreakIteratorBoundaryScanner.java @@ -18,7 +18,7 @@ package org.apache.lucene.search.vectorhighlight; import java.text.BreakIterator; import java.util.Locale; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestBreakIteratorBoundaryScanner extends LuceneTestCase { static final String TEXT = diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFastVectorHighlighter.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFastVectorHighlighter.java index 451bdc33933..81e8cef9208 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFastVectorHighlighter.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFastVectorHighlighter.java @@ -22,12 +22,7 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; import org.apache.lucene.analysis.DelegatingAnalyzerWrapper; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -53,7 +48,12 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.highlight.DefaultEncoder; import org.apache.lucene.search.highlight.Encoder; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldPhraseList.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldPhraseList.java index f96f5c1990c..8396423e37b 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldPhraseList.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldPhraseList.java @@ -22,7 +22,7 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.vectorhighlight.FieldPhraseList.WeightedPhraseInfo; import org.apache.lucene.search.vectorhighlight.FieldPhraseList.WeightedPhraseInfo.Toffs; import org.apache.lucene.search.vectorhighlight.FieldTermStack.TermInfo; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; public class TestFieldPhraseList extends AbstractTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldTermStack.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldTermStack.java index 72efd59f99b..6fb6fe4a124 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldTermStack.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestFieldTermStack.java @@ -21,7 +21,7 @@ import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.search.vectorhighlight.FieldTermStack.TermInfo; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; public class TestFieldTermStack extends AbstractTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestIndexTimeSynonym.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestIndexTimeSynonym.java index a3a2c964fb2..cc91f77453e 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestIndexTimeSynonym.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestIndexTimeSynonym.java @@ -22,6 +22,7 @@ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.vectorhighlight.FieldTermStack.TermInfo; +import org.apache.lucene.tests.analysis.Token; import org.apache.lucene.util.AttributeImpl; public class TestIndexTimeSynonym extends AbstractTestCase { diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestSimpleBoundaryScanner.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestSimpleBoundaryScanner.java index 7d01e5061c7..cff7f92ac3a 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestSimpleBoundaryScanner.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestSimpleBoundaryScanner.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.search.vectorhighlight; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSimpleBoundaryScanner extends LuceneTestCase { static final String TEXT = diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestSimpleFragmentsBuilder.java b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestSimpleFragmentsBuilder.java index c3ef1bb5c50..56f62800e90 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestSimpleFragmentsBuilder.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/TestSimpleFragmentsBuilder.java @@ -22,7 +22,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -32,7 +31,6 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -40,7 +38,9 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.highlight.SimpleHTMLEncoder; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; public class TestSimpleFragmentsBuilder extends AbstractTestCase { diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java index 5f13d59a01d..74b4558b403 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java @@ -27,7 +27,6 @@ import java.util.SortedMap; import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; @@ -46,7 +45,6 @@ import org.apache.lucene.index.MultiBits; import org.apache.lucene.index.MultiTerms; import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.ReaderUtil; import org.apache.lucene.index.Term; import org.apache.lucene.search.*; @@ -55,11 +53,16 @@ import org.apache.lucene.search.similarities.BasicStats; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.search.similarities.SimilarityBase; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.search.RandomApproximationQuery; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BitSet; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestBlockJoin extends LuceneTestCase { diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinScorer.java b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinScorer.java index 4e220dbeac5..22f4ae6a5d7 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinScorer.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinScorer.java @@ -23,7 +23,6 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; @@ -34,8 +33,9 @@ import org.apache.lucene.search.Scorer; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BitSet; -import org.apache.lucene.util.LuceneTestCase; public class TestBlockJoinScorer extends LuceneTestCase { public void testScoreNone() throws IOException { diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinSelector.java b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinSelector.java index 19510055540..bcf1abffe25 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinSelector.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinSelector.java @@ -26,11 +26,11 @@ import org.apache.lucene.index.DocValues; import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BitSet; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; public class TestBlockJoinSelector extends LuceneTestCase { diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinSorting.java b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinSorting.java index c168173f90e..dd5ba445a65 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinSorting.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinSorting.java @@ -19,13 +19,11 @@ package org.apache.lucene.search.join; import java.util.ArrayList; import java.util.List; import java.util.function.Supplier; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.IndexSearcher; @@ -35,8 +33,10 @@ import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopFieldDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /** */ diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java index ba94876a80f..f943ff544de 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoinValidation.java @@ -18,7 +18,6 @@ package org.apache.lucene.search.join; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -37,9 +36,10 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.Weight; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestBlockJoinValidation extends LuceneTestCase { diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestCheckJoinIndex.java b/lucene/join/src/test/org/apache/lucene/search/join/TestCheckJoinIndex.java index d0ef29770e4..2d7e0af8131 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestCheckJoinIndex.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestCheckJoinIndex.java @@ -25,13 +25,13 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestCheckJoinIndex extends LuceneTestCase { diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java b/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java index f5431af816b..cea1862552d 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestJoinUtil.java @@ -33,8 +33,6 @@ import java.util.Random; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.DoubleDocValuesField; import org.apache.lucene.document.DoublePoint; @@ -60,7 +58,6 @@ import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.index.OrdinalMap; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.index.Term; @@ -68,12 +65,15 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.search.*; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BitSet; import org.apache.lucene.util.BitSetIterator; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; import org.junit.Test; diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestParentChildrenBlockJoinQuery.java b/lucene/join/src/test/org/apache/lucene/search/join/TestParentChildrenBlockJoinQuery.java index a6492cfc21f..fa0c2569d72 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestParentChildrenBlockJoinQuery.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestParentChildrenBlockJoinQuery.java @@ -26,7 +26,6 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.ReaderUtil; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; @@ -37,7 +36,8 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestParentChildrenBlockJoinQuery extends LuceneTestCase { diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestQueryBitSetProducer.java b/lucene/join/src/test/org/apache/lucene/search/join/TestQueryBitSetProducer.java index 1d500daea03..d320e3e9f51 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestQueryBitSetProducer.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestQueryBitSetProducer.java @@ -24,13 +24,13 @@ import org.apache.lucene.index.FilterLeafReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestQueryBitSetProducer extends LuceneTestCase { diff --git a/lucene/luke/src/test/org/apache/lucene/luke/app/desktop/util/inifile/TestSimpleIniFile.java b/lucene/luke/src/test/org/apache/lucene/luke/app/desktop/util/inifile/TestSimpleIniFile.java index 9f0c272cb9a..8db6c1c52c2 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/app/desktop/util/inifile/TestSimpleIniFile.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/app/desktop/util/inifile/TestSimpleIniFile.java @@ -25,7 +25,7 @@ import java.nio.file.Path; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestSimpleIniFile extends LuceneTestCase { diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/analysis/TestAnalysisImpl.java b/lucene/luke/src/test/org/apache/lucene/luke/models/analysis/TestAnalysisImpl.java index 3bd789d3b0a..99d1f057358 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/analysis/TestAnalysisImpl.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/analysis/TestAnalysisImpl.java @@ -29,7 +29,7 @@ import java.util.Map; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.custom.CustomAnalyzer; import org.apache.lucene.luke.models.LukeException; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestAnalysisImpl extends LuceneTestCase { diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/commits/TestCommitsImpl.java b/lucene/luke/src/test/org/apache/lucene/luke/models/commits/TestCommitsImpl.java index 261347dbc4e..695db48185f 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/commits/TestCommitsImpl.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/commits/TestCommitsImpl.java @@ -22,17 +22,17 @@ import java.nio.file.Path; import java.util.List; import java.util.Map; import java.util.Optional; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.NoDeletionPolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/DocumentsTestBase.java b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/DocumentsTestBase.java index fded2b76bcb..f933817e8ca 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/DocumentsTestBase.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/DocumentsTestBase.java @@ -27,10 +27,10 @@ import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; import org.junit.After; import org.junit.Before; diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestDocValuesAdapter.java b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestDocValuesAdapter.java index 75ce9945ea2..516180c51ae 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestDocValuesAdapter.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestDocValuesAdapter.java @@ -19,7 +19,6 @@ package org.apache.lucene.luke.models.documents; import java.io.IOException; import java.util.Collections; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -28,8 +27,9 @@ import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.index.DocValuesType; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; import org.junit.Test; diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestDocumentsImpl.java b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestDocumentsImpl.java index 8162b571ca6..47dc6898c87 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestDocumentsImpl.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestDocumentsImpl.java @@ -23,7 +23,7 @@ import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.Term; import org.apache.lucene.luke.models.util.IndexUtils; import org.apache.lucene.store.AlreadyClosedException; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; import org.junit.Test; diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestTermVectorsAdapter.java b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestTermVectorsAdapter.java index 40266b21e39..bfc2456d90c 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestTermVectorsAdapter.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/TestTermVectorsAdapter.java @@ -23,8 +23,8 @@ import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.index.IndexOptions; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.junit.Test; public class TestTermVectorsAdapter extends DocumentsTestBase { diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/overview/OverviewTestBase.java b/lucene/luke/src/test/org/apache/lucene/luke/models/overview/OverviewTestBase.java index 25be9320501..a2b4c5b62ab 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/overview/OverviewTestBase.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/overview/OverviewTestBase.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.nio.file.Path; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -29,9 +28,10 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Before; diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/search/TestSearchImpl.java b/lucene/luke/src/test/org/apache/lucene/luke/models/search/TestSearchImpl.java index 76c6fded59c..7d5a13d9cea 100644 --- a/lucene/luke/src/test/org/apache/lucene/luke/models/search/TestSearchImpl.java +++ b/lucene/luke/src/test/org/apache/lucene/luke/models/search/TestSearchImpl.java @@ -37,7 +37,6 @@ import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.luke.models.LukeException; import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.search.PointRangeQuery; @@ -47,8 +46,9 @@ import org.apache.lucene.search.SortField; import org.apache.lucene.search.SortedNumericSortField; import org.apache.lucene.search.SortedSetSortField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; public class TestSearchImpl extends LuceneTestCase { diff --git a/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java index 25568c6863b..f241693c6bf 100644 --- a/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java +++ b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java @@ -28,8 +28,6 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.LongStream; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockPayloadAnalyzer; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.BinaryPoint; import org.apache.lucene.document.Document; @@ -71,9 +69,11 @@ import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.Similarity; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockPayloadAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Before; import org.junit.Test; diff --git a/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstDirectory.java b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstDirectory.java index c0abada4fc0..21635d2f155 100644 --- a/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstDirectory.java +++ b/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstDirectory.java @@ -29,12 +29,6 @@ import java.util.List; import java.util.Set; import java.util.function.Supplier; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -67,10 +61,16 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.TestUtil; /** * Verifies that Lucene MemoryIndex and RAM-resident Directory have the same behaviour, returning diff --git a/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java b/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java index a39a4d041ac..0bfbfa52149 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/TestHighFreqTerms.java @@ -17,16 +17,16 @@ package org.apache.lucene.misc; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/misc/src/test/org/apache/lucene/misc/TestIndexMergeTool.java b/lucene/misc/src/test/org/apache/lucene/misc/TestIndexMergeTool.java index ddb179a99ed..224bf9c7d5b 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/TestIndexMergeTool.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/TestIndexMergeTool.java @@ -18,7 +18,7 @@ package org.apache.lucene.misc; import org.apache.lucene.index.LogDocMergePolicy; import org.apache.lucene.misc.IndexMergeTool.Options; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.PrintStreamInfoStream; public class TestIndexMergeTool extends LuceneTestCase { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/TestSweetSpotSimilarity.java b/lucene/misc/src/test/org/apache/lucene/misc/TestSweetSpotSimilarity.java index 9ca44d1cf53..17094692c7c 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/TestSweetSpotSimilarity.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/TestSweetSpotSimilarity.java @@ -33,7 +33,7 @@ import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.search.similarities.TFIDFSimilarity; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Test of the SweetSpotSimilarity */ public class TestSweetSpotSimilarity extends LuceneTestCase { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/document/TestLazyDocument.java b/lucene/misc/src/test/org/apache/lucene/misc/document/TestLazyDocument.java index 7315e9ba1cd..9159ad17e09 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/document/TestLazyDocument.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/document/TestLazyDocument.java @@ -31,7 +31,8 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.*; import org.apache.lucene.search.*; import org.apache.lucene.store.*; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Before; diff --git a/lucene/misc/src/test/org/apache/lucene/misc/index/TestIndexRearranger.java b/lucene/misc/src/test/org/apache/lucene/misc/index/TestIndexRearranger.java index fa111a664d1..5d56a702752 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/index/TestIndexRearranger.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/index/TestIndexRearranger.java @@ -34,11 +34,11 @@ import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BitSet; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; public class TestIndexRearranger extends LuceneTestCase { public void testRearrange() throws Exception { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/index/TestIndexSplitter.java b/lucene/misc/src/test/org/apache/lucene/misc/index/TestIndexSplitter.java index e473d8f3062..4f4674a0797 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/index/TestIndexSplitter.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/index/TestIndexSplitter.java @@ -17,10 +17,8 @@ package org.apache.lucene.misc.index; import java.nio.file.Path; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.DocHelper; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; @@ -28,8 +26,10 @@ import org.apache.lucene.index.LogByteSizeMergePolicy; import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.DocHelper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestIndexSplitter extends LuceneTestCase { public void test() throws Exception { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/index/TestMultiPassIndexSplitter.java b/lucene/misc/src/test/org/apache/lucene/misc/index/TestMultiPassIndexSplitter.java index 7924347b21d..4615ad65a35 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/index/TestMultiPassIndexSplitter.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/index/TestMultiPassIndexSplitter.java @@ -16,7 +16,6 @@ */ package org.apache.lucene.misc.index; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -27,8 +26,9 @@ import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestMultiPassIndexSplitter extends LuceneTestCase { IndexReader input; diff --git a/lucene/misc/src/test/org/apache/lucene/misc/index/TestPKIndexSplitter.java b/lucene/misc/src/test/org/apache/lucene/misc/index/TestPKIndexSplitter.java index 2472dc2f2d0..27cf25898af 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/index/TestPKIndexSplitter.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/index/TestPKIndexSplitter.java @@ -20,8 +20,6 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.Locale; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -32,8 +30,10 @@ import org.apache.lucene.index.MultiBits; import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.LuceneTestCase; public class TestPKIndexSplitter extends LuceneTestCase { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/search/TestDiversifiedTopDocsCollector.java b/lucene/misc/src/test/org/apache/lucene/misc/search/TestDiversifiedTopDocsCollector.java index 72aeaaa271c..6e8d9671a51 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/search/TestDiversifiedTopDocsCollector.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/search/TestDiversifiedTopDocsCollector.java @@ -29,7 +29,6 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; @@ -48,8 +47,9 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** * Demonstrates an application of the {@link DiversifiedTopDocsCollector} in assembling a collection diff --git a/lucene/misc/src/test/org/apache/lucene/misc/search/TestDocValuesStatsCollector.java b/lucene/misc/src/test/org/apache/lucene/misc/search/TestDocValuesStatsCollector.java index ab021c251e1..9f9b3e7d49a 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/search/TestDocValuesStatsCollector.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/search/TestDocValuesStatsCollector.java @@ -48,9 +48,9 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MultiCollector; import org.apache.lucene.search.TotalHitCountCollector; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Unit tests for {@link DocValuesStatsCollector}. */ public class TestDocValuesStatsCollector extends LuceneTestCase { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/search/TestMemoryAccountingBitsetCollector.java b/lucene/misc/src/test/org/apache/lucene/misc/search/TestMemoryAccountingBitsetCollector.java index 2329525731e..970e9bca3fa 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/search/TestMemoryAccountingBitsetCollector.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/search/TestMemoryAccountingBitsetCollector.java @@ -21,15 +21,15 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.misc.CollectorMemoryTracker; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MultiCollector; import org.apache.lucene.search.TotalHitCountCollector; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestMemoryAccountingBitsetCollector extends LuceneTestCase { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/store/TestDirectIODirectory.java b/lucene/misc/src/test/org/apache/lucene/misc/store/TestDirectIODirectory.java index b24fc4cefbe..c603502ec15 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/store/TestDirectIODirectory.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/store/TestDirectIODirectory.java @@ -25,10 +25,11 @@ import java.util.OptionalLong; import org.apache.lucene.document.*; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.store.*; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; import org.junit.BeforeClass; public class TestDirectIODirectory extends BaseDirectoryTestCase { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/store/TestHardLinkCopyDirectoryWrapper.java b/lucene/misc/src/test/org/apache/lucene/misc/store/TestHardLinkCopyDirectoryWrapper.java index ef2204ad086..f58530f9fb4 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/store/TestHardLinkCopyDirectoryWrapper.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/store/TestHardLinkCopyDirectoryWrapper.java @@ -25,9 +25,6 @@ import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; import java.util.Collections; import org.apache.lucene.codecs.CodecUtil; -import org.apache.lucene.mockfile.FilterPath; -import org.apache.lucene.mockfile.WindowsFS; -import org.apache.lucene.store.BaseDirectoryTestCase; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.ChecksumIndexInput; import org.apache.lucene.store.Directory; @@ -36,6 +33,9 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.NIOFSDirectory; +import org.apache.lucene.tests.mockfile.FilterPath; +import org.apache.lucene.tests.mockfile.WindowsFS; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; import org.apache.lucene.util.Constants; import org.apache.lucene.util.IOUtils; diff --git a/lucene/misc/src/test/org/apache/lucene/misc/store/TestRAFDirectory.java b/lucene/misc/src/test/org/apache/lucene/misc/store/TestRAFDirectory.java index 2d34f0a5c97..a1732b88d78 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/store/TestRAFDirectory.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/store/TestRAFDirectory.java @@ -18,8 +18,8 @@ package org.apache.lucene.misc.store; import java.io.IOException; import java.nio.file.Path; -import org.apache.lucene.store.BaseDirectoryTestCase; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.store.BaseDirectoryTestCase; /** Tests RAFDirectory */ // See: https://issues.apache.org/jira/browse/SOLR-12028 Tests cannot remove files on Windows diff --git a/lucene/misc/src/test/org/apache/lucene/misc/store/TestWindowsDirectory.java b/lucene/misc/src/test/org/apache/lucene/misc/store/TestWindowsDirectory.java index 9ccc96a5cd5..c4326469f08 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/store/TestWindowsDirectory.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/store/TestWindowsDirectory.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.EnumSet; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Rule; import org.junit.rules.TestRule; diff --git a/lucene/misc/src/test/org/apache/lucene/misc/util/TestCollectorMemoryTracker.java b/lucene/misc/src/test/org/apache/lucene/misc/util/TestCollectorMemoryTracker.java index 5c39d56e20e..4a1a35ff96d 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/util/TestCollectorMemoryTracker.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/util/TestCollectorMemoryTracker.java @@ -18,7 +18,7 @@ package org.apache.lucene.misc.util; import org.apache.lucene.misc.CollectorMemoryTracker; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCollectorMemoryTracker extends LuceneTestCase { public void testAdditionsAndDeletions() { diff --git a/lucene/misc/src/test/org/apache/lucene/misc/util/fst/TestFSTsMisc.java b/lucene/misc/src/test/org/apache/lucene/misc/util/fst/TestFSTsMisc.java index b1888b77582..207b5fbf105 100644 --- a/lucene/misc/src/test/org/apache/lucene/misc/util/fst/TestFSTsMisc.java +++ b/lucene/misc/src/test/org/apache/lucene/misc/util/fst/TestFSTsMisc.java @@ -24,15 +24,15 @@ import java.util.List; import java.util.Random; import java.util.Set; import org.apache.lucene.misc.util.fst.UpToTwoPositiveIntOutputs.TwoLongs; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.fst.FSTTester; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.fst.FST; import org.apache.lucene.util.fst.FSTCompiler; -import org.apache.lucene.util.fst.FSTTester; import org.apache.lucene.util.fst.PositiveIntOutputs; import org.apache.lucene.util.fst.Util; diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/ConcurrentMatcherTestBase.java b/lucene/monitor/src/test/org/apache/lucene/monitor/ConcurrentMatcherTestBase.java index 872571ad7fd..e7c88a94c01 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/ConcurrentMatcherTestBase.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/ConcurrentMatcherTestBase.java @@ -25,7 +25,7 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; public abstract class ConcurrentMatcherTestBase extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/MonitorTestBase.java b/lucene/monitor/src/test/org/apache/lucene/monitor/MonitorTestBase.java index b8fff7e0c77..65017e73247 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/MonitorTestBase.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/MonitorTestBase.java @@ -27,7 +27,7 @@ import org.apache.lucene.queryparser.classic.ParseException; import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public abstract class MonitorTestBase extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestBooleanClauseWeightings.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestBooleanClauseWeightings.java index 83646ffcb9c..fcc26e085df 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestBooleanClauseWeightings.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestBooleanClauseWeightings.java @@ -26,7 +26,7 @@ import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestBooleanClauseWeightings extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestBooleanTermExtractor.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestBooleanTermExtractor.java index ce82237d9ce..80d8f3379f2 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestBooleanTermExtractor.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestBooleanTermExtractor.java @@ -26,7 +26,7 @@ import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestBooleanTermExtractor extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestDocumentBatch.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestDocumentBatch.java index b21e3fe015e..b12df632e63 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestDocumentBatch.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestDocumentBatch.java @@ -23,7 +23,7 @@ import java.io.IOException; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestDocumentBatch extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestExtractors.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestExtractors.java index 934e0299904..86274982050 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestExtractors.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestExtractors.java @@ -30,7 +30,7 @@ import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestExtractors extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestForceNoBulkScoringQuery.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestForceNoBulkScoringQuery.java index 3c7ab1a7da1..28f96c760b3 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestForceNoBulkScoringQuery.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestForceNoBulkScoringQuery.java @@ -32,7 +32,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestForceNoBulkScoringQuery extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryAnalyzer.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryAnalyzer.java index e15533f4c34..935bb745bbe 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryAnalyzer.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryAnalyzer.java @@ -23,8 +23,8 @@ import java.util.HashSet; import java.util.Set; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestQueryAnalyzer extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryTermComparators.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryTermComparators.java index d411e60d516..34e1b9687c3 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryTermComparators.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryTermComparators.java @@ -23,8 +23,8 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.lucene.index.Term; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestQueryTermComparators extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryTermFilter.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryTermFilter.java index b9ef232489e..9deacc1316e 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryTermFilter.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestQueryTermFilter.java @@ -22,8 +22,8 @@ import java.util.Collections; import java.util.function.BiPredicate; import org.apache.lucene.index.Term; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestQueryTermFilter extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestRegexpQueryHandler.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestRegexpQueryHandler.java index a30cde1b66a..dd4dab174ce 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestRegexpQueryHandler.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestRegexpQueryHandler.java @@ -23,11 +23,11 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.core.WhitespaceAnalyzer; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; import org.apache.lucene.search.RegexpQuery; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestRegexpQueryHandler extends BaseTokenStreamTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestSpanExtractors.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestSpanExtractors.java index 6032c10d0bd..d77dcd73f20 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestSpanExtractors.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestSpanExtractors.java @@ -33,7 +33,7 @@ import org.apache.lucene.queries.spans.SpanTermQuery; import org.apache.lucene.queries.spans.SpanWithinQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.RegexpQuery; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSpanExtractors extends LuceneTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestSuffixingNGramTokenizer.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestSuffixingNGramTokenizer.java index 0a19bedcea4..42d862d9950 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestSuffixingNGramTokenizer.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestSuffixingNGramTokenizer.java @@ -19,10 +19,10 @@ package org.apache.lucene.monitor; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.WhitespaceTokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; public class TestSuffixingNGramTokenizer extends BaseTokenStreamTestCase { diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestTermsEnumTokenFilter.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestTermsEnumTokenFilter.java index 3322e6fc391..8283a99274d 100644 --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestTermsEnumTokenFilter.java +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestTermsEnumTokenFilter.java @@ -21,9 +21,9 @@ import java.io.IOException; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefIterator; -import org.apache.lucene.util.LuceneTestCase; public class TestTermsEnumTokenFilter extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/TestCommonTermsQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/TestCommonTermsQuery.java index 72d3c6b52aa..56c498e70ff 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/TestCommonTermsQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/TestCommonTermsQuery.java @@ -23,14 +23,12 @@ import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermStates; import org.apache.lucene.index.Terms; @@ -41,18 +39,20 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.PriorityQueue; -import org.apache.lucene.util.TestUtil; import org.junit.Test; public class TestCommonTermsQuery extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java b/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java index 068923d9af4..e5f3ce04fcc 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java @@ -17,7 +17,6 @@ package org.apache.lucene.queries.function; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -27,17 +26,18 @@ import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.queries.function.valuesource.FloatFieldSource; import org.apache.lucene.queries.function.valuesource.IntFieldSource; import org.apache.lucene.queries.function.valuesource.MultiValuedFloatFieldSource; import org.apache.lucene.queries.function.valuesource.MultiValuedIntFieldSource; import org.apache.lucene.search.SortedNumericSelector; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.Ignore; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestDocValuesFieldSources.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestDocValuesFieldSources.java index e71b651897e..cb82deeb5eb 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestDocValuesFieldSources.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestDocValuesFieldSources.java @@ -18,7 +18,6 @@ package org.apache.lucene.queries.function; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -29,16 +28,17 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.queries.function.valuesource.BytesRefFieldSource; import org.apache.lucene.queries.function.valuesource.LongFieldSource; import org.apache.lucene.queries.function.valuesource.MultiValuedLongFieldSource; import org.apache.lucene.search.SortedNumericSelector.Type; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; public class TestDocValuesFieldSources extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java index d1984e116cc..e935be87a43 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java @@ -20,9 +20,9 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; +import org.apache.lucene.tests.search.QueryUtils; import org.junit.BeforeClass; import org.junit.Test; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionMatchQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionMatchQuery.java index 06627227ab6..793bcc256fe 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionMatchQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionMatchQuery.java @@ -26,9 +26,9 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.TopDocs; +import org.apache.lucene.tests.search.QueryUtils; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQueryExplanations.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQueryExplanations.java index 2c7fe0190c3..cfc588e670e 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQueryExplanations.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQueryExplanations.java @@ -18,9 +18,9 @@ package org.apache.lucene.queries.function; import org.apache.lucene.queries.function.valuesource.ConstValueSource; import org.apache.lucene.queries.function.valuesource.RangeMapFloatFunction; -import org.apache.lucene.search.BaseExplanationTestCase; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.Query; +import org.apache.lucene.tests.search.BaseExplanationTestCase; public class TestFunctionQueryExplanations extends BaseExplanationTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java index 4c09da86142..499f6926b3e 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java @@ -23,7 +23,6 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.queries.function.valuesource.DoubleConstValueSource; import org.apache.lucene.queries.function.valuesource.DoubleFieldSource; import org.apache.lucene.queries.function.valuesource.FloatFieldSource; @@ -40,7 +39,8 @@ import org.apache.lucene.search.SortField; import org.apache.lucene.search.SortField.Type; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** Test that functionquery's getSortField() actually works */ public class TestFunctionQuerySort extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionScoreExplanations.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionScoreExplanations.java index b694842d4a9..1efc9bf3a69 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionScoreExplanations.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionScoreExplanations.java @@ -19,7 +19,6 @@ package org.apache.lucene.queries.function; import java.io.IOException; import org.apache.lucene.index.Term; -import org.apache.lucene.search.BaseExplanationTestCase; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.BoostQuery; @@ -31,6 +30,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.search.similarities.ClassicSimilarity; +import org.apache.lucene.tests.search.BaseExplanationTestCase; public class TestFunctionScoreExplanations extends BaseExplanationTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionScoreQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionScoreQuery.java index 0c1666cb978..a7751c753de 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionScoreQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionScoreQuery.java @@ -40,12 +40,12 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.search.QueryUtils; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestIndexReaderFunctions.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestIndexReaderFunctions.java index fa58d12d6c5..a4354c0fa0b 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestIndexReaderFunctions.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestIndexReaderFunctions.java @@ -19,7 +19,6 @@ package org.apache.lucene.queries.function; import java.util.Arrays; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; @@ -28,9 +27,7 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.LongValuesSource; @@ -43,9 +40,12 @@ import org.apache.lucene.search.SortField; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java index 24f33770bdb..f7221e7a7de 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestLongNormValueSource.java @@ -17,15 +17,12 @@ package org.apache.lucene.queries.function; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.queries.function.valuesource.NormValueSource; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; @@ -35,7 +32,10 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestSortedSetFieldSource.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestSortedSetFieldSource.java index c53197b90ed..7b2a0acd277 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestSortedSetFieldSource.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestSortedSetFieldSource.java @@ -26,8 +26,8 @@ import org.apache.lucene.index.LeafReader; import org.apache.lucene.queries.function.valuesource.SortedSetFieldSource; import org.apache.lucene.search.*; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestSortedSetFieldSource extends LuceneTestCase { public void testSimple() throws Exception { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java index 8f343c78e56..8575990566a 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java @@ -22,7 +22,6 @@ import java.util.Arrays; import java.util.List; import java.util.Map; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -33,11 +32,9 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.function.docvalues.FloatDocValues; import org.apache.lucene.queries.function.valuesource.*; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.DoubleValuesSource; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchNoDocsQuery; @@ -52,8 +49,11 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/docvalues/TestBoolValOfNumericDVs.java b/lucene/queries/src/test/org/apache/lucene/queries/function/docvalues/TestBoolValOfNumericDVs.java index 5d9be4e3c1f..46fceb49aee 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/docvalues/TestBoolValOfNumericDVs.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/docvalues/TestBoolValOfNumericDVs.java @@ -18,7 +18,7 @@ package org.apache.lucene.queries.function.docvalues; import java.io.IOException; import org.apache.lucene.queries.function.FunctionValues; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** * Sanity check that {@link FunctionValues#boolVal} behaves as expected for trivial subclasses of diff --git a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestComplexMatches.java b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestComplexMatches.java index a44fe82f092..6b52f4aca04 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestComplexMatches.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestComplexMatches.java @@ -18,8 +18,8 @@ package org.apache.lucene.queries.intervals; import java.io.IOException; -import org.apache.lucene.search.MatchesTestBase; import org.apache.lucene.search.Query; +import org.apache.lucene.tests.search.MatchesTestBase; import org.apache.lucene.util.BytesRef; public class TestComplexMatches extends MatchesTestBase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestDisjunctionRewrites.java b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestDisjunctionRewrites.java index 2f03107ec1f..759cef5da9b 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestDisjunctionRewrites.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestDisjunctionRewrites.java @@ -19,7 +19,7 @@ package org.apache.lucene.queries.intervals; import static org.apache.lucene.queries.intervals.Intervals.*; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestDisjunctionRewrites extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervalBuilder.java b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervalBuilder.java index a51a69062b4..3b6f63d98f5 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervalBuilder.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervalBuilder.java @@ -41,9 +41,9 @@ package org.apache.lucene.queries.intervals; import java.io.IOException; import org.apache.lucene.analysis.CachingTokenFilter; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.Token; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestIntervalBuilder extends LuceneTestCase { public void testSimpleTerm() throws IOException { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervalQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervalQuery.java index f654631ce15..ddd29887ebf 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervalQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervalQuery.java @@ -18,19 +18,19 @@ package org.apache.lucene.queries.intervals; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.BoostQuery; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.Explanation; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestIntervalQuery extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervals.java b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervals.java index a48c6ba201a..78403150389 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervals.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestIntervals.java @@ -37,7 +37,6 @@ import org.apache.lucene.index.DocValues; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.ReaderUtil; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; @@ -47,9 +46,10 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.Operations; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestPayloadFilteredInterval.java b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestPayloadFilteredInterval.java index bd408a88d7e..cc2ba9bc008 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestPayloadFilteredInterval.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestPayloadFilteredInterval.java @@ -18,17 +18,17 @@ package org.apache.lucene.queries.intervals; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.SimplePayloadFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.MatchesIterator; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.SimplePayloadFilter; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestPayloadFilteredInterval extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestSimplifications.java b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestSimplifications.java index 6bdc2d57418..aa60e678112 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestSimplifications.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/intervals/TestSimplifications.java @@ -17,7 +17,7 @@ package org.apache.lucene.queries.intervals; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSimplifications extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java b/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java index 4e50ed8e2f9..a6e56f9188b 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java @@ -29,9 +29,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; @@ -39,18 +36,21 @@ import org.apache.lucene.analysis.tokenattributes.TermFrequencyAttribute; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; public class TestMoreLikeThis extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/PayloadHelper.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/PayloadHelper.java index 7f6be05b6e7..d861f808cb2 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/PayloadHelper.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/PayloadHelper.java @@ -31,10 +31,11 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; /** */ public class PayloadHelper { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadCheckQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadCheckQuery.java index 1cd71dab1e7..92efe145308 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadCheckQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadCheckQuery.java @@ -24,13 +24,10 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.SimplePayloadFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.payloads.SpanPayloadCheckQuery.MatchOperation; import org.apache.lucene.queries.payloads.SpanPayloadCheckQuery.PayloadType; @@ -39,15 +36,18 @@ import org.apache.lucene.queries.spans.SpanNearQuery; import org.apache.lucene.queries.spans.SpanPositionRangeQuery; import org.apache.lucene.queries.spans.SpanQuery; import org.apache.lucene.queries.spans.SpanTermQuery; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.SimplePayloadFilter; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadExplanations.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadExplanations.java index 6abd0d171f2..854e245006a 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadExplanations.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadExplanations.java @@ -21,7 +21,7 @@ import org.apache.lucene.queries.spans.SpanNearQuery; import org.apache.lucene.queries.spans.SpanOrQuery; import org.apache.lucene.queries.spans.SpanQuery; import org.apache.lucene.queries.spans.SpanTermQuery; -import org.apache.lucene.search.BaseExplanationTestCase; +import org.apache.lucene.tests.search.BaseExplanationTestCase; /** TestExplanations subclass focusing on payload queries */ public class TestPayloadExplanations extends BaseExplanationTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java index fec62de6d27..e869c194c30 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadScoreQuery.java @@ -18,7 +18,6 @@ package org.apache.lucene.queries.payloads; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -27,7 +26,6 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanContainingQuery; import org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper; @@ -38,15 +36,17 @@ import org.apache.lucene.queries.spans.SpanTermQuery; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.Explanation; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadSpanPositions.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadSpanPositions.java index 46f38602d62..ed9fec72637 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadSpanPositions.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadSpanPositions.java @@ -21,13 +21,11 @@ import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.MockPayloadAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanCollector; import org.apache.lucene.queries.spans.SpanNearQuery; @@ -39,8 +37,10 @@ import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockPayloadAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestPayloadSpanPositions extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadSpans.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadSpans.java index 4a643d0efcb..bd3547faa64 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadSpans.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadSpans.java @@ -23,7 +23,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -35,7 +34,6 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanCollector; import org.apache.lucene.queries.spans.SpanFirstQuery; @@ -51,8 +49,10 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestPayloadSpans extends LuceneTestCase { private IndexSearcher searcher; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java index 927bb413d9c..de2d6b5d9f9 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/payloads/TestPayloadTermQuery.java @@ -18,7 +18,6 @@ package org.apache.lucene.queries.payloads; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -26,7 +25,6 @@ import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queries.spans.SpanQuery; import org.apache.lucene.queries.spans.SpanTermQuery; @@ -34,18 +32,20 @@ import org.apache.lucene.queries.spans.SpanWeight; import org.apache.lucene.queries.spans.Spans; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/BaseSpanExplanationTestCase.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/BaseSpanExplanationTestCase.java index 6caccf5de7b..e17b5a67a5d 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/BaseSpanExplanationTestCase.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/BaseSpanExplanationTestCase.java @@ -24,7 +24,7 @@ import static org.apache.lucene.queries.spans.SpanTestUtil.spanNotQuery; import static org.apache.lucene.queries.spans.SpanTestUtil.spanOrQuery; import static org.apache.lucene.queries.spans.SpanTestUtil.spanTermQuery; -import org.apache.lucene.search.BaseExplanationTestCase; +import org.apache.lucene.tests.search.BaseExplanationTestCase; public abstract class BaseSpanExplanationTestCase extends BaseExplanationTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/SpanTestUtil.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/SpanTestUtil.java index 39e8eabbb37..f7c6363f3d7 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/SpanTestUtil.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/SpanTestUtil.java @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import org.apache.lucene.index.Term; -import org.apache.lucene.search.QueryUtils; +import org.apache.lucene.tests.search.QueryUtils; /** Some utility methods used for testing span queries */ public class SpanTestUtil { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestBasics.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestBasics.java index 9e5bf95d255..30b43ad6b7a 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestBasics.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestBasics.java @@ -28,11 +28,9 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.PhraseQuery; @@ -41,9 +39,13 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopScoreDocCollector; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestFieldMaskingSpanQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestFieldMaskingSpanQuery.java index 604f78c58c8..567bfdf711e 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestFieldMaskingSpanQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestFieldMaskingSpanQuery.java @@ -21,21 +21,21 @@ import static org.apache.lucene.queries.spans.SpanTestUtil.assertNext; import java.util.HashSet; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.similarities.TFIDFSimilarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestFilterSpans.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestFilterSpans.java index ae2e3c1d1d5..565885777a6 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestFilterSpans.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestFilterSpans.java @@ -17,7 +17,7 @@ package org.apache.lucene.queries.spans; import java.lang.reflect.Method; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestFilterSpans extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestNearSpansOrdered.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestNearSpansOrdered.java index 38b23e737e2..11002bc7df5 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestNearSpansOrdered.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestNearSpansOrdered.java @@ -19,15 +19,12 @@ package org.apache.lucene.queries.spans; import static org.apache.lucene.queries.spans.SpanTestUtil.assertFinished; import static org.apache.lucene.queries.spans.SpanTestUtil.assertNext; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexReaderContext; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.Explanation; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreMode; @@ -35,7 +32,10 @@ import org.apache.lucene.search.Scorer; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestNearSpansOrdered extends LuceneTestCase { protected IndexSearcher searcher; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestQueryRescorerWithSpans.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestQueryRescorerWithSpans.java index 620a26a3c4c..29d33748425 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestQueryRescorerWithSpans.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestQueryRescorerWithSpans.java @@ -20,7 +20,6 @@ package org.apache.lucene.queries.spans; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -30,7 +29,8 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestQueryRescorerWithSpans extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanCollection.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanCollection.java index 9a4f3ed55a7..276beda69a7 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanCollection.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanCollection.java @@ -19,19 +19,19 @@ package org.apache.lucene.queries.spans; import java.io.IOException; import java.util.HashSet; import java.util.Set; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestSpanCollection extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanContainQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanContainQuery.java index 422fa50ba4f..8ee815781a4 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanContainQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanContainQuery.java @@ -18,17 +18,17 @@ package org.apache.lucene.queries.spans; import static org.apache.lucene.queries.spans.SpanTestUtil.*; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSpanContainQuery extends LuceneTestCase { IndexSearcher searcher; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanExplanationsOfNonMatches.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanExplanationsOfNonMatches.java index 8110de6b974..8f4fea2cb3f 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanExplanationsOfNonMatches.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanExplanationsOfNonMatches.java @@ -16,8 +16,8 @@ */ package org.apache.lucene.queries.spans; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.Query; +import org.apache.lucene.tests.search.CheckHits; /** subclass of TestSimpleExplanations that verifies non matches. */ public class TestSpanExplanationsOfNonMatches extends TestSpanExplanations { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanFirstQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanFirstQuery.java index e57101dfb7b..5a38c07f233 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanFirstQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanFirstQuery.java @@ -19,15 +19,15 @@ package org.apache.lucene.queries.spans; import static org.apache.lucene.queries.spans.SpanTestUtil.*; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanMatches.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanMatches.java index 232c53cbbfa..dd809982275 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanMatches.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanMatches.java @@ -19,8 +19,8 @@ package org.apache.lucene.queries.spans; import java.io.IOException; import org.apache.lucene.index.Term; -import org.apache.lucene.search.MatchesTestBase; import org.apache.lucene.search.Query; +import org.apache.lucene.tests.search.MatchesTestBase; public class TestSpanMatches extends MatchesTestBase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanMultiTermQueryWrapper.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanMultiTermQueryWrapper.java index 91588a20a04..252818079c7 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanMultiTermQueryWrapper.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanMultiTermQueryWrapper.java @@ -20,7 +20,6 @@ import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.IndexSearcher; @@ -29,7 +28,8 @@ import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.RegexpQuery; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Tests for {@link SpanMultiTermQueryWrapper}, wrapping a few MultiTermQueries. */ diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanNearQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanNearQuery.java index 01c4729c9ed..ba59cb3da5a 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanNearQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanNearQuery.java @@ -21,12 +21,12 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; /** Basic tests for SpanNearQuery */ public class TestSpanNearQuery extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanNotQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanNotQuery.java index 421721a309e..e151883af45 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanNotQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanNotQuery.java @@ -21,12 +21,12 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; /** Basic tests for SpanNotQuery */ public class TestSpanNotQuery extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanOrQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanOrQuery.java index 8852387028f..68cbcedf6b4 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanOrQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanOrQuery.java @@ -17,8 +17,8 @@ package org.apache.lucene.queries.spans; import org.apache.lucene.index.Term; -import org.apache.lucene.search.QueryUtils; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; /** Basic tests for SpanOrQuery */ public class TestSpanOrQuery extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanQueryVisitor.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanQueryVisitor.java index 6051f1b6037..8fbb2f5362b 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanQueryVisitor.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanQueryVisitor.java @@ -31,7 +31,7 @@ import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.search.TermQuery; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSpanQueryVisitor extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSearchEquivalence.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSearchEquivalence.java index e2a6d319144..77444ac73cb 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSearchEquivalence.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSearchEquivalence.java @@ -23,8 +23,8 @@ import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.search.SearchEquivalenceTestBase; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.search.SearchEquivalenceTestBase; /** Basic equivalence tests for span queries */ public class TestSpanSearchEquivalence extends SearchEquivalenceTestBase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSimilarity.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSimilarity.java index 46809c60c5d..3d49b30a960 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSimilarity.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanSimilarity.java @@ -23,7 +23,6 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; @@ -67,7 +66,8 @@ import org.apache.lucene.search.similarities.NormalizationH3; import org.apache.lucene.search.similarities.NormalizationZ; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSpanSimilarity extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanTermQuery.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanTermQuery.java index efe1ad24cc4..d082360b73b 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanTermQuery.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpanTermQuery.java @@ -21,12 +21,12 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; /** Basic tests for SpanTermQuery */ public class TestSpanTermQuery extends LuceneTestCase { diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpans.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpans.java index 853832ae532..359c31709db 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpans.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpans.java @@ -25,16 +25,13 @@ import static org.apache.lucene.queries.spans.SpanTestUtil.spanOrQuery; import static org.apache.lucene.queries.spans.SpanTestUtil.spanTermQuery; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.PrefixQuery; @@ -42,7 +39,10 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestSpans extends LuceneTestCase { private IndexSearcher searcher; diff --git a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpansEnum.java b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpansEnum.java index c59fc608544..4a0791b50bd 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpansEnum.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/spans/TestSpansEnum.java @@ -19,18 +19,18 @@ package org.apache.lucene.queries.spans; import static org.apache.lucene.queries.spans.SpanTestUtil.*; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiAnalyzer.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiAnalyzer.java index 0f9d9fd4e73..5b3f7f8f1f8 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiAnalyzer.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiAnalyzer.java @@ -19,8 +19,6 @@ package org.apache.lucene.queryparser.classic; import java.io.IOException; import java.util.Objects; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -30,6 +28,8 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; /** * Test QueryParser's ability to deal with Analyzers that return more than one token per position or diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java index 4aca1f0c756..57ed0e70972 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java @@ -21,9 +21,6 @@ import java.io.StringReader; import java.util.HashMap; import java.util.Map; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockSynonymFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -39,8 +36,11 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.RegexpQuery; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockSynonymFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; /** Tests QueryParser. */ public class TestMultiFieldQueryParser extends LuceneTestCase { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java index 92c11e1bbda..fb028b858d3 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java @@ -24,7 +24,7 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.index.Term; import org.apache.lucene.search.MultiPhraseQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestMultiPhraseQueryParsing extends LuceneTestCase { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java index 0a07cdca9d9..3c8f5a39b09 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java @@ -18,11 +18,6 @@ package org.apache.lucene.queryparser.classic; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockBytesAnalyzer; -import org.apache.lucene.analysis.MockLowerCaseFilter; -import org.apache.lucene.analysis.MockSynonymAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -34,7 +29,6 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexOptions; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queryparser.charstream.CharStream; import org.apache.lucene.queryparser.classic.QueryParser.Operator; @@ -51,6 +45,12 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.SynonymQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockBytesAnalyzer; +import org.apache.lucene.tests.analysis.MockLowerCaseFilter; +import org.apache.lucene.tests.analysis.MockSynonymAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.automaton.TooComplexToDeterminizeException; /** Tests QueryParser. */ diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java index 01768bd7293..5a670b27eb4 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java @@ -18,8 +18,6 @@ package org.apache.lucene.queryparser.complexPhrase; import java.util.HashSet; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockSynonymAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -36,7 +34,9 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockSynonymAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestComplexPhraseQuery extends LuceneTestCase { Directory rd; diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java index bb131bc9a30..1d8b9e869f3 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtendableQueryParser.java @@ -18,8 +18,6 @@ package org.apache.lucene.queryparser.ext; import java.util.Locale; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.queryparser.classic.ParseException; import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.queryparser.classic.QueryParserBase; @@ -28,6 +26,8 @@ import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Testcase for the class {@link ExtendableQueryParser} */ public class TestExtendableQueryParser extends TestQueryParser { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java index de1ed3c9117..1aaa58c6f9e 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/ext/TestExtensions.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.queryparser.ext; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Testcase for the {@link Extensions} class */ public class TestExtensions extends LuceneTestCase { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/builders/TestQueryTreeBuilder.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/builders/TestQueryTreeBuilder.java index 8f13c6470a4..5c83dfa1c51 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/builders/TestQueryTreeBuilder.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/builders/TestQueryTreeBuilder.java @@ -22,7 +22,7 @@ import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl; import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax; import org.apache.lucene.queryparser.flexible.core.util.UnescapedCharSequence; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestQueryTreeBuilder extends LuceneTestCase { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/nodes/TestQueryNode.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/nodes/TestQueryNode.java index 59edc6ca8fd..60dd48f5450 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/nodes/TestQueryNode.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/nodes/TestQueryNode.java @@ -18,7 +18,7 @@ package org.apache.lucene.queryparser.flexible.core.nodes; import java.util.Arrays; import java.util.Collections; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestQueryNode extends LuceneTestCase { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java index 4cf2256291c..ba6b4131f14 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java @@ -17,7 +17,7 @@ package org.apache.lucene.queryparser.flexible.messages; import java.util.Locale; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** */ public class TestNLS extends LuceneTestCase { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java index 7c5c1238847..a1049368139 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/precedence/TestPrecedenceQueryParser.java @@ -45,7 +45,10 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.WildcardQuery; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.junit.AfterClass; diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java index 7333238ba17..b02fdfeb1a5 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParser.java @@ -27,7 +27,7 @@ import org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.apache.lucene.queryparser.flexible.standard.processors.WildcardQueryNodeProcessor; import org.apache.lucene.search.Query; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** * This test case demonstrates how the new query parser can be used.
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java index 81e054dce3e..adce40045cd 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java @@ -25,7 +25,7 @@ import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; import org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.apache.lucene.search.Query; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** * This test case demonstrates how the new query parser can be used.
diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiAnalyzerQPHelper.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiAnalyzerQPHelper.java index 6df50644edc..6c790ae42fb 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiAnalyzerQPHelper.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiAnalyzerQPHelper.java @@ -24,7 +24,8 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.standard.config.StandardQueryConfigHandler; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; /** * This test case is a copy of the core Lucene query parser test, it was adapted to use new diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java index 022e5a2ffc0..7c9bb9a54cc 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java @@ -35,8 +35,9 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; /** * This test case is a copy of the core Lucene query parser test, it was adapted to use new diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestPointQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestPointQueryParser.java index e4010b774e0..8bfb75590b3 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestPointQueryParser.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestPointQueryParser.java @@ -25,7 +25,7 @@ import org.apache.lucene.document.FloatPoint; import org.apache.lucene.document.IntPoint; import org.apache.lucene.document.LongPoint; import org.apache.lucene.queryparser.flexible.standard.config.PointsConfig; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Simple test for point field integration into the flexible QP */ public class TestPointQueryParser extends LuceneTestCase { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java index 81de1f127c7..66a8ccd0c78 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java @@ -28,9 +28,6 @@ import java.util.Locale; import java.util.Map; import java.util.TimeZone; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -74,7 +71,10 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java index ed1eed169b9..74612d6d9f9 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQP.java @@ -17,8 +17,6 @@ package org.apache.lucene.queryparser.flexible.standard; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.DateTools.Resolution; import org.apache.lucene.index.Term; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; @@ -30,6 +28,8 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.WildcardQuery; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Tests QueryParser. */ public class TestStandardQP extends QueryParserTestBase { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQPEnhancements.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQPEnhancements.java index de26e7c2724..f22433371fb 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQPEnhancements.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestStandardQPEnhancements.java @@ -20,7 +20,6 @@ import com.carrotsearch.randomizedtesting.RandomizedTest; import java.io.StringReader; import java.util.Locale; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.queryparser.charstream.FastCharStream; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.config.StandardQueryConfigHandler; @@ -28,7 +27,8 @@ import org.apache.lucene.queryparser.flexible.standard.nodes.IntervalQueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.Test; diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/simple/TestSimpleQueryParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/simple/TestSimpleQueryParser.java index 5ae1f3483e9..da9c5fc7508 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/simple/TestSimpleQueryParser.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/simple/TestSimpleQueryParser.java @@ -31,8 +31,6 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; @@ -44,8 +42,10 @@ import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.automaton.LevenshteinAutomata; /** Tests for {@link SimpleQueryParser} */ diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java index fde5f7a1f8f..3ad5a2ba104 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java @@ -17,7 +17,6 @@ package org.apache.lucene.queryparser.surround.query; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; @@ -25,7 +24,8 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; public class SingleFieldTestDb { private Directory db; diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test01Exceptions.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test01Exceptions.java index 3977c6523a4..75f751e5b8c 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test01Exceptions.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test01Exceptions.java @@ -18,7 +18,7 @@ package org.apache.lucene.queryparser.surround.query; import junit.framework.TestSuite; import junit.textui.TestRunner; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class Test01Exceptions extends LuceneTestCase { /** Main for running test case by itself. */ diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test02Boolean.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test02Boolean.java index 85443c7ced5..1a726ecd9ba 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test02Boolean.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test02Boolean.java @@ -18,7 +18,7 @@ package org.apache.lucene.queryparser.surround.query; import junit.framework.TestSuite; import junit.textui.TestRunner; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class Test02Boolean extends LuceneTestCase { public static void main(String[] args) { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test03Distance.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test03Distance.java index d8ed0ec6b42..16f02a235d8 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test03Distance.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/Test03Distance.java @@ -18,7 +18,7 @@ package org.apache.lucene.queryparser.surround.query; import junit.framework.TestSuite; import junit.textui.TestRunner; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class Test03Distance extends LuceneTestCase { public static void main(String[] args) { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/TestSrndQuery.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/TestSrndQuery.java index 425d902be35..1dd8419bc93 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/TestSrndQuery.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/TestSrndQuery.java @@ -18,8 +18,8 @@ package org.apache.lucene.queryparser.surround.query; import org.apache.lucene.queryparser.surround.parser.QueryParser; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** */ diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java index 1d79f176b9d..f7f59d6930f 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java @@ -25,10 +25,6 @@ import java.util.Locale; import java.util.TimeZone; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.LowerCaseFilter; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockSynonymFilter; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -63,7 +59,11 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockSynonymFilter; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/CoreParserTestIndexData.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/CoreParserTestIndexData.java index 9911f9aa8be..759a110ebd9 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/CoreParserTestIndexData.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/CoreParserTestIndexData.java @@ -30,7 +30,7 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; class CoreParserTestIndexData implements Closeable { diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java index 7a79f15d02e..debf6e404bc 100644 --- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java +++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestCoreParser.java @@ -22,9 +22,6 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Arrays; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; @@ -38,7 +35,10 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.AfterClass; import org.xml.sax.SAXException; diff --git a/lucene/replicator/src/java/module-info.java b/lucene/replicator/src/java/module-info.java index d44b9adfa9f..1c37c97c9da 100644 --- a/lucene/replicator/src/java/module-info.java +++ b/lucene/replicator/src/java/module-info.java @@ -20,6 +20,7 @@ module org.apache.lucene.replicator { requires javax.servlet.api; requires org.apache.httpcomponents.httpclient; + requires org.apache.httpcomponents.httpcore; requires org.apache.lucene.core; requires org.apache.lucene.facet; diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java b/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java index d6d8bc4980d..443965745f7 100644 --- a/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java +++ b/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java @@ -20,7 +20,7 @@ import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering; import java.util.Random; import org.apache.http.conn.HttpClientConnectionManager; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HttpConfiguration; diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/TestIndexAndTaxonomyReplicationClient.java b/lucene/replicator/src/test/org/apache/lucene/replicator/TestIndexAndTaxonomyReplicationClient.java index 5da165ca5c6..ce8dae50741 100644 --- a/lucene/replicator/src/test/org/apache/lucene/replicator/TestIndexAndTaxonomyReplicationClient.java +++ b/lucene/replicator/src/test/org/apache/lucene/replicator/TestIndexAndTaxonomyReplicationClient.java @@ -48,9 +48,9 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; import org.junit.After; import org.junit.Before; diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/TestIndexReplicationClient.java b/lucene/replicator/src/test/org/apache/lucene/replicator/TestIndexReplicationClient.java index 860465ff7b5..0b3b1388ccd 100644 --- a/lucene/replicator/src/test/org/apache/lucene/replicator/TestIndexReplicationClient.java +++ b/lucene/replicator/src/test/org/apache/lucene/replicator/TestIndexReplicationClient.java @@ -29,9 +29,9 @@ import org.apache.lucene.index.SnapshotDeletionPolicy; import org.apache.lucene.replicator.ReplicationClient.ReplicationHandler; import org.apache.lucene.replicator.ReplicationClient.SourceDirectoryFactory; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; import org.junit.After; import org.junit.Before; diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java index 8a7492fde9f..d0068018371 100644 --- a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java +++ b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java @@ -35,7 +35,6 @@ import java.util.Map; import java.util.Random; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -61,9 +60,10 @@ import org.apache.lucene.store.DataOutput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; /** A primary node that uses simple TCP connections to send commands and copy files */ diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimpleReplicaNode.java b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimpleReplicaNode.java index d4b7b5ee1cd..121cab09880 100644 --- a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimpleReplicaNode.java +++ b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimpleReplicaNode.java @@ -46,10 +46,10 @@ import org.apache.lucene.store.DataOutput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.RateLimitedIndexOutput; import org.apache.lucene.store.RateLimiter; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; class SimpleReplicaNode extends ReplicaNode { final int tcpPort; diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java index 47a1f3a980c..18145db244e 100644 --- a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java +++ b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java @@ -33,14 +33,14 @@ import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.LockObtainFailedException; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestRuleIgnoreTestSuites; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; import org.apache.lucene.util.SuppressForbidden; -import org.apache.lucene.util.TestRuleIgnoreTestSuites; -import org.apache.lucene.util.TestUtil; // MockRandom's .sd file has no index header/footer: @SuppressCodecs({"MockRandom", "Direct", "SimpleText"}) diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestSimpleServer.java b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestSimpleServer.java index c776c29851e..2cfb6d4486b 100644 --- a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestSimpleServer.java +++ b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestSimpleServer.java @@ -40,14 +40,14 @@ import org.apache.lucene.store.DataInput; import org.apache.lucene.store.DataOutput; import org.apache.lucene.store.InputStreamDataInput; import org.apache.lucene.store.OutputStreamDataOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestRuleIgnoreTestSuites; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Constants; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; import org.apache.lucene.util.SuppressForbidden; -import org.apache.lucene.util.TestRuleIgnoreTestSuites; -import org.apache.lucene.util.TestUtil; import org.junit.Assume; import org.junit.AssumptionViolatedException; import org.junit.BeforeClass; diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestStressNRTReplication.java b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestStressNRTReplication.java index 197ba2f6dfa..917a73865f6 100644 --- a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestStressNRTReplication.java +++ b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestStressNRTReplication.java @@ -44,15 +44,15 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.TestRuleIgnoreTestSuites; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; import org.apache.lucene.util.SuppressForbidden; -import org.apache.lucene.util.TestRuleIgnoreTestSuites; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.ThreadInterruptedException; /* diff --git a/lucene/sandbox/src/test/org/apache/lucene/payloads/TestPayloadSpanUtil.java b/lucene/sandbox/src/test/org/apache/lucene/payloads/TestPayloadSpanUtil.java index d87b08d93ea..7d8480972d4 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/payloads/TestPayloadSpanUtil.java +++ b/lucene/sandbox/src/test/org/apache/lucene/payloads/TestPayloadSpanUtil.java @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -32,14 +31,15 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.similarities.ClassicSimilarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestPayloadSpanUtil extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/codecs/idversion/TestIDVersionPostingsFormat.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/codecs/idversion/TestIDVersionPostingsFormat.java index fb4cd8f9f4a..68c76b74684 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/codecs/idversion/TestIDVersionPostingsFormat.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/codecs/idversion/TestIDVersionPostingsFormat.java @@ -28,9 +28,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicLong; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -39,9 +36,7 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.MergeScheduler; -import org.apache.lucene.index.PerThreadPKLookup; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.TieredMergePolicy; import org.apache.lucene.sandbox.codecs.idversion.StringAndPayloadField.SingleTokenWithPayloadTokenStream; @@ -51,9 +46,14 @@ import org.apache.lucene.search.SearcherFactory; import org.apache.lucene.search.SearcherManager; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.PerThreadPKLookup; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Basic tests for IDVersionPostingsFormat */ // Cannot extend BasePostingsFormatTestCase because this PF is not diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestBigIntegerPoint.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestBigIntegerPoint.java index d3d2adc2c27..04cbea9a4fd 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestBigIntegerPoint.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestBigIntegerPoint.java @@ -19,11 +19,11 @@ package org.apache.lucene.sandbox.document; import java.math.BigInteger; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** Simple tests for {@link BigIntegerPoint} */ public class TestBigIntegerPoint extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestDoubleRangeField.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestDoubleRangeField.java index d4c365cc794..0d59304af6b 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestDoubleRangeField.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestDoubleRangeField.java @@ -18,7 +18,7 @@ package org.apache.lucene.sandbox.document; import org.apache.lucene.document.Document; import org.apache.lucene.document.DoubleRange; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Random testing for RangeField type. */ public class TestDoubleRangeField extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestFloatPointNearestNeighbor.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestFloatPointNearestNeighbor.java index 26dd8f48fc6..ae829dcf02c 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestFloatPointNearestNeighbor.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestFloatPointNearestNeighbor.java @@ -26,7 +26,6 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.PointValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.Term; import org.apache.lucene.sandbox.search.LatLonPointPrototypeQueries; @@ -34,8 +33,9 @@ import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestFloatPointNearestNeighbor extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestHalfFloatPoint.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestHalfFloatPoint.java index d4212e0f08c..4182af1692f 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestHalfFloatPoint.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/document/TestHalfFloatPoint.java @@ -19,12 +19,12 @@ package org.apache.lucene.sandbox.document; import java.util.Arrays; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestHalfFloatPoint extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestFuzzyLikeThisQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestFuzzyLikeThisQuery.java index 35adbce0757..740241188d1 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestFuzzyLikeThisQuery.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestFuzzyLikeThisQuery.java @@ -19,11 +19,9 @@ package org.apache.lucene.sandbox.queries; import java.io.IOException; import java.util.HashSet; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; @@ -31,8 +29,10 @@ import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestFuzzyLikeThisQuery extends LuceneTestCase { private Directory directory; diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java index 9460883668d..a2fcfd24af1 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java @@ -30,9 +30,7 @@ import org.apache.lucene.index.FieldInvertState; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.MultiReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchNoDocsQuery; @@ -50,8 +48,10 @@ import org.apache.lucene.search.similarities.LMJelinekMercerSimilarity; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; import org.apache.lucene.store.MMapDirectory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; public class TestCombinedFieldQuery extends LuceneTestCase { public void testInvalid() { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCoveringQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCoveringQuery.java index c16685b73fd..4627ce2c264 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCoveringQuery.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCoveringQuery.java @@ -36,10 +36,10 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.LongValuesSource; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestCoveringQuery extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestDocValuesNumbersQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestDocValuesNumbersQuery.java index 969c8e8054e..0318ccb8ad9 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestDocValuesNumbersQuery.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestDocValuesNumbersQuery.java @@ -27,7 +27,6 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.SortedNumericDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; @@ -39,9 +38,10 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestDocValuesNumbersQuery extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestDocValuesTermsQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestDocValuesTermsQuery.java index 24a5faca865..064900bb0b6 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestDocValuesTermsQuery.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestDocValuesTermsQuery.java @@ -24,7 +24,6 @@ import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; @@ -36,10 +35,11 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestDocValuesTermsQuery extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestFieldCacheTermsFilter.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestFieldCacheTermsFilter.java index 548fd3cc445..113e2d63e66 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestFieldCacheTermsFilter.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestFieldCacheTermsFilter.java @@ -22,12 +22,12 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** * A basic unit test for FieldCacheTermsFilter diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQuery.java index 885e589b0e1..fb8ecf26007 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQuery.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQuery.java @@ -19,7 +19,6 @@ package org.apache.lucene.sandbox.search; import static org.hamcrest.CoreMatchers.instanceOf; import java.io.IOException; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.LongPoint; import org.apache.lucene.document.SortedNumericDocValuesField; @@ -28,13 +27,11 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.DocValuesFieldExistsQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Scorer; import org.apache.lucene.search.Sort; @@ -43,9 +40,12 @@ import org.apache.lucene.search.SortedNumericSortField; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestIndexSortSortedNumericDocValuesRangeQuery extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLargeNumHitsTopDocsCollector.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLargeNumHitsTopDocsCollector.java index 3dcd17057c4..42da3187c62 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLargeNumHitsTopDocsCollector.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLargeNumHitsTopDocsCollector.java @@ -21,11 +21,9 @@ import java.io.IOException; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; @@ -34,7 +32,9 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TopScoreDocCollector; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLargeNumHitsTopDocsCollector extends LuceneTestCase { private Directory dir; diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLatLonBoundingBoxQueries.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLatLonBoundingBoxQueries.java index d66bbd95b32..22732427cf9 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLatLonBoundingBoxQueries.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLatLonBoundingBoxQueries.java @@ -22,15 +22,15 @@ import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude; import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude; import org.apache.lucene.document.Document; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.Rectangle; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.sandbox.document.LatLonBoundingBox; -import org.apache.lucene.search.BaseRangeFieldQueryTestCase; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.BaseRangeFieldQueryTestCase; /** Random testing for GeoBoundingBoxField type. */ public class TestLatLonBoundingBoxQueries extends BaseRangeFieldQueryTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLongHashSet.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLongHashSet.java index 9c461c52412..564f186d9c7 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLongHashSet.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestLongHashSet.java @@ -21,7 +21,7 @@ import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.LongStream; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLongHashSet extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java index 71fc548b541..df307897d81 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java @@ -25,7 +25,6 @@ import org.apache.lucene.document.FloatPoint; import org.apache.lucene.document.IntPoint; import org.apache.lucene.document.LongPoint; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.sandbox.document.DoublePointMultiRangeBuilder; import org.apache.lucene.sandbox.document.FloatPointMultiRangeBuilder; import org.apache.lucene.sandbox.document.IntPointMultiRangeBuilder; @@ -34,13 +33,14 @@ import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -import org.apache.lucene.search.QueryUtils; import org.apache.lucene.search.Sort; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.QueryUtils; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestMultiRangeQueries extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestNearest.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestNearest.java index 2a16dc91818..4f7df8a587b 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestNearest.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestNearest.java @@ -25,11 +25,9 @@ import org.apache.lucene.document.LatLonPoint; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; import org.apache.lucene.geo.GeoEncodingUtils; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.Term; import org.apache.lucene.search.FieldDoc; @@ -39,9 +37,11 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.Sort; import org.apache.lucene.search.TopFieldDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.SloppyMath; -import org.apache.lucene.util.TestUtil; public class TestNearest extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestPhraseWildcardQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestPhraseWildcardQuery.java index 90b1150df22..65bbbed9ecf 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestPhraseWildcardQuery.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestPhraseWildcardQuery.java @@ -29,7 +29,6 @@ import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; @@ -51,8 +50,9 @@ import org.apache.lucene.search.Scorer; import org.apache.lucene.search.Weight; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; /** * Tests {@link PhraseWildcardQuery}. diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestProfilerCollector.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestProfilerCollector.java index 3d68ee144e3..a9f5aa4fb50 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestProfilerCollector.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestProfilerCollector.java @@ -26,15 +26,15 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TotalHitCountCollector; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.hamcrest.MatcherAssert; public class TestProfilerCollector extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestQueryProfilerIndexSearcher.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestQueryProfilerIndexSearcher.java index 3c3a69962f2..36e9a839fcf 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestQueryProfilerIndexSearcher.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestQueryProfilerIndexSearcher.java @@ -27,18 +27,18 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.LRUQueryCache; import org.apache.lucene.search.Query; -import org.apache.lucene.search.RandomApproximationQuery; import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.RandomApproximationQuery; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.hamcrest.MatcherAssert; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestQueryProfilerScorer.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestQueryProfilerScorer.java index c5647813e89..870ddfa051a 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestQueryProfilerScorer.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestQueryProfilerScorer.java @@ -26,7 +26,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Scorer; import org.apache.lucene.search.Weight; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestQueryProfilerScorer extends LuceneTestCase { diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestTermAutomatonQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestTermAutomatonQuery.java index 7ca592e5525..431fb3eb3e3 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestTermAutomatonQuery.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestTermAutomatonQuery.java @@ -26,10 +26,6 @@ import java.util.Objects; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; @@ -40,7 +36,6 @@ import org.apache.lucene.document.StoredField; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanClause.Occur; @@ -60,13 +55,18 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.BitSetIterator; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.Transition; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/SpatialTestCase.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/SpatialTestCase.java index 45586ec7b98..00d413f009c 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/SpatialTestCase.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/SpatialTestCase.java @@ -23,18 +23,18 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.distance.DistanceUtils; import org.locationtech.spatial4j.shape.Point; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestQueryEqualsHashCode.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestQueryEqualsHashCode.java index 28854b12aaf..00aece9463d 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestQueryEqualsHashCode.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestQueryEqualsHashCode.java @@ -29,7 +29,7 @@ import org.apache.lucene.spatial.query.SpatialArgs; import org.apache.lucene.spatial.query.SpatialOperation; import org.apache.lucene.spatial.serialized.SerializedDVStrategy; import org.apache.lucene.spatial.vector.PointVectorStrategy; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.shape.Shape; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestSpatialArgs.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestSpatialArgs.java index 752497cc8a2..6a8286475ad 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestSpatialArgs.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestSpatialArgs.java @@ -18,7 +18,7 @@ package org.apache.lucene.spatial; import org.apache.lucene.spatial.query.SpatialArgs; import org.apache.lucene.spatial.spatial4j.Geo3dSpatialContextFactory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.shape.Shape; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestSpatialExample.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestSpatialExample.java index ec6e6638666..32cfb80a840 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestSpatialExample.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestSpatialExample.java @@ -41,7 +41,7 @@ import org.apache.lucene.spatial.query.SpatialArgsParser; import org.apache.lucene.spatial.query.SpatialOperation; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.distance.DistanceUtils; import org.locationtech.spatial4j.shape.Point; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestTestFramework.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestTestFramework.java index ea18c35aa23..5cf491870e4 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestTestFramework.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/TestTestFramework.java @@ -23,7 +23,7 @@ import java.util.Iterator; import java.util.List; import org.apache.lucene.spatial.query.SpatialArgsParser; import org.apache.lucene.spatial.query.SpatialOperation; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Assert; import org.junit.Test; import org.locationtech.spatial4j.context.SpatialContext; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java index 91f21fce0bc..c9ac5fccef6 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/TestRecursivePrefixTreeStrategy.java @@ -24,7 +24,7 @@ import org.apache.lucene.spatial.StrategyTestCase; import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree; import org.apache.lucene.spatial.query.SpatialArgs; import org.apache.lucene.spatial.query.SpatialOperation; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.distance.DistanceUtils; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestDateRangePrefixTree.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestDateRangePrefixTree.java index edc862c2f8a..60b2200cc88 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestDateRangePrefixTree.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestDateRangePrefixTree.java @@ -29,8 +29,8 @@ import java.util.Arrays; import java.util.Calendar; import java.util.GregorianCalendar; import org.apache.lucene.spatial.prefix.tree.NumberRangePrefixTree.UnitNRShape; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.locationtech.spatial4j.shape.Shape; import org.locationtech.spatial4j.shape.SpatialRelation; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java index 96aa41b0d1d..97d50884e33 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java @@ -21,8 +21,8 @@ import com.carrotsearch.randomizedtesting.annotations.Repeat; import com.google.common.geometry.S2CellId; import com.google.common.geometry.S2Projections; import org.apache.lucene.spatial.spatial4j.Geo3dSpatialContextFactory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.shape.Point; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/query/TestSpatialArgsParser.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/query/TestSpatialArgsParser.java index 015a16317d9..23e8e6a3877 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/query/TestSpatialArgsParser.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/query/TestSpatialArgsParser.java @@ -17,7 +17,7 @@ package org.apache.lucene.spatial.query; import java.text.ParseException; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.shape.Rectangle; diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java index eb5a7da3fdb..318d0093c71 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/RandomizedShapeTestCase.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.spatial.spatial4j; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.locationtech.spatial4j.context.SpatialContext; /** A base test class with utility methods to help test shapes. Extends from RandomizedTest. */ diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/TestGeo3d.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/TestGeo3d.java index 1ce896ae256..aaab077fc54 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/TestGeo3d.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/TestGeo3d.java @@ -17,7 +17,7 @@ package org.apache.lucene.spatial.spatial4j; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.exception.InvalidShapeException; diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DDocValues.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DDocValues.java index 9a56c3e64a9..e1988666c1f 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DDocValues.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DDocValues.java @@ -19,8 +19,8 @@ package org.apache.lucene.spatial3d; import com.carrotsearch.randomizedtesting.generators.RandomPicks; import org.apache.lucene.spatial3d.geom.GeoPoint; import org.apache.lucene.spatial3d.geom.PlanetModel; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestGeo3DDocValues extends LuceneTestCase { diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java index a2e5a9fa912..923181ef3b2 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java @@ -37,7 +37,6 @@ import org.apache.lucene.codecs.lucene90.Lucene90PointsWriter; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; -import org.apache.lucene.geo.GeoTestUtil; import org.apache.lucene.geo.Polygon; import org.apache.lucene.geo.Rectangle; import org.apache.lucene.index.DirectoryReader; @@ -50,7 +49,6 @@ import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.index.PointValues.IntersectVisitor; import org.apache.lucene.index.PointValues.Relation; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.ReaderUtil; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; @@ -75,12 +73,14 @@ import org.apache.lucene.spatial3d.geom.XYZBounds; import org.apache.lucene.spatial3d.geom.XYZSolid; import org.apache.lucene.spatial3d.geom.XYZSolidFactory; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.geo.GeoTestUtil; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.DocIdSetBuilder; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.TestUtil; public class TestGeo3DPoint extends LuceneTestCase { diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestCompositeGeoPolygonRelationships.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestCompositeGeoPolygonRelationships.java index ca0b3b95664..5e8b9846646 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestCompositeGeoPolygonRelationships.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestCompositeGeoPolygonRelationships.java @@ -20,7 +20,7 @@ package org.apache.lucene.spatial3d.geom; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoBBox.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoBBox.java index f32bbc3f242..f7d2bd688e6 100755 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoBBox.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoBBox.java @@ -18,7 +18,7 @@ package org.apache.lucene.spatial3d.geom; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestGeoBBox extends LuceneTestCase { diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoCircle.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoCircle.java index cf5e31f82c4..a29b6c37c7b 100755 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoCircle.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoCircle.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.spatial3d.geom; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestGeoCircle extends LuceneTestCase { diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoConvexPolygon.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoConvexPolygon.java index 9f8a0e4228a..b03c7a1ad01 100755 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoConvexPolygon.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoConvexPolygon.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.spatial3d.geom; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestGeoConvexPolygon extends LuceneTestCase { diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoExactCircle.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoExactCircle.java index 2ed41c96767..c99f6020011 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoExactCircle.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoExactCircle.java @@ -20,7 +20,7 @@ package org.apache.lucene.spatial3d.geom; import static org.apache.lucene.spatial3d.geom.RandomGeo3dShapeGenerator.*; import com.carrotsearch.randomizedtesting.annotations.Repeat; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Tests for GeoExactCircle. */ diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoModel.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoModel.java index b32dec53d3c..3c3a02c3dda 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoModel.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoModel.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.spatial3d.geom; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Test basic plane functionality. */ diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPath.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPath.java index a0c4594c731..a624cc4b6c6 100755 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPath.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPath.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.spatial3d.geom; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestGeoPath extends LuceneTestCase { diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPoint.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPoint.java index 326b0051156..de08b065433 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPoint.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPoint.java @@ -18,7 +18,7 @@ package org.apache.lucene.spatial3d.geom; import static com.carrotsearch.randomizedtesting.RandomizedTest.randomFloat; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Test basic GeoPoint functionality. */ diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPolygon.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPolygon.java index 685b763de44..071a5e983ac 100755 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPolygon.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestGeoPolygon.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.BitSet; import java.util.Collections; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestGeoPolygon extends LuceneTestCase { diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestPlane.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestPlane.java index da690cbce3d..33ac5039174 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestPlane.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestPlane.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.spatial3d.geom; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Test basic plane functionality. */ diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomBinaryCodec.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomBinaryCodec.java index 4cde05f00ad..214ef7dff49 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomBinaryCodec.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomBinaryCodec.java @@ -23,7 +23,7 @@ import com.carrotsearch.randomizedtesting.annotations.Repeat; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Test to check Serialization */ diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomGeoPolygon.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomGeoPolygon.java index cc6bcd457e9..e5a9d7d1a57 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomGeoPolygon.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomGeoPolygon.java @@ -22,7 +22,7 @@ import com.carrotsearch.randomizedtesting.generators.BiasedNumbers; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Random test for polygons. */ diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomGeoShapeRelationship.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomGeoShapeRelationship.java index ccc807889ed..9f3bd751738 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomGeoShapeRelationship.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomGeoShapeRelationship.java @@ -19,7 +19,7 @@ package org.apache.lucene.spatial3d.geom; import static org.apache.lucene.spatial3d.geom.RandomGeo3dShapeGenerator.*; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Random test to check relationship between GeoAreaShapes and GeoShapes. */ diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomPlane.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomPlane.java index c4cb115aa70..2ed0066cc76 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomPlane.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestRandomPlane.java @@ -22,7 +22,7 @@ import static org.apache.lucene.spatial3d.geom.RandomGeo3dShapeGenerator.*; import com.carrotsearch.randomizedtesting.annotations.Repeat; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** Random test for planes. */ diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestSimpleGeoPolygonRelationships.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestSimpleGeoPolygonRelationships.java index 095925cf56f..1a832e358a7 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestSimpleGeoPolygonRelationships.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestSimpleGeoPolygonRelationships.java @@ -20,7 +20,7 @@ package org.apache.lucene.spatial3d.geom; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; /** diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestXYZSolid.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestXYZSolid.java index 6cf813b4c5b..5e56b683e48 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestXYZSolid.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestXYZSolid.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.spatial3d.geom; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.Test; public class TestXYZSolid extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java index 29d1afd9f12..a367242f23c 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java @@ -17,17 +17,17 @@ package org.apache.lucene.search.spell; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.English; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestDirectSpellChecker extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java index cb83c744276..081e9b813cd 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.search.spell; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestJaroWinklerDistance extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java index 694d685cd64..e733847272b 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.search.spell; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestLevenshteinDistance extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java index f8d362ec696..b4a47b2063a 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java @@ -18,17 +18,17 @@ package org.apache.lucene.search.spell; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefIterator; -import org.apache.lucene.util.LuceneTestCase; /** * Test case for LuceneDictionary. It first creates a simple index and then a couple of instances of diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestNGramDistance.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestNGramDistance.java index 6f3f208d9a0..ef27ba8fb27 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestNGramDistance.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestNGramDistance.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.search.spell; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestNGramDistance extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestPlainTextDictionary.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestPlainTextDictionary.java index 05f4684beac..592bb09b304 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestPlainTextDictionary.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestPlainTextDictionary.java @@ -19,7 +19,7 @@ package org.apache.lucene.search.spell; import java.io.IOException; import java.io.StringReader; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** Test case for PlainTextDictionary */ public class TestPlainTextDictionary extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java index 60094058e58..8e07539107c 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java @@ -26,7 +26,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -36,8 +35,9 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.English; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; /** Spell checker test case */ diff --git a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java index 458aad2c7b9..513f2bb5e28 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java @@ -20,20 +20,20 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.spell.WordBreakSpellChecker.BreakSuggestionSortMethod; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.English; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.English; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Assert; public class TestWordBreakSpellChecker extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestDocumentDictionary.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestDocumentDictionary.java index f20285f1b6a..f2cfcd564b8 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestDocumentDictionary.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestDocumentDictionary.java @@ -27,7 +27,6 @@ import java.util.Map; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -37,13 +36,14 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexableField; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.spell.Dictionary; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; // See: https://issues.apache.org/jira/browse/SOLR-12028 Tests cannot remove files on Windows diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestDocumentValueSourceDictionary.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestDocumentValueSourceDictionary.java index 4706043c68a..8a3690ffa74 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestDocumentValueSourceDictionary.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestDocumentValueSourceDictionary.java @@ -25,7 +25,6 @@ import java.util.Map; import java.util.Random; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -36,7 +35,6 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.DoubleValues; import org.apache.lucene.search.IndexSearcher; @@ -44,9 +42,11 @@ import org.apache.lucene.search.LongValues; import org.apache.lucene.search.LongValuesSource; import org.apache.lucene.search.spell.Dictionary; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; public class TestDocumentValueSourceDictionary extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestFileDictionary.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestFileDictionary.java index 3fd5ce7216b..15803f1657f 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestFileDictionary.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestFileDictionary.java @@ -24,9 +24,9 @@ import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.List; import java.util.Map; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Test; public class TestFileDictionary extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestHighFrequencyDictionary.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestHighFrequencyDictionary.java index c76c1a64bce..d5ea4fdd3f0 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestHighFrequencyDictionary.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestHighFrequencyDictionary.java @@ -16,15 +16,15 @@ */ package org.apache.lucene.search.suggest; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.search.spell.Dictionary; import org.apache.lucene.search.spell.HighFrequencyDictionary; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRefIterator; -import org.apache.lucene.util.LuceneTestCase; public class TestHighFrequencyDictionary extends LuceneTestCase { public void testEmpty() throws Exception { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java index af989a9b607..94ba3e3fdb8 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java @@ -24,9 +24,9 @@ import java.util.Random; import java.util.Set; import java.util.TreeMap; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestInputIterator extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestLookupBenchmark.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestLookupBenchmark.java index 69cc19755b6..fe9da12cf34 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestLookupBenchmark.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestLookupBenchmark.java @@ -30,8 +30,6 @@ import java.util.Locale; import java.util.Random; import java.util.concurrent.Callable; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester; import org.apache.lucene.search.suggest.analyzing.AnalyzingSuggester; import org.apache.lucene.search.suggest.analyzing.BlendedInfixSuggester; @@ -42,7 +40,9 @@ import org.apache.lucene.search.suggest.fst.WFSTCompletionLookup; import org.apache.lucene.search.suggest.tst.TSTLookup; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; -import org.apache.lucene.util.*; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.BeforeClass; import org.junit.Ignore; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestPersistence.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestPersistence.java index b18ea52c348..11cfa304271 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestPersistence.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestPersistence.java @@ -24,8 +24,8 @@ import org.apache.lucene.search.suggest.Lookup.LookupResult; import org.apache.lucene.search.suggest.fst.FSTCompletionLookup; import org.apache.lucene.search.suggest.tst.TSTLookup; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; public class TestPersistence extends LuceneTestCase { public final String[] keys = diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingInfixSuggester.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingInfixSuggester.java index c32f36d9b5f..a9cf00e9dcd 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingInfixSuggester.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingInfixSuggester.java @@ -29,8 +29,6 @@ import java.util.Map; import java.util.Set; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; @@ -44,10 +42,12 @@ import org.apache.lucene.search.suggest.InputArrayIterator; import org.apache.lucene.search.suggest.Lookup.LookupResult; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Test; public class TestAnalyzingInfixSuggester extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingSuggester.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingSuggester.java index bff93265de9..7435c996407 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingSuggester.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingSuggester.java @@ -32,14 +32,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedBinaryTokenStream; -import org.apache.lucene.analysis.CannedBinaryTokenStream.BinaryToken; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.MockUTF16TermAttributeImpl; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; @@ -51,11 +43,19 @@ import org.apache.lucene.search.suggest.Input; import org.apache.lucene.search.suggest.InputArrayIterator; import org.apache.lucene.search.suggest.Lookup.LookupResult; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedBinaryTokenStream; +import org.apache.lucene.tests.analysis.CannedBinaryTokenStream.BinaryToken; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.MockUTF16TermAttributeImpl; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestAnalyzingSuggester extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestBlendedInfixSuggester.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestBlendedInfixSuggester.java index 605766293e3..93d47bc78bc 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestBlendedInfixSuggester.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestBlendedInfixSuggester.java @@ -23,17 +23,17 @@ import java.util.Map; import java.util.Set; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.suggest.Input; import org.apache.lucene.search.suggest.InputArrayIterator; import org.apache.lucene.search.suggest.Lookup; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestBlendedInfixSuggester extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java index 7096cef20a7..9ba471400a8 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFreeTextSuggester.java @@ -32,8 +32,6 @@ import java.util.Map; import java.util.Set; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.document.Document; @@ -41,10 +39,12 @@ import org.apache.lucene.search.suggest.Input; import org.apache.lucene.search.suggest.InputArrayIterator; import org.apache.lucene.search.suggest.InputIterator; import org.apache.lucene.search.suggest.Lookup.LookupResult; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Ignore; public class TestFreeTextSuggester extends LuceneTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFuzzySuggester.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFuzzySuggester.java index a5603cc0375..5dc13ad1a99 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFuzzySuggester.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFuzzySuggester.java @@ -26,11 +26,6 @@ import java.util.List; import java.util.Set; import java.util.TreeSet; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.TokenStreamToAutomaton; @@ -40,12 +35,17 @@ import org.apache.lucene.search.suggest.Input; import org.apache.lucene.search.suggest.InputArrayIterator; import org.apache.lucene.search.suggest.Lookup.LookupResult; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.FiniteStringsIterator; import org.apache.lucene.util.fst.Util; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilter.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilter.java index be4c906f023..a16ff6a0afa 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilter.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilter.java @@ -17,12 +17,12 @@ package org.apache.lucene.search.suggest.analyzing; import java.io.StringReader; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.MockTokenizer; public class TestSuggestStopFilter extends BaseTokenStreamTestCase { diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java index 12a3aea9d28..5acbcfee415 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestSuggestStopFilterFactory.java @@ -19,9 +19,9 @@ package org.apache.lucene.search.suggest.analyzing; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.en.EnglishAnalyzer; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.util.ClasspathResourceLoader; import org.apache.lucene.util.ResourceLoader; import org.apache.lucene.util.Version; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java index 43c7b95a375..01eb834a6b0 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextQuery.java @@ -26,15 +26,15 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java index 39a4b8eda4e..dc6eda184d1 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestContextSuggestField.java @@ -16,26 +16,26 @@ */ package org.apache.lucene.search.suggest.document; -import static org.apache.lucene.analysis.BaseTokenStreamTestCase.assertTokenStreamContents; import static org.apache.lucene.search.suggest.document.TestSuggestField.Entry; import static org.apache.lucene.search.suggest.document.TestSuggestField.assertSuggestions; import static org.apache.lucene.search.suggest.document.TestSuggestField.iwcWithSuggestField; +import static org.apache.lucene.tests.analysis.BaseTokenStreamTestCase.assertTokenStreamContents; import java.io.ByteArrayOutputStream; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.miscellaneous.ConcatenateGraphFilter; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; import org.apache.lucene.store.OutputStreamDataOutput; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CharsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestFuzzyCompletionQuery.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestFuzzyCompletionQuery.java index e8a5531d5a5..d0480a0380c 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestFuzzyCompletionQuery.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestFuzzyCompletionQuery.java @@ -21,13 +21,13 @@ import static org.apache.lucene.search.suggest.document.TestSuggestField.assertS import static org.apache.lucene.search.suggest.document.TestSuggestField.iwcWithSuggestField; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestPrefixCompletionQuery.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestPrefixCompletionQuery.java index 172f43b285c..44cde82dfa2 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestPrefixCompletionQuery.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestPrefixCompletionQuery.java @@ -25,9 +25,6 @@ import static org.hamcrest.core.IsEqual.equalTo; import java.io.IOException; import java.util.Objects; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenFilter; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -36,15 +33,18 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.DocValues; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SortedNumericDocValues; import org.apache.lucene.index.Term; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.suggest.BitsProducer; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenFilter; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestRegexCompletionQuery.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestRegexCompletionQuery.java index 738ce252ff7..57a858bd300 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestRegexCompletionQuery.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestRegexCompletionQuery.java @@ -21,14 +21,14 @@ import static org.apache.lucene.search.suggest.document.TestSuggestField.assertS import static org.apache.lucene.search.suggest.document.TestSuggestField.iwcWithSuggestField; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java index 9000e019337..3220647289c 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java @@ -16,7 +16,7 @@ */ package org.apache.lucene.search.suggest.document; -import static org.apache.lucene.analysis.BaseTokenStreamTestCase.assertTokenStreamContents; +import static org.apache.lucene.tests.analysis.BaseTokenStreamTestCase.assertTokenStreamContents; import static org.hamcrest.core.IsEqual.equalTo; import com.carrotsearch.randomizedtesting.generators.RandomPicks; @@ -33,7 +33,6 @@ import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CyclicBarrier; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.miscellaneous.ConcatenateGraphFilter; @@ -50,7 +49,6 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; @@ -59,12 +57,14 @@ import org.apache.lucene.search.suggest.Lookup; import org.apache.lucene.search.suggest.document.TopSuggestDocs.SuggestScoreDoc; import org.apache.lucene.store.Directory; import org.apache.lucene.store.OutputStreamDataOutput; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CharsRefBuilder; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestBytesRefSorters.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestBytesRefSorters.java index 80b7687131a..80a6351d571 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestBytesRefSorters.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestBytesRefSorters.java @@ -24,10 +24,10 @@ import java.util.Comparator; import java.util.Random; import org.apache.lucene.search.suggest.InMemorySorter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefIterator; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.OfflineSorter; import org.junit.Test; diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestFSTCompletion.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestFSTCompletion.java index 29b388301fe..adcaaf12bba 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestFSTCompletion.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestFSTCompletion.java @@ -22,6 +22,8 @@ import org.apache.lucene.search.suggest.*; import org.apache.lucene.search.suggest.Lookup.LookupResult; import org.apache.lucene.search.suggest.fst.FSTCompletion.Completion; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.*; /** Unit tests for {@link FSTCompletion}. */ diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestWFSTCompletion.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestWFSTCompletion.java index c2f4fbe3598..cb31e2039af 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestWFSTCompletion.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestWFSTCompletion.java @@ -21,9 +21,9 @@ import org.apache.lucene.search.suggest.Input; import org.apache.lucene.search.suggest.InputArrayIterator; import org.apache.lucene.search.suggest.Lookup.LookupResult; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestWFSTCompletion extends LuceneTestCase { diff --git a/lucene/test-framework/build.gradle b/lucene/test-framework/build.gradle index ce9355b8913..7eff02317b2 100644 --- a/lucene/test-framework/build.gradle +++ b/lucene/test-framework/build.gradle @@ -20,15 +20,15 @@ apply plugin: 'java-library' description = 'Framework for testing Lucene-based applications' dependencies { - api project(':lucene:core') + moduleApi project(':lucene:core') - api ("com.carrotsearch.randomizedtesting:randomizedtesting-runner", { + moduleApi ("com.carrotsearch.randomizedtesting:randomizedtesting-runner", { exclude group: "junit" }) - api ("junit:junit", { + moduleApi ("junit:junit", { exclude group: "org.hamcrest" }) - api ('org.hamcrest:hamcrest') + moduleApi ('org.hamcrest:hamcrest') - implementation project(':lucene:codecs') + moduleImplementation project(':lucene:codecs') } diff --git a/lucene/test-framework/src/java/module-info.java b/lucene/test-framework/src/java/module-info.java new file mode 100644 index 00000000000..3abd9ca4df5 --- /dev/null +++ b/lucene/test-framework/src/java/module-info.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Lucene test framework. */ +@SuppressWarnings({"module", "requires-automatic"}) +module org.apache.lucene.test_framework { + requires org.apache.lucene.core; + requires org.apache.lucene.codecs; + requires java.logging; + requires junit; + requires randomizedtesting.runner; + + exports org.apache.lucene.tests.analysis.standard; + exports org.apache.lucene.tests.analysis; + exports org.apache.lucene.tests.codecs.asserting; + exports org.apache.lucene.tests.codecs.blockterms; + exports org.apache.lucene.tests.codecs.bloom; + exports org.apache.lucene.tests.codecs.cheapbastard; + exports org.apache.lucene.tests.codecs.compressing.dummy; + exports org.apache.lucene.tests.codecs.compressing; + exports org.apache.lucene.tests.codecs.cranky; + exports org.apache.lucene.tests.codecs.mockrandom; + exports org.apache.lucene.tests.codecs.ramonly; + exports org.apache.lucene.tests.codecs.uniformsplit.sharedterms; + exports org.apache.lucene.tests.codecs.uniformsplit; + exports org.apache.lucene.tests.geo; + exports org.apache.lucene.tests.index; + exports org.apache.lucene.tests.mockfile; + exports org.apache.lucene.tests.search.similarities; + exports org.apache.lucene.tests.search; + exports org.apache.lucene.tests.store; + exports org.apache.lucene.tests.util.automaton; + exports org.apache.lucene.tests.util.fst; + exports org.apache.lucene.tests.util; + + provides org.apache.lucene.codecs.Codec with + org.apache.lucene.tests.codecs.asserting.AssertingCodec, + org.apache.lucene.tests.codecs.cheapbastard.CheapBastardCodec, + org.apache.lucene.tests.codecs.compressing.DeflateWithPresetCompressingCodec, + org.apache.lucene.tests.codecs.compressing.FastCompressingCodec, + org.apache.lucene.tests.codecs.compressing.FastDecompressionCompressingCodec, + org.apache.lucene.tests.codecs.compressing.HighCompressionCompressingCodec, + org.apache.lucene.tests.codecs.compressing.LZ4WithPresetCompressingCodec, + org.apache.lucene.tests.codecs.compressing.dummy.DummyCompressingCodec; + provides org.apache.lucene.codecs.DocValuesFormat with + org.apache.lucene.tests.codecs.asserting.AssertingDocValuesFormat; + provides org.apache.lucene.codecs.KnnVectorsFormat with + org.apache.lucene.tests.codecs.asserting.AssertingKnnVectorsFormat; + provides org.apache.lucene.codecs.PostingsFormat with + org.apache.lucene.tests.codecs.mockrandom.MockRandomPostingsFormat, + org.apache.lucene.tests.codecs.ramonly.RAMOnlyPostingsFormat, + org.apache.lucene.tests.codecs.blockterms.LuceneFixedGap, + org.apache.lucene.tests.codecs.blockterms.LuceneVarGapFixedInterval, + org.apache.lucene.tests.codecs.blockterms.LuceneVarGapDocFreqInterval, + org.apache.lucene.tests.codecs.bloom.TestBloomFilteredLucenePostings, + org.apache.lucene.tests.codecs.asserting.AssertingPostingsFormat, + org.apache.lucene.tests.codecs.uniformsplit.UniformSplitRot13PostingsFormat, + org.apache.lucene.tests.codecs.uniformsplit.sharedterms.STUniformSplitRot13PostingsFormat; +} diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/package.html b/lucene/test-framework/src/java/org/apache/lucene/analysis/package.html deleted file mode 100644 index 0f787b28181..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/package.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - -Support for testing analysis components. -

-The main classes of interest are: -

- - diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/package.html b/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/package.html deleted file mode 100644 index f7535b2ecfa..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -Classes to support StandardAnalyzer component testing - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/MissingOrdRemapper.java b/lucene/test-framework/src/java/org/apache/lucene/codecs/MissingOrdRemapper.java deleted file mode 100644 index b3a0805c392..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/MissingOrdRemapper.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.lucene.codecs; - -import java.util.Iterator; -import org.apache.lucene.util.BytesRef; - -/** - * a utility class to write missing values for SORTED as if they were the empty string (to simulate - * pre-Lucene4.5 dv behavior for testing old codecs) - */ -public class MissingOrdRemapper { - - /** insert an empty byte[] to the front of this iterable */ - public static Iterable insertEmptyValue(final Iterable iterable) { - return new Iterable() { - @Override - public Iterator iterator() { - return new Iterator() { - boolean seenEmpty = false; - Iterator in = iterable.iterator(); - - @Override - public boolean hasNext() { - return !seenEmpty || in.hasNext(); - } - - @Override - public BytesRef next() { - if (!seenEmpty) { - seenEmpty = true; - return new BytesRef(); - } else { - return in.next(); - } - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - }; - } - - /** remaps ord -1 to ord 0 on this iterable. */ - public static Iterable mapMissingToOrd0(final Iterable iterable) { - return new Iterable() { - @Override - public Iterator iterator() { - return new Iterator() { - Iterator in = iterable.iterator(); - - @Override - public boolean hasNext() { - return in.hasNext(); - } - - @Override - public Number next() { - Number n = in.next(); - if (n.longValue() == -1) { - return 0; - } else { - return n; - } - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - }; - } - - /** remaps every ord+1 on this iterable */ - public static Iterable mapAllOrds(final Iterable iterable) { - return new Iterable() { - @Override - public Iterator iterator() { - return new Iterator() { - Iterator in = iterable.iterator(); - - @Override - public boolean hasNext() { - return in.hasNext(); - } - - @Override - public Number next() { - Number n = in.next(); - return n.longValue() + 1; - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - }; - } -} diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/package.html b/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/package.html deleted file mode 100644 index 5fc71d94f67..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -Codecs for testing that support {@link org.apache.lucene.codecs.blockterms} - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/package.html b/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/package.html deleted file mode 100644 index 5142a33d1ec..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -Support for generating test indexes using the BloomFilteringPostingsFormat - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/package.html b/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/package.html deleted file mode 100644 index 19a617e22c9..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -Support for testing {@link org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingStoredFieldsFormat}. - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/package.html b/lucene/test-framework/src/java/org/apache/lucene/codecs/package.html deleted file mode 100644 index 3185dec7d2e..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -Codecs for testing (simulate old disk formats, wacky theoretical use cases, etc) - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/package.html b/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/package.html deleted file mode 100644 index 53dd15addab..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/package.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - -Test PostingsFormat for testing {@link org.apache.lucene.codecs.uniformsplit} with block encryption using basic ROT13. - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/package.html b/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/package.html deleted file mode 100644 index 5b4510cac11..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/package.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - -Test PostingsFormat for testing {@link org.apache.lucene.codecs.uniformsplit.sharedterms} with block encryption using basic ROT13. - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/geo/package.html b/lucene/test-framework/src/java/org/apache/lucene/geo/package.html deleted file mode 100644 index 874d1a581d0..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/geo/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -Reusable Geo test utilities. - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/IndexWriterMaxDocsChanger.java b/lucene/test-framework/src/java/org/apache/lucene/index/IndexWriterMaxDocsChanger.java deleted file mode 100644 index 8a3497174e1..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/index/IndexWriterMaxDocsChanger.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.lucene.index; - -import org.apache.lucene.util.LuceneTestCase; - -/** - * Accessor to make some package protected methods in {@link IndexWriter} available for testing. - * - * @lucene.internal - */ -public final class IndexWriterMaxDocsChanger { - - private IndexWriterMaxDocsChanger() {} - - /** - * Tells {@link IndexWriter} to enforce the specified limit as the maximum number of documents in - * one index; call {@link #restoreMaxDocs} once your test is done. - * - * @see LuceneTestCase#setIndexWriterMaxDocs(int) - */ - public static void setMaxDocs(int limit) { - IndexWriter.setMaxDocs(limit); - } - - /** - * Returns to the default {@link IndexWriter#MAX_DOCS} limit. - * - * @see LuceneTestCase#restoreIndexWriterMaxDocs() - */ - public static void restoreMaxDocs() { - IndexWriter.setMaxDocs(IndexWriter.MAX_DOCS); - } -} diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/package.html b/lucene/test-framework/src/java/org/apache/lucene/index/package.html deleted file mode 100644 index 383c56c69c7..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/index/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - -Support for testing of indexes. -

-The primary classes are: -

    -
  • {@link org.apache.lucene.index.RandomIndexWriter}: Randomizes the indexing experience. -
  • {@link org.apache.lucene.index.MockRandomMergePolicy}: MergePolicy that makes random decisions. -
- - diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/package.html b/lucene/test-framework/src/java/org/apache/lucene/search/package.html deleted file mode 100644 index c0360fdd3c7..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/search/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - -Support for testing search components. -

-The primary classes are: -

    -
  • {@link org.apache.lucene.search.QueryUtils}: Useful methods for testing Query classes. -
  • {@link org.apache.lucene.search.ShardSearchingTestBase}: Base class for simulating distributed search. -
- - diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/package.html b/lucene/test-framework/src/java/org/apache/lucene/search/similarities/package.html deleted file mode 100644 index aaabf2c127b..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/package.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - -Support for testing similarities -

-The primary classes are: -

    -
  • {@link org.apache.lucene.search.similarities.RandomSimilarity}: Randomizes similarity per-field in tests. -
- - diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/package.html b/lucene/test-framework/src/java/org/apache/lucene/store/package.html deleted file mode 100644 index 84c72a348ed..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/store/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - -Support for testing store mechanisms. -

-The primary class is {@link org.apache.lucene.store.MockDirectoryWrapper}, which -wraps any Directory implementation and provides additional checks. - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamFactoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/BaseTokenStreamFactoryTestCase.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamFactoryTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/BaseTokenStreamFactoryTestCase.java index 5aea57b9bdb..5013b1ac895 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamFactoryTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/BaseTokenStreamFactoryTestCase.java @@ -14,11 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; +import org.apache.lucene.analysis.AbstractAnalysisFactory; +import org.apache.lucene.analysis.CharFilterFactory; +import org.apache.lucene.analysis.TokenFilterFactory; +import org.apache.lucene.analysis.TokenizerFactory; import org.apache.lucene.util.ClasspathResourceLoader; import org.apache.lucene.util.ResourceLoader; import org.apache.lucene.util.ResourceLoaderAware; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/BaseTokenStreamTestCase.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/BaseTokenStreamTestCase.java index 71cf29f734f..7009247b086 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/BaseTokenStreamTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.io.PrintWriter; @@ -27,6 +27,9 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.util.*; import java.util.concurrent.CountDownLatch; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.TokenStreamToAutomaton; import org.apache.lucene.analysis.tokenattributes.*; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -34,8 +37,12 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexableFieldType; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.Rethrow; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.Attribute; import org.apache.lucene.util.AttributeFactory; import org.apache.lucene.util.AttributeImpl; @@ -44,11 +51,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.Rethrow; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.fst.Util; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/CannedBinaryTokenStream.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CannedBinaryTokenStream.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/CannedBinaryTokenStream.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CannedBinaryTokenStream.java index 9ec9eee1611..4ee51a54e29 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/CannedBinaryTokenStream.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CannedBinaryTokenStream.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.BytesTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/CannedTokenStream.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CannedTokenStream.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/CannedTokenStream.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CannedTokenStream.java index 3a208078d43..7188e22e026 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/CannedTokenStream.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CannedTokenStream.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CollationTestBase.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CollationTestBase.java index 80c2b0f5398..9c0c3815f5f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CollationTestBase.java @@ -14,11 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.HashMap; import java.util.Map; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -37,9 +39,9 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Base test class for testing Unicode collation. */ public abstract class CollationTestBase extends LuceneTestCase { diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/CrankyTokenFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CrankyTokenFilter.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/CrankyTokenFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CrankyTokenFilter.java index d0a82761b53..ff701d6beb2 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/CrankyTokenFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/CrankyTokenFilter.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.Random; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; /** * Throws IOException from random Tokenstream methods. diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/LookaheadTokenFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/LookaheadTokenFilter.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/LookaheadTokenFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/LookaheadTokenFilter.java index 99e774149f4..ddd053ecd27 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/LookaheadTokenFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/LookaheadTokenFilter.java @@ -14,11 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockAnalyzer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockAnalyzer.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockAnalyzer.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockAnalyzer.java index a9a7501ab07..cb3e7f855e1 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockAnalyzer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockAnalyzer.java @@ -14,12 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.util.HashMap; import java.util.Map; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.automaton.CharacterRunAutomaton; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockBytesAnalyzer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockBytesAnalyzer.java similarity index 91% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockBytesAnalyzer.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockBytesAnalyzer.java index 80ca7c65c28..69c1b3b4558 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockBytesAnalyzer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockBytesAnalyzer.java @@ -14,8 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.util.AttributeFactory; /** Analyzer for testing that encodes terms as UTF-16 bytes. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockCharFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockCharFilter.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockCharFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockCharFilter.java index 58b724dddec..676e1dbcbde 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockCharFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockCharFilter.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.io.Reader; import java.util.Map; import java.util.TreeMap; +import org.apache.lucene.analysis.CharFilter; /** * the purpose of this charfilter is to send offsets out of bounds if the analyzer doesn't use diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockFixedLengthPayloadFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockFixedLengthPayloadFilter.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockFixedLengthPayloadFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockFixedLengthPayloadFilter.java index d248034a549..1383e0e4637 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockFixedLengthPayloadFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockFixedLengthPayloadFilter.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.Random; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; import org.apache.lucene.util.BytesRef; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockGraphTokenFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockGraphTokenFilter.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockGraphTokenFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockGraphTokenFilter.java index 77021d6f001..29abd9f300a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockGraphTokenFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockGraphTokenFilter.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.Random; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; // TODO: sometimes remove tokens too...? diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockHoleInjectingTokenFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockHoleInjectingTokenFilter.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockHoleInjectingTokenFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockHoleInjectingTokenFilter.java index fdd20ab5d29..6be1ef0442a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockHoleInjectingTokenFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockHoleInjectingTokenFilter.java @@ -14,13 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.Random; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; // TODO: maybe, instead to be more "natural", we should make // a MockRemovesTokensTF, ideally subclassing FilteringTF diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockLowerCaseFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockLowerCaseFilter.java similarity index 88% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockLowerCaseFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockLowerCaseFilter.java index 8f821fc506d..5f9fe59bb63 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockLowerCaseFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockLowerCaseFilter.java @@ -14,9 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; +import org.apache.lucene.analysis.CharacterUtils; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; /** A lowercasing {@link TokenFilter}. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockPayloadAnalyzer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockPayloadAnalyzer.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockPayloadAnalyzer.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockPayloadAnalyzer.java index 2c186422da7..d10b0bccbbe 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockPayloadAnalyzer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockPayloadAnalyzer.java @@ -14,10 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.nio.charset.StandardCharsets; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockRandomLookaheadTokenFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockRandomLookaheadTokenFilter.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockRandomLookaheadTokenFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockRandomLookaheadTokenFilter.java index 011a19b44eb..56fb06528a2 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockRandomLookaheadTokenFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockRandomLookaheadTokenFilter.java @@ -14,10 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.Random; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; /** Uses {@link LookaheadTokenFilter} to randomly peek at future tokens. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockReaderWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockReaderWrapper.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockReaderWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockReaderWrapper.java index 9a18e595d58..690f334da95 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockReaderWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockReaderWrapper.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.io.Reader; import java.util.Random; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; /** Wraps a Reader, and can throw random or fixed exceptions, and spoon feed read chars. */ public class MockReaderWrapper extends Reader { diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockSynonymAnalyzer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockSynonymAnalyzer.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockSynonymAnalyzer.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockSynonymAnalyzer.java index 5ad5d76e8d8..18ddeae3735 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockSynonymAnalyzer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockSynonymAnalyzer.java @@ -15,7 +15,9 @@ * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; + +import org.apache.lucene.analysis.Analyzer; /** adds synonym of "dog" for "dogs", and synonym of "cavy" for "guinea pig". */ public class MockSynonymAnalyzer extends Analyzer { diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockSynonymFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockSynonymFilter.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockSynonymFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockSynonymFilter.java index bf8a4e5034f..25f1c49c963 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockSynonymFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockSynonymFilter.java @@ -15,11 +15,13 @@ * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenFilter.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenFilter.java index e1c72070b29..991e4f45b7b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenFilter.java @@ -14,13 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import static org.apache.lucene.util.automaton.Automata.makeEmpty; import static org.apache.lucene.util.automaton.Automata.makeString; import java.io.IOException; import java.util.Arrays; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.util.automaton.CharacterRunAutomaton; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenizer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenizer.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenizer.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenizer.java index 01976bbb44b..a3e0343b896 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenizer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenizer.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import com.carrotsearch.randomizedtesting.RandomizedContext; import java.io.IOException; import java.nio.CharBuffer; import java.util.Random; +import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.util.AttributeFactory; @@ -339,7 +340,7 @@ public class MockTokenizer extends Tokenizer { } @Override - void setReaderTestPoint() { + protected void setReaderTestPoint() { try { if (streamState != State.CLOSE) { fail("setReader() called in wrong state: " + streamState); diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockUTF16TermAttributeImpl.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockUTF16TermAttributeImpl.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockUTF16TermAttributeImpl.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockUTF16TermAttributeImpl.java index fe8d652b20e..fb28e6fb1a5 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockUTF16TermAttributeImpl.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockUTF16TermAttributeImpl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.nio.charset.StandardCharsets; import org.apache.lucene.analysis.tokenattributes.CharTermAttributeImpl; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockVariableLengthPayloadFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockVariableLengthPayloadFilter.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/MockVariableLengthPayloadFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockVariableLengthPayloadFilter.java index 11c1c0fa4d1..a696188e3c5 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockVariableLengthPayloadFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockVariableLengthPayloadFilter.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.Random; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; import org.apache.lucene.util.BytesRef; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/SimplePayloadFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/SimplePayloadFilter.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/SimplePayloadFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/SimplePayloadFilter.java index 7324d52809e..dde3e8d8aa0 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/SimplePayloadFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/SimplePayloadFilter.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.nio.charset.StandardCharsets; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PayloadAttribute; import org.apache.lucene.util.BytesRef; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/Token.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/Token.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/Token.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/Token.java index 4940e0b0637..193d57e82b2 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/Token.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/Token.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import org.apache.lucene.analysis.tokenattributes.FlagsAttribute; import org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/TokenStreamToDot.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/TokenStreamToDot.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/TokenStreamToDot.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/TokenStreamToDot.java index cef3b88de8a..999334858f2 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/TokenStreamToDot.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/TokenStreamToDot.java @@ -14,10 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.io.PrintWriter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/ValidatingTokenFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/ValidatingTokenFilter.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/ValidatingTokenFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/ValidatingTokenFilter.java index 0f37ac66470..3523b69c2d6 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/ValidatingTokenFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/ValidatingTokenFilter.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.io.PrintStream; @@ -23,6 +23,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; +import org.apache.lucene.analysis.TokenFilter; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; @@ -211,7 +213,7 @@ public final class ValidatingTokenFilter extends TokenFilter { */ public static void dumpValidatingTokenFilters(TokenStream in, PrintStream out) { if (in instanceof TokenFilter) { - dumpValidatingTokenFilters(((TokenFilter) in).input, out); + dumpValidatingTokenFilters(((TokenFilter) in).unwrap(), out); if (in instanceof ValidatingTokenFilter) { out.println(((ValidatingTokenFilter) in).dump()); } diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/VocabularyAssert.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/VocabularyAssert.java index 5e2bbe1075a..5da8ce80fd9 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/VocabularyAssert.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.BufferedReader; import java.io.IOException; @@ -23,8 +23,9 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Assert; /** Utility class for doing vocabulary-based stemming tests */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/package-info.java new file mode 100644 index 00000000000..cc7cb816969 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/package-info.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing analysis components. + * + *

The main classes of interest are: + * + *

    + *
  • {@link org.apache.lucene.tests.analysis.BaseTokenStreamTestCase}: Highly recommended to use + * its helper methods, (especially in conjunction with {@link + * org.apache.lucene.tests.analysis.MockAnalyzer} or {@link + * org.apache.lucene.tests.analysis.MockTokenizer}), as it contains many assertions and checks + * to catch bugs. + *
  • {@link org.apache.lucene.tests.analysis.MockTokenizer}: Tokenizer for testing. Tokenizer + * that serves as a replacement for WHITESPACE, SIMPLE, and KEYWORD tokenizers. If you are + * writing a component such as a {@link org.apache.lucene.analysis.TokenFilter}, it's a great + * idea to test it wrapping this tokenizer instead for extra checks. + *
  • {@link org.apache.lucene.tests.analysis.MockAnalyzer}: Analyzer for testing. Analyzer that + * uses MockTokenizer for additional verification. If you are testing a custom component such + * as a queryparser or analyzer-wrapper that consumes analysis streams, it's a great idea to + * test it with this analyzer instead. + *
+ */ +package org.apache.lucene.tests.analysis; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/EmojiTokenizationTestUnicode_12_1.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/EmojiTokenizationTestUnicode_12_1.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/standard/EmojiTokenizationTestUnicode_12_1.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/EmojiTokenizationTestUnicode_12_1.java index 8defc01f004..3e291100914 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/EmojiTokenizationTestUnicode_12_1.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/EmojiTokenizationTestUnicode_12_1.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.lucene.analysis.standard; +package org.apache.lucene.tests.analysis.standard; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.junit.Ignore; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/WordBreakTestUnicode_12_1_0.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/WordBreakTestUnicode_12_1_0.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/standard/WordBreakTestUnicode_12_1_0.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/WordBreakTestUnicode_12_1_0.java index 66474a9e26c..238301c7f3c 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/WordBreakTestUnicode_12_1_0.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/WordBreakTestUnicode_12_1_0.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.lucene.analysis.standard; +package org.apache.lucene.tests.analysis.standard; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.BaseTokenStreamTestCase; +import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.junit.Ignore; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/generateEmojiTokenizationTest.pl b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/generateEmojiTokenizationTest.pl similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/standard/generateEmojiTokenizationTest.pl rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/generateEmojiTokenizationTest.pl index 446253d8f3e..95c504f2fcc 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/generateEmojiTokenizationTest.pl +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/generateEmojiTokenizationTest.pl @@ -53,7 +53,7 @@ my $header =<<"__HEADER__"; * limitations under the License. */ -package org.apache.lucene.analysis.standard; +package org.apache.lucene.tests.analysis.standard; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.BaseTokenStreamTestCase; diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/generateJavaUnicodeWordBreakTest.pl b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/generateJavaUnicodeWordBreakTest.pl similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/analysis/standard/generateJavaUnicodeWordBreakTest.pl rename to lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/generateJavaUnicodeWordBreakTest.pl index fd86b83037e..07f7afe86ff 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/standard/generateJavaUnicodeWordBreakTest.pl +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/generateJavaUnicodeWordBreakTest.pl @@ -59,7 +59,7 @@ my $header =<<"__HEADER__"; * limitations under the License. */ -package org.apache.lucene.analysis.standard; +package org.apache.lucene.tests.analysis.standard; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.BaseTokenStreamTestCase; diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/package-info.java new file mode 100644 index 00000000000..f2d4e6c0b13 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/analysis/standard/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Classes to support {@link org.apache.lucene.analysis.standard.StandardAnalyzer} component + * testing. + */ +package org.apache.lucene.tests.analysis.standard; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingCodec.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingCodec.java index f89b9d7905b..0aded31855e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingCodec.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.FilterCodec; @@ -28,7 +28,7 @@ import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat; import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat; import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; /** Acts like the default codec but with additional asserts. */ public class AssertingCodec extends FilterCodec { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDocValuesFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingDocValuesFormat.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDocValuesFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingDocValuesFormat.java index 5e7a7f23429..a32f2ac57e8 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDocValuesFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingDocValuesFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; @@ -22,7 +22,6 @@ import java.io.IOException; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.DocValuesProducer; -import org.apache.lucene.index.AssertingLeafReader; import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.FieldInfo; @@ -32,10 +31,11 @@ import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.index.SortedNumericDocValues; import org.apache.lucene.index.SortedSetDocValues; +import org.apache.lucene.tests.index.AssertingLeafReader; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.LongBitSet; -import org.apache.lucene.util.TestUtil; /** Just like the default but with additional asserts. */ public class AssertingDocValuesFormat extends DocValuesFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingKnnVectorsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingKnnVectorsFormat.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingKnnVectorsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingKnnVectorsFormat.java index 180c6dfcf93..6b17d3655ac 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingKnnVectorsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingKnnVectorsFormat.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import java.io.IOException; import org.apache.lucene.codecs.KnnVectorsFormat; @@ -26,8 +26,8 @@ import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.VectorValues; import org.apache.lucene.search.TopDocs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.TestUtil; /** Wraps the default KnnVectorsFormat and provides additional assertions. */ public class AssertingKnnVectorsFormat extends KnnVectorsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingLiveDocsFormat.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingLiveDocsFormat.java index 54f7ba1fe8b..f45ea821a55 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingLiveDocsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import java.io.IOException; import java.util.Collection; @@ -22,8 +22,8 @@ import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.index.SegmentCommitInfo; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.TestUtil; /** Just like the default live docs format but with additional asserts. */ public class AssertingLiveDocsFormat extends LiveDocsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingNormsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingNormsFormat.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingNormsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingNormsFormat.java index e2d11c4b59f..2dea74846c8 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingNormsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingNormsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; @@ -22,12 +22,12 @@ import java.io.IOException; import org.apache.lucene.codecs.NormsConsumer; import org.apache.lucene.codecs.NormsFormat; import org.apache.lucene.codecs.NormsProducer; -import org.apache.lucene.index.AssertingLeafReader; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.AssertingLeafReader; +import org.apache.lucene.tests.util.TestUtil; /** Just like the default but with additional asserts. */ public class AssertingNormsFormat extends NormsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPointsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingPointsFormat.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPointsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingPointsFormat.java index 5083d1b88b6..2b68a59e135 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPointsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingPointsFormat.java @@ -14,19 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import java.io.IOException; import org.apache.lucene.codecs.PointsFormat; import org.apache.lucene.codecs.PointsReader; import org.apache.lucene.codecs.PointsWriter; -import org.apache.lucene.index.AssertingLeafReader; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.MergeState; import org.apache.lucene.index.PointValues; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.index.AssertingLeafReader; +import org.apache.lucene.tests.util.TestUtil; /** Just like the default point format but with additional asserts. */ public final class AssertingPointsFormat extends PointsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPostingsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingPostingsFormat.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPostingsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingPostingsFormat.java index d6012dc1f82..72074227491 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPostingsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingPostingsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import java.io.IOException; import java.util.Iterator; @@ -22,7 +22,6 @@ import org.apache.lucene.codecs.FieldsConsumer; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.NormsProducer; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.index.AssertingLeafReader; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.Fields; import org.apache.lucene.index.IndexOptions; @@ -32,9 +31,10 @@ import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.tests.index.AssertingLeafReader; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; -import org.apache.lucene.util.TestUtil; /** Just like the default postings format but with additional asserts. */ public final class AssertingPostingsFormat extends PostingsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingStoredFieldsFormat.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingStoredFieldsFormat.java index cd123d7a51b..ed750557c71 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingStoredFieldsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingStoredFieldsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import java.io.IOException; import java.util.Collection; @@ -28,8 +28,8 @@ import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.index.StoredFieldVisitor; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Accountable; -import org.apache.lucene.util.TestUtil; /** Just like the default stored fields format but with additional asserts. */ public class AssertingStoredFieldsFormat extends StoredFieldsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingTermVectorsFormat.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingTermVectorsFormat.java index 10433dd5b72..209ef5150b6 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/AssertingTermVectorsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import java.io.IOException; import java.util.Collection; @@ -22,16 +22,16 @@ import java.util.Collections; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.TermVectorsReader; import org.apache.lucene.codecs.TermVectorsWriter; -import org.apache.lucene.index.AssertingLeafReader; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.Fields; import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.index.AssertingLeafReader; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Accountable; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; /** Just like the default vectors format but with additional asserts. */ public class AssertingTermVectorsFormat extends TermVectorsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/package-info.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/package-info.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/package-info.java index 164584ed4a6..6b45094d9cc 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/package-info.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/asserting/package-info.java @@ -16,4 +16,4 @@ */ /** Codec for testing that asserts various contracts of the codec apis. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneFixedGap.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneFixedGap.java similarity index 89% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneFixedGap.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneFixedGap.java index 0d9f1e05832..3c21de0f128 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneFixedGap.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneFixedGap.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.blockterms; +package org.apache.lucene.tests.codecs.blockterms; import java.io.IOException; import org.apache.lucene.codecs.FieldsConsumer; @@ -22,6 +22,12 @@ import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.PostingsReaderBase; import org.apache.lucene.codecs.PostingsWriterBase; +import org.apache.lucene.codecs.blockterms.BlockTermsReader; +import org.apache.lucene.codecs.blockterms.BlockTermsWriter; +import org.apache.lucene.codecs.blockterms.FixedGapTermsIndexReader; +import org.apache.lucene.codecs.blockterms.FixedGapTermsIndexWriter; +import org.apache.lucene.codecs.blockterms.TermsIndexReaderBase; +import org.apache.lucene.codecs.blockterms.TermsIndexWriterBase; import org.apache.lucene.codecs.lucene90.Lucene90PostingsFormat; // javadocs import org.apache.lucene.codecs.lucene90.Lucene90PostingsReader; import org.apache.lucene.codecs.lucene90.Lucene90PostingsWriter; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneVarGapDocFreqInterval.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneVarGapDocFreqInterval.java similarity index 89% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneVarGapDocFreqInterval.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneVarGapDocFreqInterval.java index 765885a46b7..6a38882c153 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneVarGapDocFreqInterval.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneVarGapDocFreqInterval.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.blockterms; +package org.apache.lucene.tests.codecs.blockterms; import java.io.IOException; import org.apache.lucene.codecs.FieldsConsumer; @@ -22,6 +22,13 @@ import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.PostingsReaderBase; import org.apache.lucene.codecs.PostingsWriterBase; +import org.apache.lucene.codecs.blockterms.BlockTermsReader; +import org.apache.lucene.codecs.blockterms.BlockTermsWriter; +import org.apache.lucene.codecs.blockterms.FixedGapTermsIndexWriter; +import org.apache.lucene.codecs.blockterms.TermsIndexReaderBase; +import org.apache.lucene.codecs.blockterms.TermsIndexWriterBase; +import org.apache.lucene.codecs.blockterms.VariableGapTermsIndexReader; +import org.apache.lucene.codecs.blockterms.VariableGapTermsIndexWriter; import org.apache.lucene.codecs.lucene90.Lucene90PostingsFormat; // javadocs import org.apache.lucene.codecs.lucene90.Lucene90PostingsReader; import org.apache.lucene.codecs.lucene90.Lucene90PostingsWriter; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneVarGapFixedInterval.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneVarGapFixedInterval.java similarity index 88% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneVarGapFixedInterval.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneVarGapFixedInterval.java index 7fc9201b0d3..838d2968c7f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/blockterms/LuceneVarGapFixedInterval.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/LuceneVarGapFixedInterval.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.blockterms; +package org.apache.lucene.tests.codecs.blockterms; import java.io.IOException; import org.apache.lucene.codecs.FieldsConsumer; @@ -22,6 +22,13 @@ import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.PostingsReaderBase; import org.apache.lucene.codecs.PostingsWriterBase; +import org.apache.lucene.codecs.blockterms.BlockTermsReader; +import org.apache.lucene.codecs.blockterms.BlockTermsWriter; +import org.apache.lucene.codecs.blockterms.FixedGapTermsIndexWriter; +import org.apache.lucene.codecs.blockterms.TermsIndexReaderBase; +import org.apache.lucene.codecs.blockterms.TermsIndexWriterBase; +import org.apache.lucene.codecs.blockterms.VariableGapTermsIndexReader; +import org.apache.lucene.codecs.blockterms.VariableGapTermsIndexWriter; import org.apache.lucene.codecs.lucene90.Lucene90PostingsFormat; // javadocs import org.apache.lucene.codecs.lucene90.Lucene90PostingsReader; import org.apache.lucene.codecs.lucene90.Lucene90PostingsWriter; diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/package-info.java new file mode 100644 index 00000000000..81abf9cdee9 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/blockterms/package-info.java @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Codecs for testing that support {@link org.apache.lucene.codecs.blockterms}. */ +package org.apache.lucene.tests.codecs.blockterms; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/TestBloomFilteredLucenePostings.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/bloom/TestBloomFilteredLucenePostings.java similarity index 91% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/TestBloomFilteredLucenePostings.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/bloom/TestBloomFilteredLucenePostings.java index 29a14f8f01c..abcc6eae5e7 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/TestBloomFilteredLucenePostings.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/bloom/TestBloomFilteredLucenePostings.java @@ -14,16 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.bloom; +package org.apache.lucene.tests.codecs.bloom; import java.io.IOException; import org.apache.lucene.codecs.FieldsConsumer; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.PostingsFormat; +import org.apache.lucene.codecs.bloom.BloomFilterFactory; +import org.apache.lucene.codecs.bloom.BloomFilteringPostingsFormat; +import org.apache.lucene.codecs.bloom.FuzzySet; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; /** * A class used for testing {@link BloomFilteringPostingsFormat} with a concrete delegate diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/bloom/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/bloom/package-info.java new file mode 100644 index 00000000000..eecc3ffbefc --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/bloom/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for generating test indexes using the {@link + * org.apache.lucene.codecs.bloom.BloomFilteringPostingsFormat}. + */ +package org.apache.lucene.tests.codecs.bloom; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cheapbastard/CheapBastardCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cheapbastard/CheapBastardCodec.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cheapbastard/CheapBastardCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cheapbastard/CheapBastardCodec.java index 1da4301ea16..5355e553a97 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cheapbastard/CheapBastardCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cheapbastard/CheapBastardCodec.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cheapbastard; +package org.apache.lucene.tests.codecs.cheapbastard; import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.util.TestUtil; /** Codec that tries to use as little ram as possible because he spent all his money on beer */ // TODO: better name :) diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cheapbastard/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cheapbastard/package-info.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cheapbastard/package-info.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cheapbastard/package-info.java index 4896800d61b..d764295f639 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cheapbastard/package-info.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cheapbastard/package-info.java @@ -19,4 +19,4 @@ * Codec that unreasonably tries to use as little RAM as possible. For testing, benchmarking, API * purposes only! */ -package org.apache.lucene.codecs.cheapbastard; +package org.apache.lucene.tests.codecs.cheapbastard; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/CompressingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/CompressingCodec.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/CompressingCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/CompressingCodec.java index f379184c5e1..006951217be 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/CompressingCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/CompressingCodec.java @@ -14,17 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.compressing; +package org.apache.lucene.tests.codecs.compressing; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.util.Random; import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; -import org.apache.lucene.codecs.compressing.dummy.DummyCompressingCodec; +import org.apache.lucene.codecs.compressing.CompressionMode; import org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingStoredFieldsFormat; import org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingTermVectorsFormat; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.codecs.compressing.dummy.DummyCompressingCodec; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.packed.DirectMonotonicWriter; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/DeflateWithPresetCompressingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/DeflateWithPresetCompressingCodec.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/DeflateWithPresetCompressingCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/DeflateWithPresetCompressingCodec.java index eb99488c888..a9201b6e862 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/DeflateWithPresetCompressingCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/DeflateWithPresetCompressingCodec.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.compressing; +package org.apache.lucene.tests.codecs.compressing; import org.apache.lucene.codecs.lucene90.DeflateWithPresetDictCompressionMode; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/FastCompressingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/FastCompressingCodec.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/FastCompressingCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/FastCompressingCodec.java index 073f9aaa0eb..d5e04ac1b49 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/FastCompressingCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/FastCompressingCodec.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.compressing; +package org.apache.lucene.tests.codecs.compressing; + +import org.apache.lucene.codecs.compressing.CompressionMode; /** CompressionCodec that uses {@link CompressionMode#FAST} */ public class FastCompressingCodec extends CompressingCodec { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/FastDecompressionCompressingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/FastDecompressionCompressingCodec.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/FastDecompressionCompressingCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/FastDecompressionCompressingCodec.java index 6c5f6a78351..5e3fa035def 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/FastDecompressionCompressingCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/FastDecompressionCompressingCodec.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.compressing; +package org.apache.lucene.tests.codecs.compressing; + +import org.apache.lucene.codecs.compressing.CompressionMode; /** CompressionCodec that uses {@link CompressionMode#FAST_DECOMPRESSION} */ public class FastDecompressionCompressingCodec extends CompressingCodec { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/HighCompressionCompressingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/HighCompressionCompressingCodec.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/HighCompressionCompressingCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/HighCompressionCompressingCodec.java index 25fdaad3ba9..2039b6908f0 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/HighCompressionCompressingCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/HighCompressionCompressingCodec.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.compressing; +package org.apache.lucene.tests.codecs.compressing; + +import org.apache.lucene.codecs.compressing.CompressionMode; /** CompressionCodec that uses {@link CompressionMode#HIGH_COMPRESSION} */ public class HighCompressionCompressingCodec extends CompressingCodec { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/LZ4WithPresetCompressingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/LZ4WithPresetCompressingCodec.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/LZ4WithPresetCompressingCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/LZ4WithPresetCompressingCodec.java index e1e12b7dd2c..d0fd774fabc 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/LZ4WithPresetCompressingCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/LZ4WithPresetCompressingCodec.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.compressing; +package org.apache.lucene.tests.codecs.compressing; import org.apache.lucene.codecs.lucene90.LZ4WithPresetDictCompressionMode; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/dummy/DummyCompressingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/dummy/DummyCompressingCodec.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/dummy/DummyCompressingCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/dummy/DummyCompressingCodec.java index 1d838ee2d01..c8f486d5f40 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/dummy/DummyCompressingCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/dummy/DummyCompressingCodec.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.compressing.dummy; +package org.apache.lucene.tests.codecs.compressing.dummy; import java.io.IOException; -import org.apache.lucene.codecs.compressing.CompressingCodec; import org.apache.lucene.codecs.compressing.CompressionMode; import org.apache.lucene.codecs.compressing.Compressor; import org.apache.lucene.codecs.compressing.Decompressor; import org.apache.lucene.store.DataInput; import org.apache.lucene.store.DataOutput; +import org.apache.lucene.tests.codecs.compressing.CompressingCodec; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/dummy/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/dummy/package-info.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/dummy/package-info.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/dummy/package-info.java index 087536d545f..ce2c13d8603 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/compressing/dummy/package-info.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/dummy/package-info.java @@ -16,4 +16,4 @@ */ /** Dummy CompressingCodec implementation used for testing. */ -package org.apache.lucene.codecs.compressing.dummy; +package org.apache.lucene.tests.codecs.compressing.dummy; diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/package-info.java new file mode 100644 index 00000000000..7b264439eda --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/compressing/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing {@link + * org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingStoredFieldsFormat}. + */ +package org.apache.lucene.tests.codecs.compressing; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyCodec.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyCodec.java index 2b49306f7f2..dce369df31d 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyCodec.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.util.Random; import org.apache.lucene.codecs.Codec; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyCompoundFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyCompoundFormat.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyCompoundFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyCompoundFormat.java index 3ff3941371e..bced58d2a6f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyCompoundFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyCompoundFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Random; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyDocValuesFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyDocValuesFormat.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyDocValuesFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyDocValuesFormat.java index 6e74b0d725f..c42f9a90384 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyDocValuesFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyDocValuesFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Random; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyFieldInfosFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyFieldInfosFormat.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyFieldInfosFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyFieldInfosFormat.java index d442fb0cb44..f4008740301 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyFieldInfosFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyFieldInfosFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Random; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyLiveDocsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyLiveDocsFormat.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyLiveDocsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyLiveDocsFormat.java index 44b8b578263..7d508feed02 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyLiveDocsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyLiveDocsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Collection; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyNormsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyNormsFormat.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyNormsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyNormsFormat.java index 44998b10119..3e8a242a1f5 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyNormsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyNormsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Random; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyPointsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyPointsFormat.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyPointsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyPointsFormat.java index f368250f321..8c1f8dc79c7 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyPointsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyPointsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Random; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyPostingsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyPostingsFormat.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyPostingsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyPostingsFormat.java index 715bd2163a5..7d87ed1c8e1 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyPostingsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyPostingsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Random; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankySegmentInfoFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankySegmentInfoFormat.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankySegmentInfoFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankySegmentInfoFormat.java index 664a69a3691..a95202031cb 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankySegmentInfoFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankySegmentInfoFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Random; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyStoredFieldsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyStoredFieldsFormat.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyStoredFieldsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyStoredFieldsFormat.java index d12e68882a6..3637ba2f8d1 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyStoredFieldsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyStoredFieldsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Collection; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyTermVectorsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyTermVectorsFormat.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyTermVectorsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyTermVectorsFormat.java index d908231037e..b0078637895 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/CrankyTermVectorsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/CrankyTermVectorsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; import java.io.IOException; import java.util.Collection; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/package-info.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/package-info.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/package-info.java index a599238ef58..2bc61a826d0 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/cranky/package-info.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/cranky/package-info.java @@ -16,4 +16,4 @@ */ /** Codec for testing that throws random IOExceptions */ -package org.apache.lucene.codecs.cranky; +package org.apache.lucene.tests.codecs.cranky; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/MockRandomPostingsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/mockrandom/MockRandomPostingsFormat.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/MockRandomPostingsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/mockrandom/MockRandomPostingsFormat.java index c0914b3740a..814075d0efc 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/MockRandomPostingsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/mockrandom/MockRandomPostingsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.mockrandom; +package org.apache.lucene.tests.codecs.mockrandom; import java.io.IOException; import java.util.Random; @@ -47,9 +47,9 @@ import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.store.ChecksumIndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Randomly combines terms index impl w/ postings impls. */ public final class MockRandomPostingsFormat extends PostingsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/mockrandom/package-info.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/package-info.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/mockrandom/package-info.java index 5dcfc89fbd4..11033ea5cc8 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/mockrandom/package-info.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/mockrandom/package-info.java @@ -16,4 +16,4 @@ */ /** Frankenstein codec for testing that pieces together random components. */ -package org.apache.lucene.codecs.mockrandom; +package org.apache.lucene.tests.codecs.mockrandom; diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/package-info.java new file mode 100644 index 00000000000..d7a8e90036c --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/package-info.java @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Codecs for testing (simulate old disk formats, wacky theoretical use cases, etc). */ +package org.apache.lucene.tests.codecs; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/ramonly/RAMOnlyPostingsFormat.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/ramonly/RAMOnlyPostingsFormat.java index 7aff83c36d3..abc0299db2d 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/ramonly/RAMOnlyPostingsFormat.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.ramonly; +package org.apache.lucene.tests.codecs.ramonly; import java.io.IOException; import java.util.ArrayList; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/ramonly/package-info.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/package-info.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/ramonly/package-info.java index 828c04e008d..cb7dfbde26f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/package-info.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/ramonly/package-info.java @@ -16,4 +16,4 @@ */ /** Codec for testing that never writes to disk. */ -package org.apache.lucene.codecs.ramonly; +package org.apache.lucene.tests.codecs.ramonly; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/Rot13CypherTestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/Rot13CypherTestUtil.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/Rot13CypherTestUtil.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/Rot13CypherTestUtil.java index d57185cf894..1fbf0e616b6 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/Rot13CypherTestUtil.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/Rot13CypherTestUtil.java @@ -15,9 +15,11 @@ * limitations under the License. */ -package org.apache.lucene.codecs.uniformsplit; +package org.apache.lucene.tests.codecs.uniformsplit; import java.io.IOException; +import org.apache.lucene.codecs.uniformsplit.BlockDecoder; +import org.apache.lucene.codecs.uniformsplit.BlockEncoder; import org.apache.lucene.store.DataInput; import org.apache.lucene.store.DataOutput; import org.apache.lucene.util.BytesRef; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitRot13PostingsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/UniformSplitRot13PostingsFormat.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitRot13PostingsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/UniformSplitRot13PostingsFormat.java index ef082f22277..7291c7e54da 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/UniformSplitRot13PostingsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/UniformSplitRot13PostingsFormat.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.lucene.codecs.uniformsplit; +package org.apache.lucene.tests.codecs.uniformsplit; import java.io.IOException; import org.apache.lucene.codecs.FieldsConsumer; @@ -25,6 +25,12 @@ import org.apache.lucene.codecs.PostingsReaderBase; import org.apache.lucene.codecs.PostingsWriterBase; import org.apache.lucene.codecs.lucene90.Lucene90PostingsReader; import org.apache.lucene.codecs.lucene90.Lucene90PostingsWriter; +import org.apache.lucene.codecs.uniformsplit.BlockDecoder; +import org.apache.lucene.codecs.uniformsplit.BlockEncoder; +import org.apache.lucene.codecs.uniformsplit.IndexDictionary; +import org.apache.lucene.codecs.uniformsplit.UniformSplitPostingsFormat; +import org.apache.lucene.codecs.uniformsplit.UniformSplitTermsReader; +import org.apache.lucene.codecs.uniformsplit.UniformSplitTermsWriter; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.store.ByteBuffersDataOutput; diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/package-info.java new file mode 100644 index 00000000000..fc8bae9f5d0 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Test {@link org.apache.lucene.codecs.PostingsFormat} for testing {@link + * org.apache.lucene.codecs.uniformsplit} with block encryption using basic ROT13. + */ +package org.apache.lucene.tests.codecs.uniformsplit; diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STUniformSplitRot13PostingsFormat.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/sharedterms/STUniformSplitRot13PostingsFormat.java similarity index 87% rename from lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STUniformSplitRot13PostingsFormat.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/sharedterms/STUniformSplitRot13PostingsFormat.java index a6b11e1d6ea..1541a19b702 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STUniformSplitRot13PostingsFormat.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/sharedterms/STUniformSplitRot13PostingsFormat.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.lucene.codecs.uniformsplit.sharedterms; +package org.apache.lucene.tests.codecs.uniformsplit.sharedterms; import java.io.IOException; import org.apache.lucene.codecs.FieldsConsumer; @@ -23,11 +23,14 @@ import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.PostingsReaderBase; import org.apache.lucene.codecs.PostingsWriterBase; import org.apache.lucene.codecs.uniformsplit.IndexDictionary; -import org.apache.lucene.codecs.uniformsplit.UniformSplitRot13PostingsFormat; import org.apache.lucene.codecs.uniformsplit.UniformSplitTermsWriter; +import org.apache.lucene.codecs.uniformsplit.sharedterms.STUniformSplitPostingsFormat; +import org.apache.lucene.codecs.uniformsplit.sharedterms.STUniformSplitTermsReader; +import org.apache.lucene.codecs.uniformsplit.sharedterms.STUniformSplitTermsWriter; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.store.ByteBuffersDataOutput; +import org.apache.lucene.tests.codecs.uniformsplit.UniformSplitRot13PostingsFormat; /** {@link STUniformSplitPostingsFormat} with block encoding using ROT13 cypher. */ public class STUniformSplitRot13PostingsFormat extends UniformSplitRot13PostingsFormat { diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/sharedterms/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/sharedterms/package-info.java new file mode 100644 index 00000000000..7de33c15a4b --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/codecs/uniformsplit/sharedterms/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Test {@link org.apache.lucene.codecs.PostingsFormat} for testing {@link + * org.apache.lucene.codecs.uniformsplit.sharedterms} with block encryption using basic ROT13. + */ +package org.apache.lucene.tests.codecs.uniformsplit.sharedterms; diff --git a/lucene/test-framework/src/java/org/apache/lucene/geo/BaseGeoPointTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/BaseGeoPointTestCase.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/geo/BaseGeoPointTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/geo/BaseGeoPointTestCase.java index 46da94fba80..bb68f97183e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/geo/BaseGeoPointTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/BaseGeoPointTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.geo; +package org.apache.lucene.tests.geo; import java.io.IOException; import java.text.DecimalFormat; @@ -25,7 +25,6 @@ import java.util.HashSet; import java.util.Locale; import java.util.Set; import java.util.function.Consumer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.PointsFormat; @@ -38,6 +37,12 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; +import org.apache.lucene.geo.Circle; +import org.apache.lucene.geo.Component2D; +import org.apache.lucene.geo.GeoUtils; +import org.apache.lucene.geo.LatLonGeometry; +import org.apache.lucene.geo.Polygon; +import org.apache.lucene.geo.Rectangle; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; @@ -46,7 +51,6 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MultiBits; import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.SerialMergeScheduler; @@ -60,12 +64,14 @@ import org.apache.lucene.search.SimpleCollector; import org.apache.lucene.search.Sort; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.SloppyMath; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.bkd.BKDWriter; /** @@ -83,23 +89,23 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase { // TODO: remove these hooks once all subclasses can pass with new random! protected double nextLongitude() { - return org.apache.lucene.geo.GeoTestUtil.nextLongitude(); + return GeoTestUtil.nextLongitude(); } protected double nextLatitude() { - return org.apache.lucene.geo.GeoTestUtil.nextLatitude(); + return GeoTestUtil.nextLatitude(); } protected Rectangle nextBox() { - return org.apache.lucene.geo.GeoTestUtil.nextBox(); + return GeoTestUtil.nextBox(); } protected Circle nextCircle() { - return org.apache.lucene.geo.GeoTestUtil.nextCircle(); + return GeoTestUtil.nextCircle(); } protected Polygon nextPolygon() { - return org.apache.lucene.geo.GeoTestUtil.nextPolygon(); + return GeoTestUtil.nextPolygon(); } protected LatLonGeometry[] nextGeometry() { diff --git a/lucene/test-framework/src/java/org/apache/lucene/geo/BaseXYPointTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/BaseXYPointTestCase.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/geo/BaseXYPointTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/geo/BaseXYPointTestCase.java index b533d3ebfb1..772432a0d96 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/geo/BaseXYPointTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/BaseXYPointTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.geo; +package org.apache.lucene.tests.geo; import java.io.IOException; import java.text.DecimalFormat; @@ -25,7 +25,6 @@ import java.util.HashSet; import java.util.Locale; import java.util.Set; import java.util.function.Consumer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.PointsFormat; @@ -38,6 +37,12 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; +import org.apache.lucene.geo.Component2D; +import org.apache.lucene.geo.XYCircle; +import org.apache.lucene.geo.XYGeometry; +import org.apache.lucene.geo.XYPoint; +import org.apache.lucene.geo.XYPolygon; +import org.apache.lucene.geo.XYRectangle; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; @@ -46,7 +51,6 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MultiBits; import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.SerialMergeScheduler; @@ -59,11 +63,13 @@ import org.apache.lucene.search.SimpleCollector; import org.apache.lucene.search.Sort; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.bkd.BKDWriter; /** Abstract class to do basic tests for a xy spatial impl (high level fields and queries) */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/geo/EarthDebugger.java b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/EarthDebugger.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/geo/EarthDebugger.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/geo/EarthDebugger.java index 4bd06e1e29d..d95979502ad 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/geo/EarthDebugger.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/EarthDebugger.java @@ -15,8 +15,10 @@ * limitations under the License. */ -package org.apache.lucene.geo; +package org.apache.lucene.tests.geo; +import org.apache.lucene.geo.Polygon; +import org.apache.lucene.geo.Rectangle; import org.apache.lucene.util.SloppyMath; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/geo/GeoTestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/GeoTestUtil.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/geo/GeoTestUtil.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/geo/GeoTestUtil.java index 42540fe01ce..165f6288be4 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/geo/GeoTestUtil.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/GeoTestUtil.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.geo; +package org.apache.lucene.tests.geo; import com.carrotsearch.randomizedtesting.RandomizedContext; import java.io.BufferedReader; @@ -28,9 +28,15 @@ import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.zip.GZIPInputStream; +import org.apache.lucene.geo.Circle; +import org.apache.lucene.geo.GeoUtils; +import org.apache.lucene.geo.Line; +import org.apache.lucene.geo.Point; +import org.apache.lucene.geo.Polygon; +import org.apache.lucene.geo.Rectangle; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.NumericUtils; import org.apache.lucene.util.SloppyMath; -import org.apache.lucene.util.TestUtil; /** static methods for testing geo */ public class GeoTestUtil { diff --git a/lucene/test-framework/src/java/org/apache/lucene/geo/ShapeTestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/ShapeTestUtil.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/geo/ShapeTestUtil.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/geo/ShapeTestUtil.java index 1cd77ccd31b..e0e8c6964fc 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/geo/ShapeTestUtil.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/ShapeTestUtil.java @@ -14,14 +14,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.geo; +package org.apache.lucene.tests.geo; import com.carrotsearch.randomizedtesting.RandomizedContext; import com.carrotsearch.randomizedtesting.generators.BiasedNumbers; import java.util.ArrayList; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.geo.GeoUtils; +import org.apache.lucene.geo.XYCircle; +import org.apache.lucene.geo.XYEncodingUtils; +import org.apache.lucene.geo.XYLine; +import org.apache.lucene.geo.XYPoint; +import org.apache.lucene.geo.XYPolygon; +import org.apache.lucene.geo.XYRectangle; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** generates random cartesian geometry; heavy reuse of {@link GeoTestUtil} */ public class ShapeTestUtil { diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/geo/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/package-info.java new file mode 100644 index 00000000000..a57eee43c5c --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/package-info.java @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Reusable geo test utilities. */ +package org.apache.lucene.tests.geo; diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/AlcoholicMergePolicy.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AlcoholicMergePolicy.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/index/AlcoholicMergePolicy.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/AlcoholicMergePolicy.java index 3291ec00760..00f28673e7a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/AlcoholicMergePolicy.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AlcoholicMergePolicy.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.Calendar; @@ -22,7 +22,9 @@ import java.util.GregorianCalendar; import java.util.Locale; import java.util.Random; import java.util.TimeZone; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.index.LogMergePolicy; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.tests.util.TestUtil; /** * Merge policy for testing, it is like an alcoholic. It drinks (merges) at night, and randomly diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/AllDeletedFilterReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AllDeletedFilterReader.java similarity index 91% rename from lucene/test-framework/src/java/org/apache/lucene/index/AllDeletedFilterReader.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/AllDeletedFilterReader.java index 26e23d94ca3..12c64290622 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/AllDeletedFilterReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AllDeletedFilterReader.java @@ -14,8 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; +import org.apache.lucene.index.FilterLeafReader; +import org.apache.lucene.index.LeafReader; import org.apache.lucene.util.Bits; /** Filters the incoming reader and makes all documents appear deleted. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/AssertingDirectoryReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingDirectoryReader.java similarity index 89% rename from lucene/test-framework/src/java/org/apache/lucene/index/AssertingDirectoryReader.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingDirectoryReader.java index 8274cf09795..a1a34184739 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/AssertingDirectoryReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingDirectoryReader.java @@ -14,9 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.FilterDirectoryReader; +import org.apache.lucene.index.LeafReader; /** A {@link DirectoryReader} that wraps all its subreaders with {@link AssertingLeafReader} */ public class AssertingDirectoryReader extends FilterDirectoryReader { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingLeafReader.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingLeafReader.java index ffb4f1739dd..15fcd143e4e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingLeafReader.java @@ -14,15 +14,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Objects; +import org.apache.lucene.index.BinaryDocValues; +import org.apache.lucene.index.DocValues; +import org.apache.lucene.index.DocValuesType; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.Fields; +import org.apache.lucene.index.FilterLeafReader; +import org.apache.lucene.index.Impact; +import org.apache.lucene.index.Impacts; +import org.apache.lucene.index.ImpactsEnum; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.PointValues; import org.apache.lucene.index.PointValues.IntersectVisitor; import org.apache.lucene.index.PointValues.Relation; +import org.apache.lucene.index.PostingsEnum; +import org.apache.lucene.index.SortedDocValues; +import org.apache.lucene.index.SortedNumericDocValues; +import org.apache.lucene.index.SortedSetDocValues; +import org.apache.lucene.index.TermState; +import org.apache.lucene.index.Terms; +import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; @@ -207,7 +227,7 @@ public class AssertingLeafReader extends FilterLeafReader { // reuse if the codec reused final PostingsEnum actualReuse; if (reuse instanceof AssertingPostingsEnum) { - actualReuse = ((AssertingPostingsEnum) reuse).in; + actualReuse = ((AssertingPostingsEnum) reuse).unwrap(); } else { actualReuse = null; } @@ -498,7 +518,8 @@ public class AssertingLeafReader extends FilterLeafReader { assert docID() >= 0 || lastShallowTarget >= 0 : "Cannot get impacts until the iterator is positioned or advanceShallow has been called"; Impacts impacts = in.getImpacts(); - CheckIndex.checkImpacts(impacts, Math.max(docID(), lastShallowTarget)); + TestSecrets.getIndexPackageAccess() + .checkImpacts(impacts, Math.max(docID(), lastShallowTarget)); return new AssertingImpacts(impacts, this); } diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseCompoundFormatTestCase.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseCompoundFormatTestCase.java index 46fab1cbe95..2fc84e0b120 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseCompoundFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.ArrayList; @@ -30,6 +30,10 @@ import org.apache.lucene.codecs.CompoundDirectory; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StoredField; +import org.apache.lucene.index.CorruptIndexException; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.index.SegmentInfo; +import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FilterDirectory; @@ -37,11 +41,11 @@ import org.apache.lucene.store.FlushInfo; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.NRTCachingDirectory; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompressingDocValuesFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseCompressingDocValuesFormatTestCase.java similarity index 95% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseCompressingDocValuesFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseCompressingDocValuesFormatTestCase.java index fc6d23c6a55..e00954243ae 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompressingDocValuesFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseCompressingDocValuesFormatTestCase.java @@ -14,18 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import com.carrotsearch.randomizedtesting.generators.RandomPicks; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.NumericDocValuesField; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.packed.PackedInts; /** Extends {@link BaseDocValuesFormatTestCase} to add compression checks. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseDocValuesFormatTestCase.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseDocValuesFormatTestCase.java index 9e494b07e2d..2bbfbf4d075 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseDocValuesFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import static org.apache.lucene.index.SortedSetDocValues.NO_MORE_ORDS; import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; @@ -37,7 +37,6 @@ import java.util.concurrent.CountDownLatch; import java.util.function.LongSupplier; import java.util.function.Supplier; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.simpletext.SimpleTextCodec; import org.apache.lucene.document.BinaryDocValuesField; @@ -51,7 +50,25 @@ import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.BinaryDocValues; +import org.apache.lucene.index.CheckIndex; import org.apache.lucene.index.CheckIndex.Status.DocValuesStatus; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.DocValues; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.MultiDocValues; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.PostingsEnum; +import org.apache.lucene.index.SortedDocValues; +import org.apache.lucene.index.SortedNumericDocValues; +import org.apache.lucene.index.SortedSetDocValues; +import org.apache.lucene.index.Term; +import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum.SeekStatus; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -62,13 +79,14 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BitSet; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.BytesRefHash; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseFieldInfoFormatTestCase.java similarity index 89% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseFieldInfoFormatTestCase.java index a66266e93a3..51ed1c472bc 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseFieldInfoFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import com.carrotsearch.randomizedtesting.generators.RandomPicks; import java.io.IOException; @@ -29,13 +29,23 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DocValuesType; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.FieldInfos; +import org.apache.lucene.index.IndexOptions; +import org.apache.lucene.index.IndexableFieldType; +import org.apache.lucene.index.PointValues; +import org.apache.lucene.index.SegmentInfo; +import org.apache.lucene.index.VectorSimilarityFunction; +import org.apache.lucene.index.VectorValues; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.Failure; -import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.Failure; +import org.apache.lucene.tests.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; /** @@ -53,9 +63,10 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes SegmentInfo segmentInfo = newSegmentInfo(dir, "_123"); FieldInfo fi = createFieldInfo(); addAttributes(fi); - FieldInfos.Builder builder = new FieldInfos.Builder(new FieldInfos.FieldNumbers(null)); - builder.add(fi); - FieldInfos infos = builder.finish(); + + FieldInfos infos = + TestSecrets.getIndexPackageAccess().newFieldInfosBuilder(null).add(fi).finish(); + codec.fieldInfosFormat().write(dir, segmentInfo, "", infos, IOContext.DEFAULT); FieldInfos infos2 = codec.fieldInfosFormat().read(dir, segmentInfo, "", IOContext.DEFAULT); @@ -81,9 +92,10 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes addAttributes(fi); fi.putAttribute("foo", "bar"); fi.putAttribute("bar", "baz"); - FieldInfos.Builder builder = new FieldInfos.Builder(new FieldInfos.FieldNumbers(null)); - builder.add(fi); - FieldInfos infos = builder.finish(); + + FieldInfos infos = + TestSecrets.getIndexPackageAccess().newFieldInfosBuilder(null).add(fi).finish(); + codec.fieldInfosFormat().write(dir, segmentInfo, "", infos, IOContext.DEFAULT); FieldInfos infos2 = codec.fieldInfosFormat().read(dir, segmentInfo, "", IOContext.DEFAULT); @@ -121,9 +133,9 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes SegmentInfo segmentInfo = newSegmentInfo(dir, "_123"); FieldInfo fi = createFieldInfo(); addAttributes(fi); - FieldInfos.Builder builder = new FieldInfos.Builder(new FieldInfos.FieldNumbers(null)); - builder.add(fi); - FieldInfos infos = builder.finish(); + + FieldInfos infos = + TestSecrets.getIndexPackageAccess().newFieldInfosBuilder(null).add(fi).finish(); fail.setDoFail(); expectThrows( @@ -156,11 +168,10 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes Codec codec = getCodec(); SegmentInfo segmentInfo = newSegmentInfo(dir, "_123"); FieldInfo fi = createFieldInfo(); - - FieldInfos.Builder builder = new FieldInfos.Builder(new FieldInfos.FieldNumbers(null)); - builder.add(fi); addAttributes(fi); - FieldInfos infos = builder.finish(); + + FieldInfos infos = + TestSecrets.getIndexPackageAccess().newFieldInfosBuilder(null).add(fi).finish(); fail.setDoFail(); expectThrows( @@ -193,11 +204,11 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes Codec codec = getCodec(); SegmentInfo segmentInfo = newSegmentInfo(dir, "_123"); FieldInfo fi = createFieldInfo(); - - FieldInfos.Builder builder = new FieldInfos.Builder(new FieldInfos.FieldNumbers(null)); - builder.add(fi); addAttributes(fi); - FieldInfos infos = builder.finish(); + + FieldInfos infos = + TestSecrets.getIndexPackageAccess().newFieldInfosBuilder(null).add(fi).finish(); + codec.fieldInfosFormat().write(dir, segmentInfo, "", infos, IOContext.DEFAULT); fail.setDoFail(); @@ -231,10 +242,11 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes Codec codec = getCodec(); SegmentInfo segmentInfo = newSegmentInfo(dir, "_123"); FieldInfo fi = createFieldInfo(); - FieldInfos.Builder builder = new FieldInfos.Builder(new FieldInfos.FieldNumbers(null)); - builder.add(fi); addAttributes(fi); - FieldInfos infos = builder.finish(); + + FieldInfos infos = + TestSecrets.getIndexPackageAccess().newFieldInfosBuilder(null).add(fi).finish(); + codec.fieldInfosFormat().write(dir, segmentInfo, "", infos, IOContext.DEFAULT); fail.setDoFail(); @@ -265,8 +277,8 @@ public abstract class BaseFieldInfoFormatTestCase extends BaseIndexFileFormatTes String softDeletesField = random().nextBoolean() ? TestUtil.randomUnicodeString(random()) : null; - FieldInfos.Builder builder = - new FieldInfos.Builder(new FieldInfos.FieldNumbers(softDeletesField)); + + var builder = TestSecrets.getIndexPackageAccess().newFieldInfosBuilder(softDeletesField); for (String field : fieldNames) { IndexableFieldType fieldType = randomFieldType(random()); diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseIndexFileFormatTestCase.java similarity index 95% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseIndexFileFormatTestCase.java index 5eeddf89ddf..3653fc6960f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseIndexFileFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -34,7 +34,6 @@ import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.function.IntConsumer; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.DocValuesProducer; @@ -52,6 +51,28 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.EmptyDocValuesProducer; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.FieldInfos; +import org.apache.lucene.index.Fields; +import org.apache.lucene.index.IndexFileNames; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexReaderContext; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.MergePolicy; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.index.SegmentInfo; +import org.apache.lucene.index.SegmentInfos; +import org.apache.lucene.index.SegmentReadState; +import org.apache.lucene.index.SegmentWriteState; +import org.apache.lucene.index.SerialMergeScheduler; +import org.apache.lucene.index.Term; +import org.apache.lucene.index.Terms; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.ChecksumIndexInput; import org.apache.lucene.store.Directory; @@ -60,17 +81,18 @@ import org.apache.lucene.store.FlushInfo; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.RamUsageTester; +import org.apache.lucene.tests.util.Rethrow; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CloseableThreadLocal; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.RamUsageEstimator; -import org.apache.lucene.util.RamUsageTester; -import org.apache.lucene.util.Rethrow; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; /** Common tests to all index formats. */ @@ -604,7 +626,7 @@ abstract class BaseIndexFileFormatTestCase extends LuceneTestCase { // OK: writer was closed by abort; we just reopen now: dir.setRandomIOExceptionRateOnOpen( 0.0); // disable exceptions on openInput until next iteration - assertTrue(iw.isDeleterClosed()); + assertTrue(TestSecrets.getIndexWriterAccess().isDeleterClosed(iw)); assertTrue(allowAlreadyClosed); allowAlreadyClosed = false; conf = newIndexWriterConfig(analyzer); @@ -645,7 +667,7 @@ abstract class BaseIndexFileFormatTestCase extends LuceneTestCase { // OK: writer was closed by abort; we just reopen now: dir.setRandomIOExceptionRateOnOpen( 0.0); // disable exceptions on openInput until next iteration - assertTrue(iw.isDeleterClosed()); + assertTrue(TestSecrets.getIndexWriterAccess().isDeleterClosed(iw)); assertTrue(allowAlreadyClosed); allowAlreadyClosed = false; conf = newIndexWriterConfig(analyzer); diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseKnnVectorsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseKnnVectorsFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java index 1d881e1da88..8d90fdc87f9 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseKnnVectorsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseKnnVectorsFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; @@ -29,14 +29,27 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.KnnVectorField; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StringField; +import org.apache.lucene.index.CheckIndex; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.RandomAccessVectorValues; +import org.apache.lucene.index.RandomAccessVectorValuesProducer; +import org.apache.lucene.index.Term; +import org.apache.lucene.index.VectorSimilarityFunction; +import org.apache.lucene.index.VectorValues; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.VectorUtil; /** @@ -215,7 +228,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe try (IndexWriter w2 = new IndexWriter(dir2, newIndexWriterConfig())) { w2.addIndexes(dir); w2.forceMerge(1); - try (IndexReader reader = w2.getReader()) { + try (IndexReader reader = DirectoryReader.open(w2)) { LeafReader r = getOnlyLeafReader(reader); VectorValues vectorValues = r.getVectorValues(fieldName); assertEquals(0, vectorValues.nextDoc()); @@ -239,7 +252,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe w2.addDocument(doc); w2.addIndexes(dir); w2.forceMerge(1); - try (IndexReader reader = w2.getReader()) { + try (IndexReader reader = DirectoryReader.open(w2)) { LeafReader r = getOnlyLeafReader(reader); VectorValues vectorValues = r.getVectorValues(fieldName); assertNotEquals(NO_MORE_DOCS, vectorValues.nextDoc()); @@ -265,7 +278,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe w2.addDocument(doc); w2.addIndexes(dir); w2.forceMerge(1); - try (IndexReader reader = w2.getReader()) { + try (IndexReader reader = DirectoryReader.open(w2)) { LeafReader r = getOnlyLeafReader(reader); VectorValues vectorValues = r.getVectorValues(fieldName); assertEquals(0, vectorValues.nextDoc()); @@ -535,14 +548,14 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe w.addDocument(new Document()); w.commit(); - try (DirectoryReader r = w.getReader()) { + try (DirectoryReader r = DirectoryReader.open(w)) { VectorValues values = getOnlyLeafReader(r).getVectorValues("v"); assertNotNull(values); assertEquals(1, values.size()); } w.deleteDocuments(new Term("id", "0")); w.forceMerge(1); - try (DirectoryReader r = w.getReader()) { + try (DirectoryReader r = DirectoryReader.open(w)) { VectorValues values = getOnlyLeafReader(r).getVectorValues("v"); assertNotNull(values); assertEquals(0, values.size()); @@ -637,7 +650,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe doc3.add(new KnnVectorField(fieldName, v, VectorSimilarityFunction.EUCLIDEAN)); iw.addDocument(doc3); iw.forceMerge(1); - try (IndexReader reader = iw.getReader()) { + try (IndexReader reader = DirectoryReader.open(iw)) { LeafReader r = getOnlyLeafReader(reader); VectorValues vectorValues = r.getVectorValues(fieldName); vectorValues.nextDoc(); @@ -661,7 +674,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe add(iw, fieldName, 3, 3, null); add(iw, fieldName, 2, 2, new float[] {1, 0}); iw.forceMerge(1); - try (IndexReader reader = iw.getReader()) { + try (IndexReader reader = DirectoryReader.open(iw)) { LeafReader leaf = getOnlyLeafReader(reader); VectorValues vectorValues = leaf.getVectorValues(fieldName); @@ -701,7 +714,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe "field3", new float[] {1, 2, 3}, VectorSimilarityFunction.DOT_PRODUCT)); iw.addDocument(doc); iw.forceMerge(1); - try (IndexReader reader = iw.getReader()) { + try (IndexReader reader = DirectoryReader.open(iw)) { LeafReader leaf = reader.leaves().get(0).reader(); VectorValues vectorValues = leaf.getVectorValues("field1"); @@ -778,7 +791,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe } } int numDeletes = 0; - try (IndexReader reader = iw.getReader()) { + try (IndexReader reader = DirectoryReader.open(iw)) { int valueCount = 0, totalSize = 0; for (LeafReaderContext ctx : reader.leaves()) { VectorValues vectorValues = ctx.reader().getVectorValues(fieldName); @@ -834,7 +847,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe id2ord[id] = i; add(iw, fieldName, id, value, VectorSimilarityFunction.EUCLIDEAN); } - try (IndexReader reader = iw.getReader()) { + try (IndexReader reader = DirectoryReader.open(iw)) { for (LeafReaderContext ctx : reader.leaves()) { Bits liveDocs = ctx.reader().getLiveDocs(); VectorValues vectorValues = ctx.reader().getVectorValues(fieldName); @@ -976,7 +989,7 @@ public abstract class BaseKnnVectorsFormatTestCase extends BaseIndexFileFormatTe w.addDocument(doc); } w.forceMerge(1); - try (IndexReader reader = w.getReader()) { + try (IndexReader reader = DirectoryReader.open(w)) { LeafReader r = getOnlyLeafReader(reader); VectorValues vectorValues = r.getVectorValues(fieldName); int[] vectorDocs = new int[vectorValues.size() + 1]; diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseLiveDocsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseLiveDocsFormatTestCase.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseLiveDocsFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseLiveDocsFormatTestCase.java index 74bc4def1b1..ec114f4f57f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseLiveDocsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseLiveDocsFormatTestCase.java @@ -14,19 +14,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.Collections; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.LiveDocsFormat; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; /** Abstract class that performs basic testing of a codec's {@link LiveDocsFormat}. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseMergePolicyTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseMergePolicyTestCase.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseMergePolicyTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseMergePolicyTestCase.java index 1fa1cd465d6..0c6c950c58e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseMergePolicyTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseMergePolicyTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -27,21 +27,33 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.function.ToIntFunction; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.FilterMergePolicy; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.MergePolicy.MergeContext; import org.apache.lucene.index.MergePolicy.MergeSpecification; import org.apache.lucene.index.MergePolicy.OneMerge; +import org.apache.lucene.index.MergeScheduler; +import org.apache.lucene.index.MergeTrigger; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.index.SegmentInfo; +import org.apache.lucene.index.SegmentInfos; +import org.apache.lucene.index.SerialMergeScheduler; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.Lock; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.NullInfoStream; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.NullInfoStream; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; /** Base test case for {@link MergePolicy}. */ @@ -100,10 +112,10 @@ public abstract class BaseMergePolicyTestCase extends LuceneTestCase { for (int j = 0; j < numDocs; ++j) { writer.addDocument(new Document()); } - writer.getReader().close(); + DirectoryReader.open(writer).close(); } for (int i = 5; i >= 0; --i) { - final int segmentCount = writer.getSegmentCount(); + final int segmentCount = TestSecrets.getIndexWriterAccess().getSegmentCount(writer); final int maxNumSegments = i == 0 ? 1 : TestUtil.nextInt(random(), 1, 10); mayMerge.set(segmentCount > maxNumSegments); if (VERBOSE) { @@ -124,7 +136,7 @@ public abstract class BaseMergePolicyTestCase extends LuceneTestCase { if (mp instanceof FilterMergePolicy) { assumeFalse( "test doesn't work with MockRandomMP", - ((FilterMergePolicy) mp).in instanceof MockRandomMergePolicy); + ((FilterMergePolicy) mp).unwrap() instanceof MockRandomMergePolicy); } SegmentInfos infos = new SegmentInfos(Version.LATEST.major); try (Directory directory = newDirectory()) { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseNormsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseNormsFormatTestCase.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseNormsFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseNormsFormatTestCase.java index c47aa001b71..96face910c5 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseNormsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseNormsFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; @@ -25,21 +25,31 @@ import java.util.Random; import java.util.concurrent.CountDownLatch; import java.util.function.LongSupplier; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.FieldInvertState; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.MultiDocValues; +import org.apache.lucene.index.NoMergePolicy; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.Term; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; /** * Abstract class to do basic tests for a norms format. NOTE: This test focuses on the norms impl, @@ -592,7 +602,7 @@ public abstract class BaseNormsFormatTestCase extends BaseIndexFileFormatTestCas @Override public long computeNorm(FieldInvertState state) { - assert state.length > 0; + assert state.getLength() > 0; while (true) { long norm = norms[index++]; if (norm != 0) { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BasePointsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BasePointsFormatTestCase.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/index/BasePointsFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BasePointsFormatTestCase.java index a89b3113d2d..460b4ad6efb 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BasePointsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BasePointsFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.BinaryPoint; import org.apache.lucene.document.Document; @@ -33,17 +32,32 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.IntPoint; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StringField; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.ConcurrentMergeScheduler; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.MergeScheduler; +import org.apache.lucene.index.MultiBits; +import org.apache.lucene.index.MultiDocValues; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.PointValues; import org.apache.lucene.index.PointValues.IntersectVisitor; import org.apache.lucene.index.PointValues.Relation; +import org.apache.lucene.index.Term; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.util.Rethrow; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.Rethrow; -import org.apache.lucene.util.TestUtil; /** * Abstract class to do basic tests for a points format. NOTE: This test focuses on the points impl, @@ -640,7 +654,8 @@ public abstract class BasePointsFormatTestCase extends BaseIndexFileFormatTestCa if (expectExceptions) { MergeScheduler ms = iwc.getMergeScheduler(); if (ms instanceof ConcurrentMergeScheduler) { - ((ConcurrentMergeScheduler) ms).setSuppressExceptions(); + TestSecrets.getConcurrentMergeSchedulerAccess() + .setSuppressExceptions((ConcurrentMergeScheduler) ms); } } RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); @@ -689,7 +704,8 @@ public abstract class BasePointsFormatTestCase extends BaseIndexFileFormatTestCa if (expectExceptions) { MergeScheduler ms = iwc.getMergeScheduler(); if (ms instanceof ConcurrentMergeScheduler) { - ((ConcurrentMergeScheduler) ms).setSuppressExceptions(); + TestSecrets.getConcurrentMergeSchedulerAccess() + .setSuppressExceptions((ConcurrentMergeScheduler) ms); } } w = new RandomIndexWriter(random(), dir, iwc); diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BasePostingsFormatTestCase.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BasePostingsFormatTestCase.java index cc585904031..d98fa17b974 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BasePostingsFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import static org.apache.lucene.index.PostingsEnum.ALL; import static org.apache.lucene.index.PostingsEnum.FREQS; @@ -31,10 +31,6 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicLong; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.codecs.FieldsConsumer; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.FilterCodec; @@ -45,16 +41,34 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.Fields; +import org.apache.lucene.index.IndexOptions; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.MultiTerms; +import org.apache.lucene.index.PostingsEnum; +import org.apache.lucene.index.SegmentReadState; +import org.apache.lucene.index.SegmentWriteState; +import org.apache.lucene.index.Term; +import org.apache.lucene.index.Terms; +import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum.SeekStatus; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.RamUsageTester; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.RamUsageTester; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseSegmentInfoFormatTestCase.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseSegmentInfoFormatTestCase.java index 069d0418f13..665353d40e5 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseSegmentInfoFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseSegmentInfoFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.Collections; @@ -25,17 +25,20 @@ import java.util.Set; import org.apache.lucene.codecs.Codec; import org.apache.lucene.document.Document; import org.apache.lucene.document.StoredField; +import org.apache.lucene.index.IndexFileNames; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.SortedNumericSortField; import org.apache.lucene.search.SortedSetSortField; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.Failure; -import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.Failure; +import org.apache.lucene.tests.store.MockDirectoryWrapper.FakeIOException; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.Version; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseStoredFieldsFormatTestCase.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseStoredFieldsFormatTestCase.java index cc57c5612ac..2149a310d1e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseStoredFieldsFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import com.carrotsearch.randomizedtesting.generators.RandomPicks; @@ -33,7 +33,6 @@ import java.util.Random; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; import java.util.stream.Collectors; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.simpletext.SimpleTextCodec; @@ -46,6 +45,21 @@ import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.DocValues; +import org.apache.lucene.index.FilterDirectoryReader; +import org.apache.lucene.index.FilterLeafReader; +import org.apache.lucene.index.IndexOptions; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.IndexableField; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.NoMergePolicy; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.StoredFieldVisitor; +import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.Sort; @@ -54,11 +68,12 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; import org.apache.lucene.store.MMapDirectory; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.Throttling; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.Throttling; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; /** * Base class aiming at testing {@link StoredFieldsFormat stored fields formats}. To test a new @@ -193,7 +208,7 @@ public abstract class BaseStoredFieldsFormatTestCase extends BaseIndexFileFormat doc.add(newField("aaa", "a b c", customType)); doc.add(newField("zzz", "1 2 3", customType)); w.addDocument(doc); - IndexReader r = maybeWrapWithMergingReader(w.getReader()); + IndexReader r = maybeWrapWithMergingReader(DirectoryReader.open(w)); Document doc2 = r.document(0); Iterator it = doc2.getFields().iterator(); assertTrue(it.hasNext()); diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseTermVectorsFormatTestCase.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseTermVectorsFormatTestCase.java index 70e7c849d31..6ab47d830b6 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseTermVectorsFormatTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import static org.apache.lucene.index.PostingsEnum.ALL; import static org.apache.lucene.index.PostingsEnum.FREQS; @@ -37,9 +37,6 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.CannedTokenStream; -import org.apache.lucene.analysis.MockTokenizer; -import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; @@ -54,6 +51,15 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.NumericDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.Fields; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.PostingsEnum; +import org.apache.lucene.index.Term; +import org.apache.lucene.index.Terms; +import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum.SeekStatus; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; @@ -61,11 +67,14 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.CannedTokenStream; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.analysis.Token; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.AttributeImpl; import org.apache.lucene.util.AttributeReflector; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.TestUtil; /** * Base class aiming at testing {@link TermVectorsFormat term vectors formats}. To test a new diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseTestCheckIndex.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseTestCheckIndex.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/index/BaseTestCheckIndex.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseTestCheckIndex.java index 35c5458ece5..98fd4003cd8 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseTestCheckIndex.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/BaseTestCheckIndex.java @@ -14,23 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.CheckIndex; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; import org.apache.lucene.store.LockObtainFailedException; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** Base class for CheckIndex tests. */ public class BaseTestCheckIndex extends LuceneTestCase { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/DocHelper.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/DocHelper.java index 84c6213ef7d..b6cc21cfaa0 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/DocHelper.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -22,17 +22,23 @@ import java.util.HashMap; import java.util.Map; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; +import org.apache.lucene.index.IndexOptions; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.IndexableField; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; /** Helper functions for tests that handles documents */ public class DocHelper { @@ -292,7 +298,7 @@ public class DocHelper { // writer.setNoCFSRatio(0.0); writer.addDocument(doc); writer.commit(); - SegmentCommitInfo info = writer.newestSegment(); + SegmentCommitInfo info = TestSecrets.getIndexWriterAccess().newestSegment(writer); writer.close(); return info; } diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterLeafReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/FieldFilterLeafReader.java similarity index 90% rename from lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterLeafReader.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/FieldFilterLeafReader.java index 57c92e89594..6d6156fb787 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterLeafReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/FieldFilterLeafReader.java @@ -14,13 +14,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.Objects; import java.util.Set; +import org.apache.lucene.index.BinaryDocValues; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.FieldInfos; +import org.apache.lucene.index.Fields; +import org.apache.lucene.index.FilterLeafReader; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.SortedDocValues; +import org.apache.lucene.index.SortedNumericDocValues; +import org.apache.lucene.index.SortedSetDocValues; +import org.apache.lucene.index.StoredFieldVisitor; +import org.apache.lucene.index.Terms; import org.apache.lucene.util.FilterIterator; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/ForceMergePolicy.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/ForceMergePolicy.java old mode 100755 new mode 100644 similarity index 86% rename from lucene/test-framework/src/java/org/apache/lucene/index/ForceMergePolicy.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/ForceMergePolicy.java index d0460c0c0f5..075ab921c87 --- a/lucene/test-framework/src/java/org/apache/lucene/index/ForceMergePolicy.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/ForceMergePolicy.java @@ -14,9 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; +import org.apache.lucene.index.FilterMergePolicy; +import org.apache.lucene.index.MergePolicy; +import org.apache.lucene.index.MergeTrigger; +import org.apache.lucene.index.SegmentInfos; /** * A {@link MergePolicy} that only returns forced merges. diff --git a/lucene/core/src/java/org/apache/lucene/index/MergeReaderWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergeReaderWrapper.java similarity index 90% rename from lucene/core/src/java/org/apache/lucene/index/MergeReaderWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/MergeReaderWrapper.java index e386e039bf4..ba7e97fcc55 100644 --- a/lucene/core/src/java/org/apache/lucene/index/MergeReaderWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergeReaderWrapper.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.Objects; @@ -24,6 +24,22 @@ import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.NormsProducer; import org.apache.lucene.codecs.StoredFieldsReader; import org.apache.lucene.codecs.TermVectorsReader; +import org.apache.lucene.index.BinaryDocValues; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.DocValuesType; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.FieldInfos; +import org.apache.lucene.index.Fields; +import org.apache.lucene.index.LeafMetaData; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.PointValues; +import org.apache.lucene.index.SortedDocValues; +import org.apache.lucene.index.SortedNumericDocValues; +import org.apache.lucene.index.SortedSetDocValues; +import org.apache.lucene.index.StoredFieldVisitor; +import org.apache.lucene.index.Terms; +import org.apache.lucene.index.VectorValues; import org.apache.lucene.search.TopDocs; import org.apache.lucene.util.Bits; diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/MergingCodecReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingCodecReader.java similarity index 95% rename from lucene/test-framework/src/java/org/apache/lucene/index/MergingCodecReader.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingCodecReader.java index cd2c49807ad..76058d117af 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/MergingCodecReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingCodecReader.java @@ -14,11 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import org.apache.lucene.codecs.DocValuesProducer; import org.apache.lucene.codecs.NormsProducer; import org.apache.lucene.codecs.StoredFieldsReader; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.FilterCodecReader; import org.apache.lucene.util.CloseableThreadLocal; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/MergingDirectoryReaderWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingDirectoryReaderWrapper.java similarity index 88% rename from lucene/test-framework/src/java/org/apache/lucene/index/MergingDirectoryReaderWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingDirectoryReaderWrapper.java index 3950c3dff69..b7aa18dba53 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/MergingDirectoryReaderWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergingDirectoryReaderWrapper.java @@ -14,9 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.FilterDirectoryReader; +import org.apache.lucene.index.LeafReader; /** * {@link DirectoryReader} wrapper that uses the merge instances of the wrapped {@link diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/MismatchedDirectoryReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MismatchedDirectoryReader.java similarity index 90% rename from lucene/test-framework/src/java/org/apache/lucene/index/MismatchedDirectoryReader.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/MismatchedDirectoryReader.java index d401f004e8f..6f65ddbe0b6 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/MismatchedDirectoryReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MismatchedDirectoryReader.java @@ -14,10 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.Random; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.FilterDirectoryReader; +import org.apache.lucene.index.LeafReader; /** A {@link DirectoryReader} that wraps all its subreaders with {@link MismatchedLeafReader} */ public class MismatchedDirectoryReader extends FilterDirectoryReader { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/MismatchedLeafReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MismatchedLeafReader.java similarity index 95% rename from lucene/test-framework/src/java/org/apache/lucene/index/MismatchedLeafReader.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/MismatchedLeafReader.java index a14b8f1002b..21c83175daa 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/MismatchedLeafReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MismatchedLeafReader.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.ArrayList; @@ -22,6 +22,11 @@ import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.Random; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.FieldInfos; +import org.apache.lucene.index.FilterLeafReader; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.StoredFieldVisitor; /** * Shuffles field numbers around to try to trip bugs where field numbers are assumed to always be diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/MockIndexWriterEventListener.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MockIndexWriterEventListener.java similarity index 90% rename from lucene/test-framework/src/java/org/apache/lucene/index/MockIndexWriterEventListener.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/MockIndexWriterEventListener.java index 33ffa5dd9cc..686f3340031 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/MockIndexWriterEventListener.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MockIndexWriterEventListener.java @@ -14,7 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; + +import org.apache.lucene.index.IndexWriterEventListener; +import org.apache.lucene.index.MergePolicy; /** Mock IndexWriterEventListener to verify invocation of event methods */ public class MockIndexWriterEventListener implements IndexWriterEventListener { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/MockRandomMergePolicy.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MockRandomMergePolicy.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/index/MockRandomMergePolicy.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/MockRandomMergePolicy.java index 3549bf30141..3a9657e16b9 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/MockRandomMergePolicy.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MockRandomMergePolicy.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.ArrayList; @@ -23,8 +23,15 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.FilterLeafReader; +import org.apache.lucene.index.MergePolicy; +import org.apache.lucene.index.MergeTrigger; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.index.SegmentInfos; +import org.apache.lucene.index.SlowCodecReaderWrapper; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; /** MergePolicy that makes random decisions for testing. */ public class MockRandomMergePolicy extends MergePolicy { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/OwnCacheKeyMultiReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/OwnCacheKeyMultiReader.java similarity index 84% rename from lucene/test-framework/src/java/org/apache/lucene/index/OwnCacheKeyMultiReader.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/OwnCacheKeyMultiReader.java index 9f97228bbb6..2e8cbc8f719 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/OwnCacheKeyMultiReader.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/OwnCacheKeyMultiReader.java @@ -14,11 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.MultiReader; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.util.IOUtils; /** A {@link MultiReader} that has its own cache key, occasionally useful for testing purposes. */ @@ -28,7 +31,7 @@ public final class OwnCacheKeyMultiReader extends MultiReader { private final CacheHelper cacheHelper = new CacheHelper() { - private final CacheKey cacheKey = new CacheKey(); + private final CacheKey cacheKey = TestSecrets.getIndexPackageAccess().newCacheKey(); @Override public CacheKey getKey() { @@ -53,7 +56,7 @@ public final class OwnCacheKeyMultiReader extends MultiReader { } @Override - void notifyReaderClosedListeners() throws IOException { + protected void notifyReaderClosedListeners() throws IOException { synchronized (readerClosedListeners) { IOUtils.applyToAll(readerClosedListeners, l -> l.onClose(cacheHelper.getKey())); } diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/PerThreadPKLookup.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/PerThreadPKLookup.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/index/PerThreadPKLookup.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/PerThreadPKLookup.java index 51ba6ca753c..b5327515abd 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/PerThreadPKLookup.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/PerThreadPKLookup.java @@ -14,13 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.PostingsEnum; +import org.apache.lucene.index.Terms; +import org.apache.lucene.index.TermsEnum; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/PointsStackTracker.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/PointsStackTracker.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/index/PointsStackTracker.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/PointsStackTracker.java index 05bff86e2c9..2c1bae658ec 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/PointsStackTracker.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/PointsStackTracker.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.util.ArrayList; import java.util.Arrays; diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomCodec.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomCodec.java index 8f717679c38..03866a3d177 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/RandomCodec.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomCodec.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.IOException; import java.util.ArrayList; @@ -30,25 +30,29 @@ import org.apache.lucene.codecs.PointsFormat; import org.apache.lucene.codecs.PointsReader; import org.apache.lucene.codecs.PointsWriter; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; -import org.apache.lucene.codecs.asserting.AssertingDocValuesFormat; -import org.apache.lucene.codecs.asserting.AssertingPointsFormat; -import org.apache.lucene.codecs.asserting.AssertingPostingsFormat; -import org.apache.lucene.codecs.blockterms.LuceneFixedGap; -import org.apache.lucene.codecs.blockterms.LuceneVarGapDocFreqInterval; -import org.apache.lucene.codecs.blockterms.LuceneVarGapFixedInterval; import org.apache.lucene.codecs.blocktreeords.BlockTreeOrdsPostingsFormat; -import org.apache.lucene.codecs.bloom.TestBloomFilteredLucenePostings; import org.apache.lucene.codecs.lucene90.Lucene90DocValuesFormat; import org.apache.lucene.codecs.lucene90.Lucene90PointsReader; import org.apache.lucene.codecs.lucene90.Lucene90PointsWriter; import org.apache.lucene.codecs.memory.DirectPostingsFormat; import org.apache.lucene.codecs.memory.FSTPostingsFormat; -import org.apache.lucene.codecs.mockrandom.MockRandomPostingsFormat; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.PointValues; import org.apache.lucene.index.PointValues.IntersectVisitor; +import org.apache.lucene.index.SegmentReadState; +import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.codecs.asserting.AssertingDocValuesFormat; +import org.apache.lucene.tests.codecs.asserting.AssertingPointsFormat; +import org.apache.lucene.tests.codecs.asserting.AssertingPostingsFormat; +import org.apache.lucene.tests.codecs.blockterms.LuceneFixedGap; +import org.apache.lucene.tests.codecs.blockterms.LuceneVarGapDocFreqInterval; +import org.apache.lucene.tests.codecs.blockterms.LuceneVarGapFixedInterval; +import org.apache.lucene.tests.codecs.bloom.TestBloomFilteredLucenePostings; +import org.apache.lucene.tests.codecs.mockrandom.MockRandomPostingsFormat; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.bkd.BKDConfig; import org.apache.lucene.util.bkd.BKDWriter; diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomIndexWriter.java similarity index 91% rename from lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomIndexWriter.java index acf21776313..4ad7ea16654 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomIndexWriter.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.io.Closeable; import java.io.IOException; @@ -24,17 +24,28 @@ import java.util.List; import java.util.Random; import java.util.concurrent.CopyOnWriteArrayList; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.IndexableField; +import org.apache.lucene.index.LiveIndexWriterConfig; +import org.apache.lucene.index.NoMergePolicy; +import org.apache.lucene.index.SoftDeletesDirectoryReaderWrapper; +import org.apache.lucene.index.Term; +import org.apache.lucene.index.TieredMergePolicy; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.NullInfoStream; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.InfoStream; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.NullInfoStream; -import org.apache.lucene.util.TestUtil; /** * Silly class that randomizes the indexing experience. EG it may swap in a different merge @@ -242,7 +253,7 @@ public class RandomIndexWriter implements Closeable { System.out.println( "RIW.add/updateDocument: now flushing the largest writer at docCount=" + docCount); } - int threadPoolSize = w.docWriter.perThreadPool.size(); + int threadPoolSize = TestSecrets.getIndexWriterAccess().getDocWriterThreadPoolSize(w); int numFlushes = Math.min(1, r.nextInt(threadPoolSize + 1)); for (int i = 0; i < numFlushes; i++) { if (w.flushNextBuffer() == false) { @@ -429,7 +440,8 @@ public class RandomIndexWriter implements Closeable { private void doRandomForceMerge() throws IOException { if (doRandomForceMerge) { - final int segCount = w.getSegmentCount(); + var indexWriterSecrets = TestSecrets.getIndexWriterAccess(); + final int segCount = indexWriterSecrets.getSegmentCount(w); if (r.nextBoolean() || segCount == 0) { // full forceMerge if (LuceneTestCase.VERBOSE) { @@ -444,8 +456,8 @@ public class RandomIndexWriter implements Closeable { } w.forceMerge(limit); if (limit == 1 || (config.getMergePolicy() instanceof TieredMergePolicy) == false) { - assert !doRandomForceMergeAssert || w.getSegmentCount() <= limit - : "limit=" + limit + " actual=" + w.getSegmentCount(); + assert !doRandomForceMergeAssert || indexWriterSecrets.getSegmentCount(w) <= limit + : "limit=" + limit + " actual=" + indexWriterSecrets.getSegmentCount(w); } } else { if (LuceneTestCase.VERBOSE) { @@ -471,7 +483,7 @@ public class RandomIndexWriter implements Closeable { if (r.nextInt(5) == 1) { w.commit(); } - return w.getReader(applyDeletions, writeAllDeletes); + return TestSecrets.getIndexWriterAccess().getReader(w, applyDeletions, writeAllDeletes); } else { if (LuceneTestCase.VERBOSE) { System.out.println("RIW.getReader: open new reader"); @@ -485,7 +497,7 @@ public class RandomIndexWriter implements Closeable { return reader; } } else { - return w.getReader(applyDeletions, writeAllDeletes); + return TestSecrets.getIndexWriterAccess().getReader(w, applyDeletions, writeAllDeletes); } } } @@ -499,12 +511,15 @@ public class RandomIndexWriter implements Closeable { public void close() throws IOException { boolean success = false; try { - if (w.isClosed() == false) { + var indexWriterSecrets = TestSecrets.getIndexWriterAccess(); + if (indexWriterSecrets.isClosed(w) == false) { LuceneTestCase.maybeChangeLiveIndexWriterConfig(r, config); } // if someone isn't using getReader() API, we want to be sure to // forceMerge since presumably they might open a reader on the dir. - if (getReaderCalled == false && r.nextInt(8) == 2 && w.isClosed() == false) { + if (getReaderCalled == false + && r.nextInt(8) == 2 + && indexWriterSecrets.isClosed(w) == false) { doRandomForceMerge(); if (config.getCommitOnClose() == false) { // index may have changed, must commit the changes, or otherwise they are discarded by the diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomPostingsTester.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomPostingsTester.java index 26db06401d7..b277cf46245 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/RandomPostingsTester.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -45,20 +45,39 @@ import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FieldsConsumer; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.NormsProducer; +import org.apache.lucene.index.BaseTermsEnum; +import org.apache.lucene.index.DocValuesType; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.FieldInfos; +import org.apache.lucene.index.Fields; +import org.apache.lucene.index.Impact; +import org.apache.lucene.index.Impacts; +import org.apache.lucene.index.ImpactsEnum; +import org.apache.lucene.index.IndexOptions; +import org.apache.lucene.index.NumericDocValues; +import org.apache.lucene.index.PostingsEnum; +import org.apache.lucene.index.SegmentInfo; +import org.apache.lucene.index.SegmentReadState; +import org.apache.lucene.index.SegmentWriteState; +import org.apache.lucene.index.TermState; +import org.apache.lucene.index.Terms; +import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.index.VectorSimilarityFunction; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FlushInfo; import org.apache.lucene.store.IOContext; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil.RandomAcceptedStrings; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.StringHelper; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; import org.apache.lucene.util.Version; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; -import org.apache.lucene.util.automaton.AutomatonTestUtil.RandomAcceptedStrings; import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.Operations; @@ -1224,7 +1243,7 @@ public class RandomPostingsTester { if (doc > max) { impactsEnum.advanceShallow(doc); Impacts impacts = impactsEnum.getImpacts(); - CheckIndex.checkImpacts(impacts, doc); + TestSecrets.getIndexPackageAccess().checkImpacts(impacts, doc); impactsCopy = impacts.getImpacts(0).stream() .map(i -> new Impact(i.freq, i.norm)) @@ -1270,7 +1289,7 @@ public class RandomPostingsTester { impactsEnum.advanceShallow(target); Impacts impacts = impactsEnum.getImpacts(); - CheckIndex.checkImpacts(impacts, target); + TestSecrets.getIndexPackageAccess().checkImpacts(impacts, target); impactsCopy = Collections.singletonList(new Impact(Integer.MAX_VALUE, 1L)); for (int level = 0; level < impacts.numLevels(); ++level) { if (impacts.getDocIdUpTo(level) >= max) { @@ -1311,7 +1330,7 @@ public class RandomPostingsTester { int delta = Math.min(1 + random.nextInt(512), DocIdSetIterator.NO_MORE_DOCS - doc); max = doc + delta; Impacts impacts = impactsEnum.getImpacts(); - CheckIndex.checkImpacts(impacts, doc); + TestSecrets.getIndexPackageAccess().checkImpacts(impacts, doc); impactsCopy = Collections.singletonList(new Impact(Integer.MAX_VALUE, 1L)); for (int level = 0; level < impacts.numLevels(); ++level) { if (impacts.getDocIdUpTo(level) >= max) { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/SuppressingConcurrentMergeScheduler.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/SuppressingConcurrentMergeScheduler.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/index/SuppressingConcurrentMergeScheduler.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/SuppressingConcurrentMergeScheduler.java index 99d3a205fac..820ed381521 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/SuppressingConcurrentMergeScheduler.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/SuppressingConcurrentMergeScheduler.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; + +import org.apache.lucene.index.ConcurrentMergeScheduler; /** A {@link ConcurrentMergeScheduler} that ignores AlreadyClosedException. */ public abstract class SuppressingConcurrentMergeScheduler extends ConcurrentMergeScheduler { diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/ThreadedIndexingAndSearchingTestCase.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/index/ThreadedIndexingAndSearchingTestCase.java index 17822296c8f..486111c88b8 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/ThreadedIndexingAndSearchingTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import java.nio.file.Path; import java.util.ArrayList; @@ -31,9 +31,18 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.IndexableField; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.MultiTerms; +import org.apache.lucene.index.SegmentReader; +import org.apache.lucene.index.Term; +import org.apache.lucene.index.Terms; +import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; @@ -42,16 +51,17 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.util.FailOnNonBulkMergesInfoStream; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.FailOnNonBulkMergesInfoStream; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.NamedThreadFactory; import org.apache.lucene.util.PrintStreamInfoStream; -import org.apache.lucene.util.TestUtil; // TODO // - mix in forceMerge, addIndexes @@ -397,7 +407,9 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas + diagnostics + " si=" + segReader.getSegmentInfo(), - !assertMergedSegmentsWarmed || warmed.containsKey(segReader.core)); + !assertMergedSegmentsWarmed + || warmed.containsKey( + TestSecrets.getSegmentReaderAccess().getCore(segReader))); } } if (s.getIndexReader().numDocs() > 0) { @@ -469,8 +481,7 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas protected boolean assertMergedSegmentsWarmed = true; - private final Map warmed = - Collections.synchronizedMap(new WeakHashMap()); + private final Map warmed = Collections.synchronizedMap(new WeakHashMap<>()); public void runTest(String testName) throws Exception { @@ -504,7 +515,8 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas if (VERBOSE) { System.out.println("TEST: now warm merged reader=" + reader); } - warmed.put(((SegmentReader) reader).core, Boolean.TRUE); + var core = TestSecrets.getSegmentReaderAccess().getCore((SegmentReader) reader); + warmed.put(core, Boolean.TRUE); final int maxDoc = reader.maxDoc(); final Bits liveDocs = reader.getLiveDocs(); int sum = 0; @@ -703,7 +715,12 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas assertFalse(doFail); assertEquals( - "index=" + writer.segString() + " addCount=" + addCount + " delCount=" + delCount, + "index=" + + TestSecrets.getIndexWriterAccess().segString(writer) + + " addCount=" + + addCount + + " delCount=" + + delCount, addCount.get() - delCount.get(), s.getIndexReader().numDocs()); releaseSearcher(s); @@ -711,7 +728,12 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas writer.commit(); assertEquals( - "index=" + writer.segString() + " addCount=" + addCount + " delCount=" + delCount, + "index=" + + TestSecrets.getIndexWriterAccess().segString(writer) + + " addCount=" + + addCount + + " delCount=" + + delCount, addCount.get() - delCount.get(), writer.getDocStats().numDocs); diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/index/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/package-info.java new file mode 100644 index 00000000000..e69d1126ed1 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/package-info.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing of indexes. + * + *

The primary classes are: + * + *

    + *
  • {@link org.apache.lucene.tests.index.RandomIndexWriter}: Randomizes the indexing + * experience. + *
  • {@link org.apache.lucene.tests.index.MockRandomMergePolicy}: MergePolicy that makes random + * decisions. + *
+ */ +package org.apache.lucene.tests.index; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/DisableFsyncFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/DisableFsyncFS.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/DisableFsyncFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/DisableFsyncFS.java index b1eea65349a..403477b61b7 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/DisableFsyncFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/DisableFsyncFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.channels.AsynchronousFileChannel; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/ExtrasFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/ExtrasFS.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/ExtrasFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/ExtrasFS.java index 27978a268f4..124731b801b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/ExtrasFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/ExtrasFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.file.FileSystem; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterAsynchronousFileChannel.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterAsynchronousFileChannel.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterAsynchronousFileChannel.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterAsynchronousFileChannel.java index 950e17d5dbf..f65fc5df50f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterAsynchronousFileChannel.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterAsynchronousFileChannel.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterDirectoryStream.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterDirectoryStream.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterDirectoryStream.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterDirectoryStream.java index 95639741507..e05f7db9ad3 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterDirectoryStream.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterDirectoryStream.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.file.DirectoryStream; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileChannel.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileChannel.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileChannel.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileChannel.java index df2f1d4d83c..3f8ed3bc361 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileChannel.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileChannel.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileStore.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileStore.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileStore.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileStore.java index dd936435797..71b93841a33 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileStore.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileStore.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.file.FileStore; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileSystem.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystem.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileSystem.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystem.java index b3737ad52fc..f9576f480d7 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileSystem.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystem.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.file.FileStore; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileSystemProvider.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystemProvider.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileSystemProvider.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystemProvider.java index b9f771a952e..700d3d7a40f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterFileSystemProvider.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterFileSystemProvider.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.io.InputStream; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterInputStream2.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterInputStream2.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterInputStream2.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterInputStream2.java index 5c4ff32f591..c46aa4b2da9 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterInputStream2.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterInputStream2.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.FilterInputStream; import java.io.IOException; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterOutputStream2.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterOutputStream2.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterOutputStream2.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterOutputStream2.java index 9abfd12968e..e2ea1079b13 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterOutputStream2.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterOutputStream2.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.FilterOutputStream; import java.io.IOException; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterPath.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterPath.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterPath.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterPath.java index 73f496fcb91..8af517cf72e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterPath.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterPath.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.File; import java.io.IOException; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterSeekableByteChannel.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterSeekableByteChannel.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterSeekableByteChannel.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterSeekableByteChannel.java index d5b587909b5..ed3f99baa0b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/FilterSeekableByteChannel.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/FilterSeekableByteChannel.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/HandleLimitFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/HandleLimitFS.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/HandleLimitFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/HandleLimitFS.java index ece3ba2c648..7939fc4452a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/HandleLimitFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/HandleLimitFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.lang.annotation.Documented; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/HandleTrackingFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/HandleTrackingFS.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/HandleTrackingFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/HandleTrackingFS.java index 056e0882240..44c89b619dd 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/HandleTrackingFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/HandleTrackingFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.Closeable; import java.io.IOException; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/LeakFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/LeakFS.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/LeakFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/LeakFS.java index 296c4a889e2..d3f398d5fce 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/LeakFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/LeakFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.nio.file.FileSystem; import java.nio.file.Path; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/MockFileSystemTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/MockFileSystemTestCase.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/MockFileSystemTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/MockFileSystemTestCase.java index 5ba6a675dd4..f513581d734 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/MockFileSystemTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/MockFileSystemTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.io.OutputStream; @@ -23,9 +23,9 @@ import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems; import org.apache.lucene.util.Constants; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems; /** * Base class for testing mockfilesystems. This tests things that really need to work: Path diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/ShuffleFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/ShuffleFS.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/ShuffleFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/ShuffleFS.java index 212760252e1..004acbe7419 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/ShuffleFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/ShuffleFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.file.DirectoryStream; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VerboseFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/VerboseFS.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/VerboseFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/VerboseFS.java index 166f1a14dea..a848a106c9a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VerboseFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/VerboseFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.io.OutputStream; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/VirusCheckingFS.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/VirusCheckingFS.java index e1b54563e98..9a969362c15 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/VirusCheckingFS.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.file.AccessDeniedException; @@ -24,7 +24,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.concurrent.atomic.AtomicLong; import org.apache.lucene.index.IndexWriter; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase; /** * Acts like a virus checker on Windows, where random programs may open the files you just wrote in diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/WindowsFS.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/WindowsFS.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java index c3061d24417..23575d770cd 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/WindowsFS.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.nio.file.CopyOption; diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/package-info.java similarity index 57% rename from lucene/test-framework/src/java/org/apache/lucene/mockfile/package-info.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/package-info.java index 543d0d64b33..6def9318c74 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/package-info.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/package-info.java @@ -21,14 +21,15 @@ *

The primary classes are: * *

    - *
  • {@link org.apache.lucene.mockfile.LeakFS}: Fails tests if they leave open filehandles. - *
  • {@link org.apache.lucene.mockfile.VerboseFS}: Prints destructive filesystem operations to - * infostream. - *
  • {@link org.apache.lucene.mockfile.WindowsFS}: Acts like windows. - *
  • {@link org.apache.lucene.mockfile.DisableFsyncFS}: Makes actual fsync calls a no-op. - *
  • {@link org.apache.lucene.mockfile.ExtrasFS}: Adds 'bonus' files to directories. - *
  • {@link org.apache.lucene.mockfile.ShuffleFS}: Directory listings in an unpredictable but - * deterministic order. + *
  • {@link org.apache.lucene.tests.mockfile.LeakFS}: Fails tests if they leave open file + * handles. + *
  • {@link org.apache.lucene.tests.mockfile.VerboseFS}: Prints destructive filesystem + * operations to infostream. + *
  • {@link org.apache.lucene.tests.mockfile.WindowsFS}: Acts like windows. + *
  • {@link org.apache.lucene.tests.mockfile.DisableFsyncFS}: Makes actual fsync calls a no-op. + *
  • {@link org.apache.lucene.tests.mockfile.ExtrasFS}: Adds 'bonus' files to directories. + *
  • {@link org.apache.lucene.tests.mockfile.ShuffleFS}: Directory listings in an unpredictable + * but deterministic order. *
*/ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingBulkScorer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingBulkScorer.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingBulkScorer.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingBulkScorer.java index a44523adf29..6d9c5e0fcd3 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingBulkScorer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingBulkScorer.java @@ -14,12 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.io.IOException; import java.util.Random; import org.apache.lucene.index.PostingsEnum; +import org.apache.lucene.search.BulkScorer; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.ScoreMode; import org.apache.lucene.util.Bits; /** Wraps a Scorer with additional checks */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingCollector.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingCollector.java similarity index 90% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingCollector.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingCollector.java index 4e6aef7b0af..7ffa9350e2b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingCollector.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingCollector.java @@ -14,10 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.FilterCollector; +import org.apache.lucene.search.LeafCollector; /** A collector that asserts that it is used correctly. */ class AssertingCollector extends FilterCollector { diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingIndexSearcher.java similarity index 91% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingIndexSearcher.java index 626139625bc..83abd788309 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingIndexSearcher.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingIndexSearcher.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.List; @@ -23,6 +23,11 @@ import java.util.concurrent.ExecutorService; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexReaderContext; import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Weight; /** * Helper class that adds some extra checks to ensure correct usage of {@code IndexSearcher} and diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingLeafCollector.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingLeafCollector.java similarity index 89% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingLeafCollector.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingLeafCollector.java index e61b3b9bf4c..5c7801e5122 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingLeafCollector.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingLeafCollector.java @@ -14,9 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.FilterLeafCollector; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.Scorable; /** Wraps another Collector and checks that order is respected. */ class AssertingLeafCollector extends FilterLeafCollector { diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingMatches.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingMatches.java similarity index 83% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingMatches.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingMatches.java index 53827783473..8c6121b3e3e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingMatches.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingMatches.java @@ -15,18 +15,21 @@ * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.Iterator; +import org.apache.lucene.search.Matches; +import org.apache.lucene.search.MatchesIterator; -class AssertingMatches implements Matches { +/** An implementation of {@link Matches} with additional consistency checks. */ +public class AssertingMatches implements Matches { private final Matches in; - AssertingMatches(Matches matches) { + public AssertingMatches(Matches matches) { this.in = matches; } diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingMatchesIterator.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingMatchesIterator.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingMatchesIterator.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingMatchesIterator.java index 40239590dee..ccb3fbc69fe 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingMatchesIterator.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingMatchesIterator.java @@ -15,9 +15,11 @@ * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; +import org.apache.lucene.search.MatchesIterator; +import org.apache.lucene.search.Query; class AssertingMatchesIterator implements MatchesIterator { diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingQuery.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingQuery.java similarity index 90% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingQuery.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingQuery.java index 2bea8003838..0947ff908bb 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingQuery.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingQuery.java @@ -14,11 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.Random; import org.apache.lucene.index.IndexReader; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Weight; /** Assertion-enabled query. */ public final class AssertingQuery extends Query { diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorable.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingScorable.java similarity index 90% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorable.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingScorable.java index 9cc40bd2ce3..2a431ab1cfd 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorable.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingScorable.java @@ -15,9 +15,14 @@ * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.FilterScorable; +import org.apache.lucene.search.FilterScorer; +import org.apache.lucene.search.Scorable; +import org.apache.lucene.search.Scorer; /** Wraps another Scorable and asserts that scores are reasonable and only called when positioned */ public class AssertingScorable extends FilterScorable { @@ -79,7 +84,7 @@ public class AssertingScorable extends FilterScorable { while (true) { if (in instanceof AssertingScorable) in = ((AssertingScorable) in).in; else if (in instanceof AssertingScorer) in = ((AssertingScorer) in).in; - else if (in instanceof WrappedScorer) in = ((WrappedScorer) in).in; + else if (in instanceof WrappedScorer) in = ((WrappedScorer) in).unwrap(); else return in; } } diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingScorer.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorer.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingScorer.java index 83ffc789b40..8792535375d 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingScorer.java @@ -14,12 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.Random; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.TwoPhaseIterator; /** Wraps a Scorer with additional checks */ public class AssertingScorer extends Scorer { @@ -48,7 +52,7 @@ public class AssertingScorer extends Scorer { int lastShallowTarget = -1; private AssertingScorer(Random random, Scorer in, ScoreMode scoreMode) { - super(in.weight); + super(in.getWeight()); this.random = random; this.in = in; this.scoreMode = scoreMode; diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingWeight.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingWeight.java similarity index 90% rename from lucene/test-framework/src/java/org/apache/lucene/search/AssertingWeight.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingWeight.java index 857e2dc954e..9dec127789b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingWeight.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingWeight.java @@ -14,13 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; -import static org.apache.lucene.util.LuceneTestCase.usually; +import static org.apache.lucene.tests.util.LuceneTestCase.usually; import java.io.IOException; import java.util.Random; import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.BulkScorer; +import org.apache.lucene.search.FilterWeight; +import org.apache.lucene.search.Matches; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.ScorerSupplier; +import org.apache.lucene.search.Weight; class AssertingWeight extends FilterWeight { diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/BaseExplanationTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/BaseExplanationTestCase.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/search/BaseExplanationTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/BaseExplanationTestCase.java index e16747d1e11..f76a089091b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/BaseExplanationTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/BaseExplanationTestCase.java @@ -14,19 +14,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/BaseRangeFieldQueryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/BaseRangeFieldQueryTestCase.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/search/BaseRangeFieldQueryTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/BaseRangeFieldQueryTestCase.java index 6e1f705a356..ffbc2ef091c 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/BaseRangeFieldQueryTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/BaseRangeFieldQueryTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.Arrays; @@ -33,12 +33,16 @@ import org.apache.lucene.index.MultiDocValues; import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.Term; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.SimpleCollector; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; /** * Abstract class to do basic tests for a RangeField query. Testing rigor inspired by {@code diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/BlockScoreQueryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/BlockScoreQueryWrapper.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/search/BlockScoreQueryWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/BlockScoreQueryWrapper.java index be55abad03b..ebb5c4bd132 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/BlockScoreQueryWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/BlockScoreQueryWrapper.java @@ -14,13 +14,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.Arrays; import java.util.Objects; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.Explanation; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.Weight; import org.apache.lucene.util.ArrayUtil; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/BulkScorerWrapperScorer.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/BulkScorerWrapperScorer.java similarity index 91% rename from lucene/test-framework/src/java/org/apache/lucene/search/BulkScorerWrapperScorer.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/BulkScorerWrapperScorer.java index 54bd6699ce7..e7476ecdcb8 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/BulkScorerWrapperScorer.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/BulkScorerWrapperScorer.java @@ -14,10 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.Arrays; +import org.apache.lucene.search.BulkScorer; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.Scorable; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.Weight; /** A {@link BulkScorer}-backed scorer. */ public class BulkScorerWrapperScorer extends Scorer { diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/CheckHits.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/CheckHits.java index 13ba68d3146..7936490523b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/CheckHits.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import static org.junit.Assert.*; @@ -26,7 +26,24 @@ import java.util.TreeSet; import java.util.regex.Pattern; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.Explanation; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Matches; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.Scorable; +import org.apache.lucene.search.ScoreDoc; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.SimpleCollector; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.TopDocs; +import org.apache.lucene.search.TopFieldDocs; +import org.apache.lucene.search.TopScoreDocCollector; +import org.apache.lucene.search.TwoPhaseIterator; +import org.apache.lucene.search.Weight; +import org.apache.lucene.tests.util.LuceneTestCase; /** Utility class for asserting expected hits in tests. */ public class CheckHits { @@ -641,8 +658,8 @@ public class CheckHits { } TwoPhaseIterator twoPhase1 = s1.twoPhaseIterator(); TwoPhaseIterator twoPhase2 = s2.twoPhaseIterator(); - DocIdSetIterator approx1 = twoPhase1 == null ? s1.iterator() : twoPhase1.approximation; - DocIdSetIterator approx2 = twoPhase2 == null ? s2.iterator() : twoPhase2.approximation; + DocIdSetIterator approx1 = twoPhase1 == null ? s1.iterator() : twoPhase1.approximation(); + DocIdSetIterator approx2 = twoPhase2 == null ? s2.iterator() : twoPhase2.approximation(); int upTo = -1; float maxScore = 0; float minScore = 0; @@ -689,8 +706,8 @@ public class CheckHits { } TwoPhaseIterator twoPhase1 = s1.twoPhaseIterator(); TwoPhaseIterator twoPhase2 = s2.twoPhaseIterator(); - DocIdSetIterator approx1 = twoPhase1 == null ? s1.iterator() : twoPhase1.approximation; - DocIdSetIterator approx2 = twoPhase2 == null ? s2.iterator() : twoPhase2.approximation; + DocIdSetIterator approx1 = twoPhase1 == null ? s1.iterator() : twoPhase1.approximation(); + DocIdSetIterator approx2 = twoPhase2 == null ? s2.iterator() : twoPhase2.approximation(); int upTo = -1; float minScore = 0; diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/MatchesTestBase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/MatchesTestBase.java similarity index 89% rename from lucene/test-framework/src/java/org/apache/lucene/search/MatchesTestBase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/MatchesTestBase.java index d232c187dd1..ad42ec73a39 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/MatchesTestBase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/MatchesTestBase.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.Arrays; import java.util.HashSet; import java.util.IdentityHashMap; +import java.util.List; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.IntPoint; @@ -33,10 +33,18 @@ import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.ReaderUtil; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Matches; +import org.apache.lucene.search.MatchesIterator; +import org.apache.lucene.search.NamedMatches; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; /** * Base class for tests checking the {@link Weight#matches(LeafReaderContext, int)} implementations @@ -120,8 +128,8 @@ public abstract class MatchesTestBase extends LuceneTestCase { protected void checkMatches(Query q, String field, int[][] expected) throws IOException { Weight w = searcher.createWeight(searcher.rewrite(q), ScoreMode.COMPLETE, 1); for (int i = 0; i < expected.length; i++) { - LeafReaderContext ctx = - searcher.leafContexts.get(ReaderUtil.subIndex(expected[i][0], searcher.leafContexts)); + List leafContexts = searcher.getLeafContexts(); + LeafReaderContext ctx = leafContexts.get(ReaderUtil.subIndex(expected[i][0], leafContexts)); int doc = expected[i][0] - ctx.docBase; Matches matches = w.matches(ctx, doc); if (matches == null) { @@ -148,8 +156,8 @@ public abstract class MatchesTestBase extends LuceneTestCase { protected void checkLabelCount(Query q, String field, int[] expected) throws IOException { Weight w = searcher.createWeight(searcher.rewrite(q), ScoreMode.COMPLETE, 1); for (int i = 0; i < expected.length; i++) { - LeafReaderContext ctx = - searcher.leafContexts.get(ReaderUtil.subIndex(i, searcher.leafContexts)); + List leafContexts = searcher.getLeafContexts(); + LeafReaderContext ctx = leafContexts.get(ReaderUtil.subIndex(i, leafContexts)); int doc = i - ctx.docBase; Matches matches = w.matches(ctx, doc); if (matches == null) { @@ -204,8 +212,8 @@ public abstract class MatchesTestBase extends LuceneTestCase { throws IOException { Weight w = searcher.createWeight(searcher.rewrite(q), ScoreMode.COMPLETE, 1); for (int i = 0; i < expected.length; i++) { - LeafReaderContext ctx = - searcher.leafContexts.get(ReaderUtil.subIndex(i, searcher.leafContexts)); + List leafContexts = searcher.getLeafContexts(); + LeafReaderContext ctx = leafContexts.get(ReaderUtil.subIndex(i, leafContexts)); int doc = i - ctx.docBase; Matches matches = w.matches(ctx, doc); if (expected[i]) { @@ -231,8 +239,8 @@ public abstract class MatchesTestBase extends LuceneTestCase { protected void checkSubMatches(Query q, String[][] expectedNames) throws IOException { Weight w = searcher.createWeight(searcher.rewrite(q), ScoreMode.COMPLETE_NO_SCORES, 1); for (int i = 0; i < expectedNames.length; i++) { - LeafReaderContext ctx = - searcher.leafContexts.get(ReaderUtil.subIndex(i, searcher.leafContexts)); + List leafContexts = searcher.getLeafContexts(); + LeafReaderContext ctx = leafContexts.get(ReaderUtil.subIndex(i, leafContexts)); int doc = i - ctx.docBase; Matches matches = w.matches(ctx, doc); if (matches == null) { @@ -262,9 +270,9 @@ public abstract class MatchesTestBase extends LuceneTestCase { */ protected void assertIsLeafMatch(Query q, String field) throws IOException { Weight w = searcher.createWeight(searcher.rewrite(q), ScoreMode.COMPLETE, 1); - for (int i = 0; i < searcher.reader.maxDoc(); i++) { - LeafReaderContext ctx = - searcher.leafContexts.get(ReaderUtil.subIndex(i, searcher.leafContexts)); + for (int i = 0; i < searcher.getIndexReader().maxDoc(); i++) { + List leafContexts = searcher.getLeafContexts(); + LeafReaderContext ctx = leafContexts.get(ReaderUtil.subIndex(i, leafContexts)); int doc = i - ctx.docBase; Matches matches = w.matches(ctx, doc); if (matches == null) { @@ -291,8 +299,8 @@ public abstract class MatchesTestBase extends LuceneTestCase { throws IOException { Weight w = searcher.createWeight(searcher.rewrite(q), ScoreMode.COMPLETE, 1); for (int i = 0; i < expected.length; i++) { - LeafReaderContext ctx = - searcher.leafContexts.get(ReaderUtil.subIndex(i, searcher.leafContexts)); + List leafContexts = searcher.getLeafContexts(); + LeafReaderContext ctx = leafContexts.get(ReaderUtil.subIndex(i, leafContexts)); int doc = i - ctx.docBase; Matches matches = w.matches(ctx, doc); if (matches == null) { diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/QueryUtils.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/QueryUtils.java index 318f101c473..e5465ed6435 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/QueryUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -39,8 +39,20 @@ import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.index.StoredFieldVisitor; import org.apache.lucene.index.Terms; import org.apache.lucene.index.VectorValues; +import org.apache.lucene.search.BulkScorer; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.search.Scorable; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.SimpleCollector; +import org.apache.lucene.search.TopDocs; +import org.apache.lucene.search.Weight; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.Version; import org.junit.Assert; diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/RandomApproximationQuery.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/RandomApproximationQuery.java similarity index 91% rename from lucene/test-framework/src/java/org/apache/lucene/search/RandomApproximationQuery.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/RandomApproximationQuery.java index 48318a7625c..78dc60732fb 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/RandomApproximationQuery.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/RandomApproximationQuery.java @@ -14,13 +14,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; import java.io.IOException; import java.util.Random; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.FilterWeight; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.TwoPhaseIterator; +import org.apache.lucene.search.Weight; /** A {@link Query} that adds random approximations to its scorers. */ public class RandomApproximationQuery extends Query { @@ -111,7 +120,7 @@ public class RandomApproximationQuery extends Query { @Override public int advanceShallow(int target) throws IOException { - if (scorer.docID() > target && twoPhaseView.approximation.docID() != scorer.docID()) { + if (scorer.docID() > target && twoPhaseView.approximation().docID() != scorer.docID()) { // The random approximation can return doc ids that are not present in the underlying // scorer. These additional doc ids are always *before* the next matching doc so we // cannot use them to shallow advance the main scorer which is already ahead. diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/ScorerIndexSearcher.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/ScorerIndexSearcher.java similarity index 88% rename from lucene/test-framework/src/java/org/apache/lucene/search/ScorerIndexSearcher.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/ScorerIndexSearcher.java index 5a7d0f3db1c..d3a414bc988 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/ScorerIndexSearcher.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/ScorerIndexSearcher.java @@ -14,13 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import java.util.List; import java.util.concurrent.Executor; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.BulkScorer; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.Weight; import org.apache.lucene.util.Bits; /** An {@link IndexSearcher} that always uses the {@link Scorer} API, never {@link BulkScorer}. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/SearchEquivalenceTestBase.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/SearchEquivalenceTestBase.java index 23c1ee07c0a..a65d1823726 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/SearchEquivalenceTestBase.java @@ -14,25 +14,33 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.util.BitSet; import java.util.Random; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.PhraseQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.TermRangeQuery; +import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.analysis.MockTokenizer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.junit.AfterClass; diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/ShardSearchingTestBase.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/ShardSearchingTestBase.java index 7f62db17a22..0084e16631a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/ShardSearchingTestBase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/ShardSearchingTestBase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.Closeable; import java.io.IOException; @@ -24,17 +24,28 @@ import java.util.Map; import java.util.Random; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermStates; +import org.apache.lucene.search.CollectionStatistics; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.search.ScoreDoc; +import org.apache.lucene.search.SearcherLifetimeManager; +import org.apache.lucene.search.SearcherManager; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.TermStatistics; +import org.apache.lucene.search.TopDocs; +import org.apache.lucene.search.TopFieldDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LineFileDocs; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LineFileDocs; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.PrintStreamInfoStream; -import org.apache.lucene.util.TestUtil; // TODO // - doc blocks? so we can test joins/grouping... @@ -607,7 +618,7 @@ public abstract class ShardSearchingTestBase extends LuceneTestCase { protected NodeState[] nodes; int maxSearcherAgeSeconds; - long endTimeNanos; + public long endTimeNanos; private Thread changeIndicesThread; protected void start(int numNodes, double runTimeSec, int maxSearcherAgeSeconds) diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/search/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/package-info.java new file mode 100644 index 00000000000..68b03661ea4 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/package-info.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing search components. + * + *

The primary classes are: + * + *

    + *
  • {@link org.apache.lucene.tests.search.QueryUtils}: Useful methods for testing Query + * classes. + *
  • {@link org.apache.lucene.tests.search.ShardSearchingTestBase}: Base class for simulating + * distributed search. + *
+ */ +package org.apache.lucene.tests.search; diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/AssertingSimilarity.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/AssertingSimilarity.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/search/similarities/AssertingSimilarity.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/AssertingSimilarity.java index 1f5c3a01f4e..b4bf4af31ba 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/AssertingSimilarity.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/AssertingSimilarity.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search.similarities; +package org.apache.lucene.tests.search.similarities; import org.apache.lucene.index.FieldInvertState; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.Explanation; import org.apache.lucene.search.TermStatistics; +import org.apache.lucene.search.similarities.Similarity; /** wraps a similarity with checks for testing */ public class AssertingSimilarity extends Similarity { diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/BaseSimilarityTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/BaseSimilarityTestCase.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/search/similarities/BaseSimilarityTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/BaseSimilarityTestCase.java index 15613f3dd33..84c340d516e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/BaseSimilarityTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/BaseSimilarityTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search.similarities; +package org.apache.lucene.tests.search.similarities; import java.io.IOException; import java.util.Random; @@ -22,18 +22,20 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.search.CheckHits; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.Explanation; import org.apache.lucene.search.TermStatistics; +import org.apache.lucene.search.similarities.IndriDirichletSimilarity; +import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.search.similarities.Similarity.SimScorer; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.CheckHits; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.SmallFloat; -import org.apache.lucene.util.TestUtil; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/RandomSimilarity.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/RandomSimilarity.java similarity index 65% rename from lucene/test-framework/src/java/org/apache/lucene/search/similarities/RandomSimilarity.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/RandomSimilarity.java index 08f917f2a98..3f50989bcf9 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/search/similarities/RandomSimilarity.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/RandomSimilarity.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search.similarities; +package org.apache.lucene.tests.search.similarities; import java.util.ArrayList; import java.util.Collections; @@ -22,6 +22,43 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; +import org.apache.lucene.search.similarities.AfterEffect; +import org.apache.lucene.search.similarities.AfterEffectB; +import org.apache.lucene.search.similarities.AfterEffectL; +import org.apache.lucene.search.similarities.AxiomaticF1EXP; +import org.apache.lucene.search.similarities.AxiomaticF1LOG; +import org.apache.lucene.search.similarities.AxiomaticF2EXP; +import org.apache.lucene.search.similarities.AxiomaticF2LOG; +import org.apache.lucene.search.similarities.BM25Similarity; +import org.apache.lucene.search.similarities.BasicModel; +import org.apache.lucene.search.similarities.BasicModelG; +import org.apache.lucene.search.similarities.BasicModelIF; +import org.apache.lucene.search.similarities.BasicModelIn; +import org.apache.lucene.search.similarities.BasicModelIne; +import org.apache.lucene.search.similarities.BooleanSimilarity; +import org.apache.lucene.search.similarities.ClassicSimilarity; +import org.apache.lucene.search.similarities.DFISimilarity; +import org.apache.lucene.search.similarities.DFRSimilarity; +import org.apache.lucene.search.similarities.Distribution; +import org.apache.lucene.search.similarities.DistributionLL; +import org.apache.lucene.search.similarities.DistributionSPL; +import org.apache.lucene.search.similarities.IBSimilarity; +import org.apache.lucene.search.similarities.Independence; +import org.apache.lucene.search.similarities.IndependenceChiSquared; +import org.apache.lucene.search.similarities.IndependenceSaturated; +import org.apache.lucene.search.similarities.IndependenceStandardized; +import org.apache.lucene.search.similarities.LMDirichletSimilarity; +import org.apache.lucene.search.similarities.LMJelinekMercerSimilarity; +import org.apache.lucene.search.similarities.Lambda; +import org.apache.lucene.search.similarities.LambdaDF; +import org.apache.lucene.search.similarities.LambdaTTF; +import org.apache.lucene.search.similarities.Normalization; +import org.apache.lucene.search.similarities.NormalizationH1; +import org.apache.lucene.search.similarities.NormalizationH2; +import org.apache.lucene.search.similarities.NormalizationH3; +import org.apache.lucene.search.similarities.NormalizationZ; +import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper; +import org.apache.lucene.search.similarities.Similarity; /** * Similarity implementation that randomizes Similarity implementations per-field. diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/package-info.java new file mode 100644 index 00000000000..86f8a6dd336 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/similarities/package-info.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing similarities. + * + *
    + *
  • {@link org.apache.lucene.tests.search.similarities.RandomSimilarity}: Randomizes similarity + * per-field in tests. + *
+ */ +package org.apache.lucene.tests.search.similarities; diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseChunkedDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseChunkedDirectoryTestCase.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/store/BaseChunkedDirectoryTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseChunkedDirectoryTestCase.java index db5be49477c..30e685f5eda 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseChunkedDirectoryTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseChunkedDirectoryTestCase.java @@ -14,18 +14,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.IOException; import java.nio.file.Path; import java.util.Random; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; +import org.apache.lucene.store.AlreadyClosedException; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.IOContext; +import org.apache.lucene.store.IndexInput; +import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.store.MMapDirectory; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; /** * Base class for Directories that "chunk" the input into blocks. diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryTestCase.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryTestCase.java index ddc6084f2c9..81b39f712bf 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.carrotsearch.randomizedtesting.generators.RandomBytes; @@ -45,10 +45,18 @@ import java.util.zip.CRC32; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.IndexNotFoundException; -import org.apache.lucene.mockfile.ExtrasFS; +import org.apache.lucene.store.AlreadyClosedException; +import org.apache.lucene.store.ChecksumIndexInput; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.FSDirectory; +import org.apache.lucene.store.IOContext; +import org.apache.lucene.store.IndexInput; +import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.store.RandomAccessInput; +import org.apache.lucene.tests.mockfile.ExtrasFS; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.junit.Assert; /** Base class for {@link Directory} implementations. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryWrapper.java similarity index 92% rename from lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryWrapper.java index 5d4cbb1e0e0..a440d2712f9 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryWrapper.java @@ -14,11 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.IOException; import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.util.TestUtil; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.FilterDirectory; +import org.apache.lucene.tests.util.TestUtil; /** Calls check index on close. */ // do NOT make any methods in this class synchronized, volatile diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseLockFactoryTestCase.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseLockFactoryTestCase.java index 152dfa754df..e614695ac3f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseLockFactoryTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -26,7 +26,6 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReentrantLock; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.DirectoryReader; @@ -38,10 +37,15 @@ import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.store.AlreadyClosedException; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.Lock; +import org.apache.lucene.store.LockObtainFailedException; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Constants; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.PrintStreamInfoStream; -import org.apache.lucene.util.TestUtil; /** Base class for per-LockFactory tests. */ public abstract class BaseLockFactoryTestCase extends LuceneTestCase { diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/CorruptingIndexOutput.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/CorruptingIndexOutput.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/store/CorruptingIndexOutput.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/CorruptingIndexOutput.java index 09209a4c66b..c0d65b31001 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/CorruptingIndexOutput.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/CorruptingIndexOutput.java @@ -15,9 +15,13 @@ * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.IOException; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.IOContext; +import org.apache.lucene.store.IndexInput; +import org.apache.lucene.store.IndexOutput; /** Corrupts on bit of a file after close */ public class CorruptingIndexOutput extends IndexOutput { diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockDirectoryWrapper.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/MockDirectoryWrapper.java index bb1f5a63921..7229a592cc3 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockDirectoryWrapper.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.Closeable; import java.io.FileNotFoundException; @@ -46,11 +46,18 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.NoDeletionPolicy; import org.apache.lucene.index.SegmentInfos; +import org.apache.lucene.store.AlreadyClosedException; +import org.apache.lucene.store.ChecksumIndexInput; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.IOContext; +import org.apache.lucene.store.IndexInput; +import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.store.Lock; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.ThrottledIndexOutput; import org.apache.lucene.util.CollectionUtil; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.ThrottledIndexOutput; /** * This is a Directory Wrapper that adds methods intended to be used only by unit tests. It also diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockIndexInputWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockIndexInputWrapper.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/store/MockIndexInputWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/MockIndexInputWrapper.java index fa9043e6571..d1b034a1237 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/MockIndexInputWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockIndexInputWrapper.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.Closeable; import java.io.IOException; import java.util.Map; import java.util.Set; +import org.apache.lucene.store.IndexInput; /** * Used by MockDirectoryWrapper to create an input stream that keeps track of when it's been closed. diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockIndexOutputWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockIndexOutputWrapper.java similarity index 95% rename from lucene/test-framework/src/java/org/apache/lucene/store/MockIndexOutputWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/MockIndexOutputWrapper.java index 939b8184eae..005542a2e90 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/MockIndexOutputWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockIndexOutputWrapper.java @@ -14,11 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.Closeable; import java.io.IOException; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.store.AlreadyClosedException; +import org.apache.lucene.store.DataInput; +import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; /** * Used to create an output stream that will throw an IOException on fake disk full, track max disk diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/RawDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/RawDirectoryWrapper.java similarity index 90% rename from lucene/test-framework/src/java/org/apache/lucene/store/RawDirectoryWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/RawDirectoryWrapper.java index 8886101472d..2ef79200c1d 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/RawDirectoryWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/RawDirectoryWrapper.java @@ -14,9 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.IOException; +import org.apache.lucene.store.ChecksumIndexInput; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.IOContext; /** * Delegates all operations, even optional ones, to the wrapped directory. @@ -40,9 +43,4 @@ public final class RawDirectoryWrapper extends BaseDirectoryWrapper { public ChecksumIndexInput openChecksumInput(String name, IOContext context) throws IOException { return in.openChecksumInput(name, context); } - - @Override - protected void ensureOpen() throws AlreadyClosedException { - in.ensureOpen(); - } } diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/SlowClosingMockIndexInputWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/SlowClosingMockIndexInputWrapper.java similarity index 95% rename from lucene/test-framework/src/java/org/apache/lucene/store/SlowClosingMockIndexInputWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/SlowClosingMockIndexInputWrapper.java index d79d0e6ac3b..436f456cd92 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/SlowClosingMockIndexInputWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/SlowClosingMockIndexInputWrapper.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.IOException; +import org.apache.lucene.store.IndexInput; import org.apache.lucene.util.ThreadInterruptedException; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/SlowOpeningMockIndexInputWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/SlowOpeningMockIndexInputWrapper.java similarity index 95% rename from lucene/test-framework/src/java/org/apache/lucene/store/SlowOpeningMockIndexInputWrapper.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/store/SlowOpeningMockIndexInputWrapper.java index affd0c778d6..68e38543ce5 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/SlowOpeningMockIndexInputWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/SlowOpeningMockIndexInputWrapper.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.IOException; +import org.apache.lucene.store.IndexInput; import org.apache.lucene.util.ThreadInterruptedException; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/store/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/package-info.java new file mode 100644 index 00000000000..50f09912eb5 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/package-info.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing store mechanisms. + * + *

The primary class is {@link org.apache.lucene.tests.store.MockDirectoryWrapper}, which wraps + * any Directory implementation and provides additional checks. + */ +package org.apache.lucene.tests.store; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/AbstractBeforeAfterRule.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/AbstractBeforeAfterRule.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/AbstractBeforeAfterRule.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/AbstractBeforeAfterRule.java index e0633c54934..7129f9e28d6 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/AbstractBeforeAfterRule.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/AbstractBeforeAfterRule.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.util.ArrayList; import org.junit.After; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/BaseBitSetTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/BaseBitSetTestCase.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/util/BaseBitSetTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/BaseBitSetTestCase.java index 6f7bb7d72bd..fa001cfe411 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/BaseBitSetTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/BaseBitSetTestCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.IOException; import java.util.Collection; @@ -22,6 +22,13 @@ import java.util.Collections; import java.util.Random; import org.apache.lucene.search.DocIdSet; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.util.Accountable; +import org.apache.lucene.util.BitDocIdSet; +import org.apache.lucene.util.BitSet; +import org.apache.lucene.util.BitSetIterator; +import org.apache.lucene.util.FixedBitSet; +import org.apache.lucene.util.RoaringDocIdSet; +import org.apache.lucene.util.SparseFixedBitSet; import org.junit.Ignore; /** Base test case for BitSets. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/BaseDocIdSetTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/BaseDocIdSetTestCase.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/BaseDocIdSetTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/BaseDocIdSetTestCase.java index 546999cb939..2c1dfc72a31 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/BaseDocIdSetTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/BaseDocIdSetTestCase.java @@ -14,15 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; -import static org.apache.lucene.util.BaseBitSetTestCase.randomSet; +import static org.apache.lucene.tests.util.BaseBitSetTestCase.randomSet; import java.io.IOException; import java.util.BitSet; import java.util.Random; import org.apache.lucene.search.DocIdSet; import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.util.Bits; /** Base test class for {@link DocIdSet}s. */ public abstract class BaseDocIdSetTestCase extends LuceneTestCase { diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/CloseableDirectory.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/CloseableDirectory.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/util/CloseableDirectory.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/CloseableDirectory.java index 541f4a5bf32..4df65884150 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/CloseableDirectory.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/CloseableDirectory.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.Closeable; -import org.apache.lucene.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; import org.junit.Assert; /** diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/English.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/English.java similarity index 99% rename from lucene/test-framework/src/java/org/apache/lucene/util/English.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/English.java index b245cb7b740..c78fb7ac362 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/English.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/English.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; /** * Converts numbers to english strings for testing. diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/FailOnNonBulkMergesInfoStream.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/FailOnNonBulkMergesInfoStream.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/util/FailOnNonBulkMergesInfoStream.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/FailOnNonBulkMergesInfoStream.java index e43a7040d97..9e36265609e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/FailOnNonBulkMergesInfoStream.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/FailOnNonBulkMergesInfoStream.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.IOException; +import org.apache.lucene.util.InfoStream; /** Hackidy-Häck-Hack to cause a test to fail on non-bulk merges */ // TODO: we should probably be a wrapper so verbose still works... diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/FailureMarker.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/FailureMarker.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/FailureMarker.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/FailureMarker.java index 517057897b9..5e36fff0fdd 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/FailureMarker.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/FailureMarker.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.util.concurrent.atomic.AtomicInteger; import org.junit.runner.notification.Failure; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/LineFileDocs.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/LineFileDocs.java index 34554be49e4..812582fe714 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/LineFileDocs.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.BufferedReader; import java.io.Closeable; @@ -44,6 +44,9 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexableField; +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.CloseableThreadLocal; +import org.apache.lucene.util.IOUtils; /** * Minimal port of benchmark's LneDocSource + DocMaker, so tests can enum docs from a line file diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneJUnit3MethodProvider.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneJUnit3MethodProvider.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/LuceneJUnit3MethodProvider.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneJUnit3MethodProvider.java index 6ff9af53a5b..06147f510e0 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneJUnit3MethodProvider.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneJUnit3MethodProvider.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.ClassModel; import com.carrotsearch.randomizedtesting.ClassModel.MethodModel; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneTestCase.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneTestCase.java index 70587b0596d..ca7ff895c90 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneTestCase.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsBoolean; import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsInt; @@ -102,7 +102,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import junit.framework.AssertionFailedError; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; @@ -111,16 +110,13 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.*; import org.apache.lucene.index.TermsEnum.SeekStatus; -import org.apache.lucene.mockfile.FilterPath; -import org.apache.lucene.mockfile.VirusCheckingFS; -import org.apache.lucene.search.AssertingIndexSearcher; +import org.apache.lucene.internal.tests.TestSecrets; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.LRUQueryCache; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryCache; import org.apache.lucene.search.QueryCachingPolicy; -import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; @@ -131,12 +127,34 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.LockFactory; import org.apache.lucene.store.MMapDirectory; import org.apache.lucene.store.MergeInfo; -import org.apache.lucene.store.MockDirectoryWrapper; -import org.apache.lucene.store.MockDirectoryWrapper.Throttling; import org.apache.lucene.store.NRTCachingDirectory; -import org.apache.lucene.store.RawDirectoryWrapper; +import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.index.AlcoholicMergePolicy; +import org.apache.lucene.tests.index.AssertingDirectoryReader; +import org.apache.lucene.tests.index.AssertingLeafReader; +import org.apache.lucene.tests.index.FieldFilterLeafReader; +import org.apache.lucene.tests.index.MergingCodecReader; +import org.apache.lucene.tests.index.MergingDirectoryReaderWrapper; +import org.apache.lucene.tests.index.MismatchedDirectoryReader; +import org.apache.lucene.tests.index.MismatchedLeafReader; +import org.apache.lucene.tests.index.MockIndexWriterEventListener; +import org.apache.lucene.tests.index.MockRandomMergePolicy; +import org.apache.lucene.tests.mockfile.FilterPath; +import org.apache.lucene.tests.mockfile.VirusCheckingFS; +import org.apache.lucene.tests.search.AssertingIndexSearcher; +import org.apache.lucene.tests.store.BaseDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper.Throttling; +import org.apache.lucene.tests.store.RawDirectoryWrapper; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; +import org.apache.lucene.util.Bits; +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.CommandLineUtil; +import org.apache.lucene.util.Constants; +import org.apache.lucene.util.InfoStream; +import org.apache.lucene.util.NamedThreadFactory; +import org.apache.lucene.util.SuppressForbidden; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; @@ -718,12 +736,12 @@ public abstract class LuceneTestCase extends Assert { * one index; call {@link #restoreIndexWriterMaxDocs} once your test is done. */ public void setIndexWriterMaxDocs(int limit) { - IndexWriterMaxDocsChanger.setMaxDocs(limit); + TestSecrets.getIndexPackageAccess().setIndexWriterMaxDocs(limit); } /** Returns to the default {@link IndexWriter#MAX_DOCS} limit. */ public void restoreIndexWriterMaxDocs() { - IndexWriterMaxDocsChanger.restoreMaxDocs(); + TestSecrets.getIndexPackageAccess().setIndexWriterMaxDocs(IndexWriter.MAX_DOCS); } // ----------------------------------------------------------------- diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/NullInfoStream.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/NullInfoStream.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/util/NullInfoStream.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/NullInfoStream.java index fb69c684b8a..6b9cf271c4e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/NullInfoStream.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/NullInfoStream.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.IOException; +import org.apache.lucene.util.InfoStream; /** * Prints nothing. Just to make sure tests pass w/ and without enabled InfoStream without actually diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/QuickPatchThreadsFilter.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/QuickPatchThreadsFilter.java similarity index 94% rename from lucene/test-framework/src/java/org/apache/lucene/util/QuickPatchThreadsFilter.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/QuickPatchThreadsFilter.java index c9e590fb9f4..480c86438f3 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/QuickPatchThreadsFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/QuickPatchThreadsFilter.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.ThreadFilter; +import org.apache.lucene.util.Constants; /** Last minute patches. */ public class QuickPatchThreadsFilter implements ThreadFilter { diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/RamUsageTester.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/RamUsageTester.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/RamUsageTester.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/RamUsageTester.java index 3662e098f68..870509d011c 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/RamUsageTester.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/RamUsageTester.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.ByteArrayOutputStream; import java.io.File; @@ -44,6 +44,9 @@ import java.util.function.ToLongFunction; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; +import org.apache.lucene.util.Constants; +import org.apache.lucene.util.RamUsageEstimator; +import org.apache.lucene.util.SuppressForbidden; /** Crawls object graph to collect RAM usage for testing */ public final class RamUsageTester { diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/RemoveUponClose.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/RemoveUponClose.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/util/RemoveUponClose.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/RemoveUponClose.java index 5d5c17207e4..3149bfd9209 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/RemoveUponClose.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/RemoveUponClose.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.Closeable; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import org.apache.lucene.util.IOUtils; /** A {@link Closeable} that attempts to remove a given file/folder. */ final class RemoveUponClose implements Closeable { diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/Rethrow.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/Rethrow.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/Rethrow.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/Rethrow.java index f80155128f2..bf5c2c65bfb 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/Rethrow.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/Rethrow.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; /** * Sneaky: rethrowing checked exceptions as unchecked ones. Eh, it is sometimes useful... diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/RunListenerPrintReproduceInfo.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/RunListenerPrintReproduceInfo.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/RunListenerPrintReproduceInfo.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/RunListenerPrintReproduceInfo.java index 1d3a53f2e9b..8162ce6a506 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/RunListenerPrintReproduceInfo.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/RunListenerPrintReproduceInfo.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; -import static org.apache.lucene.util.LuceneTestCase.*; +import static org.apache.lucene.tests.util.LuceneTestCase.*; import com.carrotsearch.randomizedtesting.LifecycleScope; import com.carrotsearch.randomizedtesting.RandomizedContext; @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; +import org.apache.lucene.util.Constants; import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleAssertionsRequired.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleAssertionsRequired.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleAssertionsRequired.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleAssertionsRequired.java index 44111979c30..6bc2020a8f6 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleAssertionsRequired.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleAssertionsRequired.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.rules.TestRule; import org.junit.runner.Description; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleDelegate.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleDelegate.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleDelegate.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleDelegate.java index 29ba4e42777..1e315eaa477 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleDelegate.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleDelegate.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.util.concurrent.atomic.AtomicReference; import org.junit.rules.TestRule; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreAfterMaxFailures.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleIgnoreAfterMaxFailures.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreAfterMaxFailures.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleIgnoreAfterMaxFailures.java index b0f0b3038ba..0d6b0ec8de4 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreAfterMaxFailures.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleIgnoreAfterMaxFailures.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.carrotsearch.randomizedtesting.annotations.Repeat; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreTestSuites.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleIgnoreTestSuites.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreTestSuites.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleIgnoreTestSuites.java index 7182e34b7b3..ca30739d27e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleIgnoreTestSuites.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleIgnoreTestSuites.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.rules.TestRule; import org.junit.runner.Description; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleLimitSysouts.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleLimitSysouts.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleLimitSysouts.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleLimitSysouts.java index cfa8689ed1a..9eed105f113 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleLimitSysouts.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleLimitSysouts.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.carrotsearch.randomizedtesting.rules.TestRuleAdapter; @@ -34,8 +34,8 @@ import java.util.List; import java.util.Locale; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import org.apache.lucene.util.LuceneTestCase.Monster; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; /** * This test rule serves two purposes: diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleMarkFailure.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleMarkFailure.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleMarkFailure.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleMarkFailure.java index e706af2803c..4394986a037 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleMarkFailure.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleMarkFailure.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.util.ArrayList; import java.util.List; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleRestoreSystemProperties.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleRestoreSystemProperties.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleRestoreSystemProperties.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleRestoreSystemProperties.java index 23ff9b58f8f..b609264e23f 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleRestoreSystemProperties.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleRestoreSystemProperties.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule; import com.carrotsearch.randomizedtesting.rules.TestRuleAdapter; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupAndRestoreClassEnv.java similarity index 86% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupAndRestoreClassEnv.java index feaafe2f76d..8d9767586f6 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupAndRestoreClassEnv.java @@ -14,18 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; -import static org.apache.lucene.util.LuceneTestCase.INFOSTREAM; -import static org.apache.lucene.util.LuceneTestCase.TEST_CODEC; -import static org.apache.lucene.util.LuceneTestCase.TEST_DOCVALUESFORMAT; -import static org.apache.lucene.util.LuceneTestCase.TEST_POSTINGSFORMAT; -import static org.apache.lucene.util.LuceneTestCase.VERBOSE; -import static org.apache.lucene.util.LuceneTestCase.assumeFalse; -import static org.apache.lucene.util.LuceneTestCase.localeForLanguageTag; -import static org.apache.lucene.util.LuceneTestCase.random; -import static org.apache.lucene.util.LuceneTestCase.randomLocale; -import static org.apache.lucene.util.LuceneTestCase.randomTimeZone; +import static org.apache.lucene.tests.util.LuceneTestCase.INFOSTREAM; +import static org.apache.lucene.tests.util.LuceneTestCase.TEST_CODEC; +import static org.apache.lucene.tests.util.LuceneTestCase.TEST_DOCVALUESFORMAT; +import static org.apache.lucene.tests.util.LuceneTestCase.TEST_POSTINGSFORMAT; +import static org.apache.lucene.tests.util.LuceneTestCase.VERBOSE; +import static org.apache.lucene.tests.util.LuceneTestCase.assumeFalse; +import static org.apache.lucene.tests.util.LuceneTestCase.localeForLanguageTag; +import static org.apache.lucene.tests.util.LuceneTestCase.random; +import static org.apache.lucene.tests.util.LuceneTestCase.randomLocale; +import static org.apache.lucene.tests.util.LuceneTestCase.randomTimeZone; import com.carrotsearch.randomizedtesting.RandomizedContext; import com.carrotsearch.randomizedtesting.generators.RandomPicks; @@ -38,20 +38,22 @@ import java.util.TimeZone; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; -import org.apache.lucene.codecs.asserting.AssertingDocValuesFormat; -import org.apache.lucene.codecs.asserting.AssertingPostingsFormat; -import org.apache.lucene.codecs.cheapbastard.CheapBastardCodec; -import org.apache.lucene.codecs.compressing.CompressingCodec; import org.apache.lucene.codecs.lucene90.Lucene90Codec; -import org.apache.lucene.codecs.mockrandom.MockRandomPostingsFormat; import org.apache.lucene.codecs.simpletext.SimpleTextCodec; -import org.apache.lucene.index.RandomCodec; -import org.apache.lucene.search.similarities.AssertingSimilarity; -import org.apache.lucene.search.similarities.RandomSimilarity; import org.apache.lucene.search.similarities.Similarity; -import org.apache.lucene.util.LuceneTestCase.LiveIWCFlushMode; -import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.codecs.asserting.AssertingDocValuesFormat; +import org.apache.lucene.tests.codecs.asserting.AssertingPostingsFormat; +import org.apache.lucene.tests.codecs.cheapbastard.CheapBastardCodec; +import org.apache.lucene.tests.codecs.compressing.CompressingCodec; +import org.apache.lucene.tests.codecs.mockrandom.MockRandomPostingsFormat; +import org.apache.lucene.tests.index.RandomCodec; +import org.apache.lucene.tests.search.similarities.AssertingSimilarity; +import org.apache.lucene.tests.search.similarities.RandomSimilarity; +import org.apache.lucene.tests.util.LuceneTestCase.LiveIWCFlushMode; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs; +import org.apache.lucene.util.InfoStream; +import org.apache.lucene.util.PrintStreamInfoStream; import org.junit.internal.AssumptionViolatedException; /** Setup and restore suite-level environment (fine grained junk that doesn't fit anywhere else). */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreInstanceEnv.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupAndRestoreInstanceEnv.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreInstanceEnv.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupAndRestoreInstanceEnv.java index c97a05d97d1..4dff8ce4bf8 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreInstanceEnv.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupAndRestoreInstanceEnv.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.apache.lucene.search.IndexSearcher; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupTeardownChained.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupTeardownChained.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupTeardownChained.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupTeardownChained.java index 8871bdf9ee4..ec8110bd5b2 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupTeardownChained.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleSetupTeardownChained.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.Assert; import org.junit.rules.TestRule; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleStoreClassName.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleStoreClassName.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleStoreClassName.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleStoreClassName.java index 6ed86333cc3..c6e9c56e71a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleStoreClassName.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleStoreClassName.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.rules.TestRule; import org.junit.runner.Description; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleTemporaryFilesCleanup.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleTemporaryFilesCleanup.java index 6c67efd2523..8d000f509e9 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleTemporaryFilesCleanup.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedContext; import com.carrotsearch.randomizedtesting.rules.TestRuleAdapter; @@ -33,16 +33,18 @@ import java.util.List; import java.util.Locale; import java.util.Random; import java.util.Set; -import org.apache.lucene.mockfile.DisableFsyncFS; -import org.apache.lucene.mockfile.ExtrasFS; -import org.apache.lucene.mockfile.HandleLimitFS; -import org.apache.lucene.mockfile.LeakFS; -import org.apache.lucene.mockfile.ShuffleFS; -import org.apache.lucene.mockfile.VerboseFS; -import org.apache.lucene.mockfile.WindowsFS; -import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems; -import org.apache.lucene.util.LuceneTestCase.SuppressFsync; -import org.apache.lucene.util.LuceneTestCase.SuppressTempFileChecks; +import org.apache.lucene.tests.mockfile.DisableFsyncFS; +import org.apache.lucene.tests.mockfile.ExtrasFS; +import org.apache.lucene.tests.mockfile.HandleLimitFS; +import org.apache.lucene.tests.mockfile.LeakFS; +import org.apache.lucene.tests.mockfile.ShuffleFS; +import org.apache.lucene.tests.mockfile.VerboseFS; +import org.apache.lucene.tests.mockfile.WindowsFS; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressFsync; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressTempFileChecks; +import org.apache.lucene.util.Constants; +import org.apache.lucene.util.IOUtils; /** * Checks and cleans up temporary files. diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleThreadAndTestName.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleThreadAndTestName.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestRuleThreadAndTestName.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleThreadAndTestName.java index a9aef8e7529..2c230ef8ec4 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleThreadAndTestName.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestRuleThreadAndTestName.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.rules.TestRule; import org.junit.runner.Description; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestSecurityManager.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestSecurityManager.java similarity index 93% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestSecurityManager.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestSecurityManager.java index 622572b3e05..51b53127adc 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestSecurityManager.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestSecurityManager.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.lang.StackWalker.StackFrame; import java.util.Locale; @@ -25,7 +25,8 @@ import java.util.function.Predicate; * runner itself is allowed to exit the JVM. All other security checks are handled by the default * security policy. * - *

Use this with {@code -Djava.security.manager=org.apache.lucene.util.TestSecurityManager}. + *

Use this with {@code + * -Djava.security.manager=org.apache.lucene.tests.util.TestSecurityManager}. */ public final class TestSecurityManager extends SecurityManager { @@ -41,7 +42,7 @@ public final class TestSecurityManager extends SecurityManager { /** * Creates a new TestSecurityManager. This ctor is called on JVM startup, when {@code - * -Djava.security.manager=org.apache.lucene.util.TestSecurityManager} is passed to JVM. + * -Djava.security.manager=org.apache.lucene.tests.util.TestSecurityManager} is passed to JVM. */ public TestSecurityManager() { super(); diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestUtil.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TestUtil.java index fb8a845fd03..68741d0b5ee 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestUtil.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; @@ -52,8 +52,6 @@ import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.KnnVectorsFormat; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.asserting.AssertingCodec; -import org.apache.lucene.codecs.blockterms.LuceneFixedGap; import org.apache.lucene.codecs.blocktreeords.BlockTreeOrdsPostingsFormat; import org.apache.lucene.codecs.lucene90.Lucene90Codec; import org.apache.lucene.codecs.lucene90.Lucene90DocValuesFormat; @@ -88,9 +86,6 @@ import org.apache.lucene.index.SlowCodecReaderWrapper; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TieredMergePolicy; -import org.apache.lucene.mockfile.FilterFileSystem; -import org.apache.lucene.mockfile.VirusCheckingFS; -import org.apache.lucene.mockfile.WindowsFS; import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; @@ -101,6 +96,18 @@ import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.FilterDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.NoLockFactory; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; +import org.apache.lucene.tests.codecs.blockterms.LuceneFixedGap; +import org.apache.lucene.tests.mockfile.FilterFileSystem; +import org.apache.lucene.tests.mockfile.VirusCheckingFS; +import org.apache.lucene.tests.mockfile.WindowsFS; +import org.apache.lucene.util.Attribute; +import org.apache.lucene.util.AttributeImpl; +import org.apache.lucene.util.AttributeReflector; +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.CharsRef; +import org.apache.lucene.util.IOUtils; +import org.apache.lucene.util.UnicodeUtil; import org.junit.Assert; /** General utility methods for Lucene unit tests. */ diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/ThrottledIndexOutput.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/ThrottledIndexOutput.java index 692945da20a..d24368ee5af 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/ThrottledIndexOutput.java @@ -14,11 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.IOException; import org.apache.lucene.store.DataInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.util.ThreadInterruptedException; /** Intentionally slow IndexOutput for testing. */ public class ThrottledIndexOutput extends IndexOutput { diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TimeUnits.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TimeUnits.java similarity index 96% rename from lucene/test-framework/src/java/org/apache/lucene/util/TimeUnits.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/TimeUnits.java index 43190650e0b..bedfec04f3e 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/TimeUnits.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/TimeUnits.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; /** time unit constants for use in annotations. */ public final class TimeUnits { diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/VerifyTestClassNamingConvention.java similarity index 98% rename from lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/VerifyTestClassNamingConvention.java index 00a8321c10c..4926f90a809 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/VerifyTestClassNamingConvention.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/VerifyTestClassNamingConvention.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedContext; import java.util.regex.Matcher; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/automaton/AutomatonTestUtil.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/automaton/AutomatonTestUtil.java index a27e28a9a14..a4cd40a3bd1 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/automaton/AutomatonTestUtil.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util.automaton; +package org.apache.lucene.tests.util.automaton; import java.util.ArrayList; import java.util.HashMap; @@ -24,11 +24,16 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; +import org.apache.lucene.util.automaton.Automaton; +import org.apache.lucene.util.automaton.Operations; +import org.apache.lucene.util.automaton.RegExp; +import org.apache.lucene.util.automaton.TooComplexToDeterminizeException; +import org.apache.lucene.util.automaton.Transition; /** * Utilities for testing automata. diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/util/automaton/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/automaton/package-info.java new file mode 100644 index 00000000000..44a0db31c11 --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/automaton/package-info.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing automata. The primary class is {@link + * org.apache.lucene.tests.util.automaton.AutomatonTestUtil}, which can generate random automata, + * has simplified implementations for testing, etc. + */ +package org.apache.lucene.tests.util.automaton; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/fst/FSTTester.java similarity index 97% rename from lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java rename to lucene/test-framework/src/java/org/apache/lucene/tests/util/fst/FSTTester.java index d5d26844653..e2d8bf0d83c 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/fst/FSTTester.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util.fst; +package org.apache.lucene.tests.util.fst; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -37,23 +37,27 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.UnicodeUtil; +import org.apache.lucene.util.fst.FST; +import org.apache.lucene.util.fst.FSTCompiler; +import org.apache.lucene.util.fst.IntsRefFSTEnum; +import org.apache.lucene.util.fst.Outputs; +import org.apache.lucene.util.fst.Util; /** Helper class to test FSTs. */ public class FSTTester { - - final Random random; - final List> pairs; - final int inputMode; - final Outputs outputs; - final Directory dir; - long nodeCount; - long arcCount; + public final Random random; + public final List> pairs; + public final int inputMode; + public final Outputs outputs; + public final Directory dir; + public long nodeCount; + public long arcCount; public FSTTester( Random random, Directory dir, int inputMode, List> pairs, Outputs outputs) { @@ -109,7 +113,7 @@ public class FSTTester { return term; } - static String simpleRandomString(Random r) { + public static String simpleRandomString(Random r) { final int end = r.nextInt(10); if (end == 0) { // allow 0 length @@ -126,7 +130,7 @@ public class FSTTester { return toIntsRef(s, inputMode, new IntsRefBuilder()); } - static IntsRef toIntsRef(String s, int inputMode, IntsRefBuilder ir) { + public static IntsRef toIntsRef(String s, int inputMode, IntsRefBuilder ir) { if (inputMode == 0) { // utf8 return toIntsRef(new BytesRef(s), ir); @@ -263,7 +267,8 @@ public class FSTTester { return output; } - FST doTest(int prune1, int prune2, boolean allowRandomSuffixSharing) throws IOException { + public FST doTest(int prune1, int prune2, boolean allowRandomSuffixSharing) + throws IOException { if (LuceneTestCase.VERBOSE) { System.out.println("\nTEST: prune1=" + prune1 + " prune2=" + prune2); } diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/util/fst/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/fst/package-info.java new file mode 100644 index 00000000000..bd994cc1cfd --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/fst/package-info.java @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Support for FST testing. */ +package org.apache.lucene.tests.util.fst; diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/util/package-info.java b/lucene/test-framework/src/java/org/apache/lucene/tests/util/package-info.java new file mode 100644 index 00000000000..a9405a4afbc --- /dev/null +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/util/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * General test support. The primary class is {@link org.apache.lucene.tests.util.LuceneTestCase}, + * which extends JUnit with additional functionality. + */ +package org.apache.lucene.tests.util; diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/automaton/package.html b/lucene/test-framework/src/java/org/apache/lucene/util/automaton/package.html deleted file mode 100644 index e6f69909fc6..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/util/automaton/package.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - -Support for testing automata. The primary class is {@link org.apache.lucene.util.automaton.AutomatonTestUtil}, -which can generate random automata, has simplified implementations for testing, etc. - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/fst/package.html b/lucene/test-framework/src/java/org/apache/lucene/util/fst/package.html deleted file mode 100644 index 8e882fc88ec..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/util/fst/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -Support for FST testing. - - diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/package.html b/lucene/test-framework/src/java/org/apache/lucene/util/package.html deleted file mode 100644 index 7abad7cfce5..00000000000 --- a/lucene/test-framework/src/java/org/apache/lucene/util/package.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - -General test support. The primary class is {@link org.apache.lucene.util.LuceneTestCase}, -which extends JUnit with additional functionality. - - diff --git a/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec b/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec index 618b6070c53..cdc3aeca2a9 100644 --- a/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec +++ b/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.Codec @@ -13,11 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -org.apache.lucene.codecs.asserting.AssertingCodec -org.apache.lucene.codecs.cheapbastard.CheapBastardCodec -org.apache.lucene.codecs.compressing.DeflateWithPresetCompressingCodec -org.apache.lucene.codecs.compressing.FastCompressingCodec -org.apache.lucene.codecs.compressing.FastDecompressionCompressingCodec -org.apache.lucene.codecs.compressing.HighCompressionCompressingCodec -org.apache.lucene.codecs.compressing.LZ4WithPresetCompressingCodec -org.apache.lucene.codecs.compressing.dummy.DummyCompressingCodec +org.apache.lucene.tests.codecs.asserting.AssertingCodec +org.apache.lucene.tests.codecs.cheapbastard.CheapBastardCodec +org.apache.lucene.tests.codecs.compressing.DeflateWithPresetCompressingCodec +org.apache.lucene.tests.codecs.compressing.FastCompressingCodec +org.apache.lucene.tests.codecs.compressing.FastDecompressionCompressingCodec +org.apache.lucene.tests.codecs.compressing.HighCompressionCompressingCodec +org.apache.lucene.tests.codecs.compressing.LZ4WithPresetCompressingCodec +org.apache.lucene.tests.codecs.compressing.dummy.DummyCompressingCodec diff --git a/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat b/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat index d1798334486..de093fb221d 100644 --- a/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat +++ b/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.DocValuesFormat @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -org.apache.lucene.codecs.asserting.AssertingDocValuesFormat +org.apache.lucene.tests.codecs.asserting.AssertingDocValuesFormat diff --git a/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.KnnVectorsFormat b/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.KnnVectorsFormat index 9526adff071..11aa4fb46c1 100644 --- a/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.KnnVectorsFormat +++ b/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.KnnVectorsFormat @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -org.apache.lucene.codecs.asserting.AssertingKnnVectorsFormat \ No newline at end of file +org.apache.lucene.tests.codecs.asserting.AssertingKnnVectorsFormat \ No newline at end of file diff --git a/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.PostingsFormat b/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.PostingsFormat index 1d6a3fc16d3..463f77ae72f 100644 --- a/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.PostingsFormat +++ b/lucene/test-framework/src/resources/META-INF/services/org.apache.lucene.codecs.PostingsFormat @@ -13,12 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -org.apache.lucene.codecs.mockrandom.MockRandomPostingsFormat -org.apache.lucene.codecs.ramonly.RAMOnlyPostingsFormat -org.apache.lucene.codecs.blockterms.LuceneFixedGap -org.apache.lucene.codecs.blockterms.LuceneVarGapFixedInterval -org.apache.lucene.codecs.blockterms.LuceneVarGapDocFreqInterval -org.apache.lucene.codecs.bloom.TestBloomFilteredLucenePostings -org.apache.lucene.codecs.asserting.AssertingPostingsFormat -org.apache.lucene.codecs.uniformsplit.UniformSplitRot13PostingsFormat -org.apache.lucene.codecs.uniformsplit.sharedterms.STUniformSplitRot13PostingsFormat \ No newline at end of file +org.apache.lucene.tests.codecs.mockrandom.MockRandomPostingsFormat +org.apache.lucene.tests.codecs.ramonly.RAMOnlyPostingsFormat +org.apache.lucene.tests.codecs.blockterms.LuceneFixedGap +org.apache.lucene.tests.codecs.blockterms.LuceneVarGapFixedInterval +org.apache.lucene.tests.codecs.blockterms.LuceneVarGapDocFreqInterval +org.apache.lucene.tests.codecs.bloom.TestBloomFilteredLucenePostings +org.apache.lucene.tests.codecs.asserting.AssertingPostingsFormat +org.apache.lucene.tests.codecs.uniformsplit.UniformSplitRot13PostingsFormat +org.apache.lucene.tests.codecs.uniformsplit.sharedterms.STUniformSplitRot13PostingsFormat \ No newline at end of file diff --git a/lucene/test-framework/src/resources/org/apache/lucene/geo/lucene-9251.wkt.gz b/lucene/test-framework/src/resources/org/apache/lucene/tests/geo/lucene-9251.wkt.gz similarity index 100% rename from lucene/test-framework/src/resources/org/apache/lucene/geo/lucene-9251.wkt.gz rename to lucene/test-framework/src/resources/org/apache/lucene/tests/geo/lucene-9251.wkt.gz diff --git a/lucene/test-framework/src/resources/org/apache/lucene/geo/lucene-9417.geojson.gz b/lucene/test-framework/src/resources/org/apache/lucene/tests/geo/lucene-9417.geojson.gz similarity index 100% rename from lucene/test-framework/src/resources/org/apache/lucene/geo/lucene-9417.geojson.gz rename to lucene/test-framework/src/resources/org/apache/lucene/tests/geo/lucene-9417.geojson.gz diff --git a/lucene/test-framework/src/resources/org/apache/lucene/geo/lucene-9538-invalid.geojson.gz b/lucene/test-framework/src/resources/org/apache/lucene/tests/geo/lucene-9538-invalid.geojson.gz similarity index 100% rename from lucene/test-framework/src/resources/org/apache/lucene/geo/lucene-9538-invalid.geojson.gz rename to lucene/test-framework/src/resources/org/apache/lucene/tests/geo/lucene-9538-invalid.geojson.gz diff --git a/lucene/test-framework/src/resources/org/apache/lucene/util/europarl.lines.txt.gz b/lucene/test-framework/src/resources/org/apache/lucene/tests/util/europarl.lines.txt.gz similarity index 100% rename from lucene/test-framework/src/resources/org/apache/lucene/util/europarl.lines.txt.gz rename to lucene/test-framework/src/resources/org/apache/lucene/tests/util/europarl.lines.txt.gz diff --git a/lucene/test-framework/src/resources/org/apache/lucene/util/europarl.lines.txt.seek b/lucene/test-framework/src/resources/org/apache/lucene/tests/util/europarl.lines.txt.seek similarity index 100% rename from lucene/test-framework/src/resources/org/apache/lucene/util/europarl.lines.txt.seek rename to lucene/test-framework/src/resources/org/apache/lucene/tests/util/europarl.lines.txt.seek diff --git a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestLookaheadTokenFilter.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestLookaheadTokenFilter.java similarity index 95% rename from lucene/test-framework/src/test/org/apache/lucene/analysis/TestLookaheadTokenFilter.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestLookaheadTokenFilter.java index aa3d735e7e9..5003ac8a0bb 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestLookaheadTokenFilter.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestLookaheadTokenFilter.java @@ -14,10 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.Random; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.Tokenizer; public class TestLookaheadTokenFilter extends BaseTokenStreamTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockAnalyzer.java similarity index 96% rename from lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockAnalyzer.java index b8eb3738460..792d58766a7 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockAnalyzer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import static org.apache.lucene.util.automaton.Operations.DEFAULT_DETERMINIZE_WORK_LIMIT; @@ -22,6 +22,11 @@ import java.io.Reader; import java.io.StringReader; import java.util.Arrays; import java.util.Random; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.AnalyzerWrapper; +import org.apache.lucene.analysis.DelegatingAnalyzerWrapper; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; @@ -29,14 +34,14 @@ import org.apache.lucene.index.Fields; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.PostingsEnum; -import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.util.TestUtil; +import org.apache.lucene.tests.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; -import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; diff --git a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockCharFilter.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockCharFilter.java similarity index 93% rename from lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockCharFilter.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockCharFilter.java index 2b321e4ef89..f26eb5bdbf8 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockCharFilter.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockCharFilter.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.io.Reader; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.Tokenizer; public class TestMockCharFilter extends BaseTokenStreamTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockSynonymFilter.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockSynonymFilter.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockSynonymFilter.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockSynonymFilter.java index e0d4282883e..8b62e613551 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestMockSynonymFilter.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestMockSynonymFilter.java @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; +import org.apache.lucene.analysis.Analyzer; /** test the mock synonym filter */ public class TestMockSynonymFilter extends BaseTokenStreamTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestPosition.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestPosition.java similarity index 96% rename from lucene/test-framework/src/test/org/apache/lucene/analysis/TestPosition.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestPosition.java index 7726044040b..a0bbd124094 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestPosition.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestPosition.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import org.junit.Ignore; diff --git a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestToken.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestToken.java similarity index 96% rename from lucene/test-framework/src/test/org/apache/lucene/analysis/TestToken.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestToken.java index 6dd2508cf02..782f7545024 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/analysis/TestToken.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestToken.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.StringReader; import java.util.HashMap; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.FlagsAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; @@ -27,12 +29,12 @@ import org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute; import org.apache.lucene.analysis.tokenattributes.TermFrequencyAttribute; import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.Attribute; import org.apache.lucene.util.AttributeImpl; import org.apache.lucene.util.AttributeReflector; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.TestUtil; public class TestToken extends LuceneTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/analysis/TrivialLookaheadFilter.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TrivialLookaheadFilter.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/analysis/TrivialLookaheadFilter.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TrivialLookaheadFilter.java index d4f57107886..4bb031c303d 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/analysis/TrivialLookaheadFilter.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TrivialLookaheadFilter.java @@ -14,11 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.analysis; +package org.apache.lucene.tests.analysis; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingDocValuesFormat.java b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingDocValuesFormat.java similarity index 90% rename from lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingDocValuesFormat.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingDocValuesFormat.java index d63aeba1c46..423ead245c1 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingDocValuesFormat.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingDocValuesFormat.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseDocValuesFormatTestCase; +import org.apache.lucene.tests.index.BaseDocValuesFormatTestCase; /** Test AssertingDocValuesFormat directly */ public class TestAssertingDocValuesFormat extends BaseDocValuesFormatTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingNormsFormat.java b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingNormsFormat.java similarity index 90% rename from lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingNormsFormat.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingNormsFormat.java index 943f1f59411..85039b001a1 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingNormsFormat.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingNormsFormat.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseNormsFormatTestCase; +import org.apache.lucene.tests.index.BaseNormsFormatTestCase; /** Test AssertingNormsFormat directly */ public class TestAssertingNormsFormat extends BaseNormsFormatTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingPointsFormat.java b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingPointsFormat.java similarity index 90% rename from lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingPointsFormat.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingPointsFormat.java index cc05e3d38b6..e25747c986c 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingPointsFormat.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingPointsFormat.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePointsFormatTestCase; +import org.apache.lucene.tests.index.BasePointsFormatTestCase; /** Test AssertingPointsFormat directly */ public class TestAssertingPointsFormat extends BasePointsFormatTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingPostingsFormat.java b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingPostingsFormat.java similarity index 91% rename from lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingPostingsFormat.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingPostingsFormat.java index 6b1798d13af..2509cc2379b 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingPostingsFormat.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingPostingsFormat.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BasePostingsFormatTestCase; +import org.apache.lucene.tests.index.BasePostingsFormatTestCase; /** Test AssertingPostingsFormat directly */ public class TestAssertingPostingsFormat extends BasePostingsFormatTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingStoredFieldsFormat.java b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingStoredFieldsFormat.java similarity index 90% rename from lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingStoredFieldsFormat.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingStoredFieldsFormat.java index c41e7fca5f9..7f2a8c53a7e 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingStoredFieldsFormat.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingStoredFieldsFormat.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; +import org.apache.lucene.tests.index.BaseStoredFieldsFormatTestCase; /** Test AssertingStoredFieldsFormat directly */ public class TestAssertingStoredFieldsFormat extends BaseStoredFieldsFormatTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingTermVectorsFormat.java b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingTermVectorsFormat.java similarity index 91% rename from lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingTermVectorsFormat.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingTermVectorsFormat.java index 0b5debab9e0..7a1c187cc97 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/codecs/asserting/TestAssertingTermVectorsFormat.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/codecs/asserting/TestAssertingTermVectorsFormat.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.codecs.asserting; +package org.apache.lucene.tests.codecs.asserting; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.index.BaseTermVectorsFormatTestCase; +import org.apache.lucene.tests.index.BaseTermVectorsFormatTestCase; /** Test AssertingTermVectorsFormat directly */ public class TestAssertingTermVectorsFormat extends BaseTermVectorsFormatTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/index/TestAssertingLeafReader.java b/lucene/test-framework/src/test/org/apache/lucene/tests/index/TestAssertingLeafReader.java similarity index 85% rename from lucene/test-framework/src/test/org/apache/lucene/index/TestAssertingLeafReader.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/index/TestAssertingLeafReader.java index 031351d32f2..676030ed47d 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/index/TestAssertingLeafReader.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/index/TestAssertingLeafReader.java @@ -14,13 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.NoMergePolicy; +import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; public class TestAssertingLeafReader extends LuceneTestCase { public void testAssertBits() throws Exception { diff --git a/lucene/test-framework/src/test/org/apache/lucene/index/TestForceMergePolicy.java b/lucene/test-framework/src/test/org/apache/lucene/tests/index/TestForceMergePolicy.java old mode 100755 new mode 100644 similarity index 85% rename from lucene/test-framework/src/test/org/apache/lucene/index/TestForceMergePolicy.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/index/TestForceMergePolicy.java index 180d23e01e3..611c03c68b9 --- a/lucene/test-framework/src/test/org/apache/lucene/index/TestForceMergePolicy.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/index/TestForceMergePolicy.java @@ -14,9 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.index; +package org.apache.lucene.tests.index; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.index.MergePolicy; +import org.apache.lucene.index.SegmentInfos; +import org.apache.lucene.tests.util.LuceneTestCase; public class TestForceMergePolicy extends LuceneTestCase { diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestDisableFsyncFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestDisableFsyncFS.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestDisableFsyncFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestDisableFsyncFS.java index 49c6ebe4744..4c925350ae6 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestDisableFsyncFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestDisableFsyncFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.net.URI; import java.nio.ByteBuffer; diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestExtrasFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestExtrasFS.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestExtrasFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestExtrasFS.java index ab7e75ca899..4d65d61d727 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestExtrasFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestExtrasFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.net.URI; import java.nio.file.DirectoryStream; diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestHandleLimitFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestHandleLimitFS.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestHandleLimitFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestHandleLimitFS.java index 1c0434aff67..85da76229a9 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestHandleLimitFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestHandleLimitFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.Closeable; import java.io.IOException; diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestHandleTrackingFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestHandleTrackingFS.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestHandleTrackingFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestHandleTrackingFS.java index 8bf78d79aed..54d12ecbe19 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestHandleTrackingFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestHandleTrackingFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.io.InputStream; diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestLeakFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestLeakFS.java similarity index 99% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestLeakFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestLeakFS.java index 30438890459..44bb91a012a 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestLeakFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestLeakFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.io.InputStream; diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestShuffleFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestShuffleFS.java similarity index 99% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestShuffleFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestShuffleFS.java index 6fa80c9a640..28ed882d12e 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestShuffleFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestShuffleFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.net.URI; diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVerboseFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVerboseFS.java similarity index 99% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVerboseFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVerboseFS.java index 2278c31182b..a335011b920 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVerboseFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVerboseFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.io.OutputStream; diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVirusCheckingFS.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVirusCheckingFS.java index 0f9dff7cf74..3dea0de94d6 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestVirusCheckingFS.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.IOException; import java.io.OutputStream; diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestWindowsFS.java similarity index 99% rename from lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestWindowsFS.java index a8f8e025cd7..6fb0285515a 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/mockfile/TestWindowsFS.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.mockfile; +package org.apache.lucene.tests.mockfile; import java.io.FileNotFoundException; import java.io.IOException; diff --git a/lucene/test-framework/src/test/org/apache/lucene/search/TestBaseExplanationTestCase.java b/lucene/test-framework/src/test/org/apache/lucene/tests/search/TestBaseExplanationTestCase.java similarity index 92% rename from lucene/test-framework/src/test/org/apache/lucene/search/TestBaseExplanationTestCase.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/search/TestBaseExplanationTestCase.java index f69e22eef52..1b37ed53130 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/search/TestBaseExplanationTestCase.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/search/TestBaseExplanationTestCase.java @@ -14,11 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.search; +package org.apache.lucene.tests.search; import java.io.IOException; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.Term; +import org.apache.lucene.search.BulkScorer; +import org.apache.lucene.search.Explanation; +import org.apache.lucene.search.FilterWeight; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.Weight; /** * Tests that the {@link BaseExplanationTestCase} helper code, as well as {@link diff --git a/lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java b/lucene/test-framework/src/test/org/apache/lucene/tests/store/TestMockDirectoryWrapper.java similarity index 94% rename from lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/store/TestMockDirectoryWrapper.java index b8607b3a159..f4a7d9d0ee8 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/store/TestMockDirectoryWrapper.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.store; +package org.apache.lucene.tests.store; import java.io.EOFException; import java.io.FileNotFoundException; @@ -22,7 +22,14 @@ import java.io.IOException; import java.nio.file.NoSuchFileException; import java.nio.file.Path; import org.apache.lucene.document.Document; -import org.apache.lucene.index.RandomIndexWriter; +import org.apache.lucene.store.ByteArrayDataInput; +import org.apache.lucene.store.ByteBuffersDirectory; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.FilterDirectory; +import org.apache.lucene.store.IOContext; +import org.apache.lucene.store.IndexInput; +import org.apache.lucene.store.IndexOutput; +import org.apache.lucene.tests.index.RandomIndexWriter; // See: https://issues.apache.org/jira/browse/SOLR-12028 Tests cannot remove files on Windows // machines occasionally diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/SorePoint.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/SorePoint.java similarity index 96% rename from lucene/test-framework/src/test/org/apache/lucene/util/SorePoint.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/SorePoint.java index 8be80295ea6..4b4b4fedc2f 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/SorePoint.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/SorePoint.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; /** A pointcut-like definition where we should trigger an assumption or error. */ public enum SorePoint { diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/SoreType.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/SoreType.java similarity index 95% rename from lucene/test-framework/src/test/org/apache/lucene/util/SoreType.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/SoreType.java index 4bb6fb8886a..e91ca931cd3 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/SoreType.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/SoreType.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; public enum SoreType { ASSUMPTION, diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestBeforeAfterOverrides.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestBeforeAfterOverrides.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestBeforeAfterOverrides.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestBeforeAfterOverrides.java index 5ccf6db32c1..89c09d0f736 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestBeforeAfterOverrides.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestBeforeAfterOverrides.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.After; import org.junit.Assert; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestCodecReported.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestCodecReported.java similarity index 96% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestCodecReported.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestCodecReported.java index 910d939c62e..52c2e2ecb32 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestCodecReported.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestCodecReported.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.apache.lucene.codecs.Codec; import org.junit.Assert; @@ -32,7 +32,7 @@ public class TestCodecReported extends WithNestedTests { public void testDummy() { codecName = Codec.getDefault().getName(); - fail(); + Assert.fail(); } } diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestExceptionInBeforeClassHooks.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestExceptionInBeforeClassHooks.java similarity index 99% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestExceptionInBeforeClassHooks.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestExceptionInBeforeClassHooks.java index 470262a098c..7a31b41f762 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestExceptionInBeforeClassHooks.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestExceptionInBeforeClassHooks.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.util.*; import java.util.regex.Matcher; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestExpectThrows.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestExpectThrows.java similarity index 99% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestExpectThrows.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestExpectThrows.java index 6b4a597e01d..d6f646c098a 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestExpectThrows.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestExpectThrows.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestFailIfDirectoryNotClosed.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestFailIfDirectoryNotClosed.java similarity index 94% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestFailIfDirectoryNotClosed.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestFailIfDirectoryNotClosed.java index a5ec8285e3d..f622d326c3f 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestFailIfDirectoryNotClosed.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestFailIfDirectoryNotClosed.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedTest; import org.apache.lucene.store.Directory; @@ -30,7 +30,7 @@ public class TestFailIfDirectoryNotClosed extends WithNestedTests { public static class Nested1 extends WithNestedTests.AbstractNestedTest { public void testDummy() throws Exception { - Directory dir = newDirectory(); + Directory dir = LuceneTestCase.newDirectory(); System.out.println(dir.toString()); } } diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestFailIfUnreferencedFiles.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestFailIfUnreferencedFiles.java similarity index 94% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestFailIfUnreferencedFiles.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestFailIfUnreferencedFiles.java index c28d3b6c5af..403ec45637f 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestFailIfUnreferencedFiles.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestFailIfUnreferencedFiles.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedTest; import java.util.Collections; @@ -23,7 +23,7 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.tests.store.MockDirectoryWrapper; import org.junit.Assert; import org.junit.Test; import org.junit.runner.JUnitCore; @@ -38,7 +38,7 @@ public class TestFailIfUnreferencedFiles extends WithNestedTests { public static class Nested1 extends WithNestedTests.AbstractNestedTest { public void testDummy() throws Exception { - MockDirectoryWrapper dir = newMockDirectory(); + MockDirectoryWrapper dir = LuceneTestCase.newMockDirectory(); dir.setAssertNoUnrefencedFilesOnClose(true); IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(null)); iw.addDocument(new Document()); diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestGroupFiltering.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestGroupFiltering.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestGroupFiltering.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestGroupFiltering.java index 76f1a06cbe6..da7f0179570 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestGroupFiltering.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestGroupFiltering.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.annotations.TestGroup; import java.lang.annotation.Documented; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestJUnitRuleOrder.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestJUnitRuleOrder.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestJUnitRuleOrder.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestJUnitRuleOrder.java index 686b7c84999..490f4b7504e 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestJUnitRuleOrder.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestJUnitRuleOrder.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.util.Arrays; import java.util.Stack; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestJvmInfo.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestJvmInfo.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestJvmInfo.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestJvmInfo.java index c580eed003a..aba7cc0b368 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestJvmInfo.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestJvmInfo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedTest; import java.util.Locale; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestMaxFailuresRule.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestMaxFailuresRule.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestMaxFailuresRule.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestMaxFailuresRule.java index 4a5ba93be04..2556648e5a9 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestMaxFailuresRule.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestMaxFailuresRule.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.annotations.Repeat; import com.carrotsearch.randomizedtesting.annotations.ThreadLeakAction; @@ -48,13 +48,13 @@ public class TestMaxFailuresRule extends WithNestedTests { @Repeat(iterations = TOTAL_ITERS) public void testFailSometimes() { numIters++; - boolean fail = random().nextInt(5) == 0; + boolean fail = LuceneTestCase.random().nextInt(5) == 0; if (fail) numFails++; // some seeds are really lucky ... so cheat. if (numFails < DESIRED_FAILURES && DESIRED_FAILURES <= TOTAL_ITERS - numIters) { fail = true; } - assertFalse(fail); + Assert.assertFalse(fail); } } diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestPleaseFail.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestPleaseFail.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestPleaseFail.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestPleaseFail.java index 99d3c375fe6..f38041892ed 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestPleaseFail.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestPleaseFail.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.Assert; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestRamUsageTesterOnWildAnimals.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestRamUsageTesterOnWildAnimals.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestRamUsageTesterOnWildAnimals.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestRamUsageTesterOnWildAnimals.java index 0a6096da280..410907ce4be 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestRamUsageTesterOnWildAnimals.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestRamUsageTesterOnWildAnimals.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.Assert; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestReproduceMessage.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestReproduceMessage.java similarity index 99% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestReproduceMessage.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestReproduceMessage.java index 21f66962a40..8f3dc0d96c6 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestReproduceMessage.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestReproduceMessage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.hamcrest.Matchers; import org.junit.After; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestReproduceMessageWithRepeated.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestReproduceMessageWithRepeated.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestReproduceMessageWithRepeated.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestReproduceMessageWithRepeated.java index bfe4e6aadb3..93fb3b3fae6 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestReproduceMessageWithRepeated.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestReproduceMessageWithRepeated.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.annotations.Repeat; import org.junit.Test; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestRunWithRestrictedPermissions.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestRunWithRestrictedPermissions.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestRunWithRestrictedPermissions.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestRunWithRestrictedPermissions.java index 0e41b172cf0..33e1fae621f 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestRunWithRestrictedPermissions.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestRunWithRestrictedPermissions.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import java.io.IOException; import java.nio.file.Files; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestSeedFromUncaught.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSeedFromUncaught.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestSeedFromUncaught.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSeedFromUncaught.java index 08fba0c4c1f..11f5fae32a7 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestSeedFromUncaught.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSeedFromUncaught.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.Assert; import org.junit.Test; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestSetupTeardownChaining.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSetupTeardownChaining.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestSetupTeardownChaining.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSetupTeardownChaining.java index bc6803d84c2..c32bcede32b 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestSetupTeardownChaining.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSetupTeardownChaining.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import org.junit.Assert; import org.junit.Test; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestSysoutsLimits.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSysoutsLimits.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestSysoutsLimits.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSysoutsLimits.java index ddeb3e80766..eb23321be05 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestSysoutsLimits.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestSysoutsLimits.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedTest; import java.util.stream.Collectors; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/TestWorstCaseTestBehavior.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestWorstCaseTestBehavior.java similarity index 98% rename from lucene/test-framework/src/test/org/apache/lucene/util/TestWorstCaseTestBehavior.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/TestWorstCaseTestBehavior.java index 67141afb8cd..e8b4f8eab33 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/TestWorstCaseTestBehavior.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/TestWorstCaseTestBehavior.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.carrotsearch.randomizedtesting.annotations.Timeout; diff --git a/lucene/test-framework/src/test/org/apache/lucene/util/WithNestedTests.java b/lucene/test-framework/src/test/org/apache/lucene/tests/util/WithNestedTests.java similarity index 97% rename from lucene/test-framework/src/test/org/apache/lucene/util/WithNestedTests.java rename to lucene/test-framework/src/test/org/apache/lucene/tests/util/WithNestedTests.java index 567b4e3d7de..d50b9a63b3f 100644 --- a/lucene/test-framework/src/test/org/apache/lucene/util/WithNestedTests.java +++ b/lucene/test-framework/src/test/org/apache/lucene/tests/util/WithNestedTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.lucene.util; +package org.apache.lucene.tests.util; import com.carrotsearch.randomizedtesting.RandomizedRunner; import com.carrotsearch.randomizedtesting.RandomizedTest; @@ -25,7 +25,8 @@ import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.List; -import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks; +import org.apache.lucene.util.IOUtils; import org.junit.After; import org.junit.Assert; import org.junit.Assume;