From df2172c2796c00b131385a8bf7501c8ab16be4a5 Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Tue, 26 Nov 2024 18:00:23 -0700 Subject: [PATCH 1/4] Rename BeforeClass to OneTimeSetUp, #1016 --- .../Index/BasePostingsFormatTestCase.cs | 76 +++++++++---------- .../Search/SearchEquivalenceTestBase.cs | 4 +- .../ConfigurationSettingTestCase.cs | 4 +- .../Util/LuceneTestFrameworkInitializer.cs | 2 +- .../Util/LuceneTestCase.cs | 10 +-- .../Analysis/Core/TestRandomChains.cs | 18 ++--- .../Analysis/Hunspell/TestAlternateCasing.cs | 4 +- .../Analysis/Hunspell/TestCaseInsensitive.cs | 6 +- .../Analysis/Hunspell/TestCaseSensitive.cs | 4 +- .../Analysis/Hunspell/TestCircumfix.cs | 6 +- .../Analysis/Hunspell/TestComplexPrefix.cs | 6 +- .../Analysis/Hunspell/TestCondition.cs | 6 +- .../Analysis/Hunspell/TestCondition2.cs | 4 +- .../Analysis/Hunspell/TestConditionGH418.cs | 4 +- .../Analysis/Hunspell/TestConv.cs | 6 +- .../Analysis/Hunspell/TestDependencies.cs | 7 +- .../Analysis/Hunspell/TestDoubleEscape.cs | 4 +- .../Analysis/Hunspell/TestEscaped.cs | 7 +- .../Analysis/Hunspell/TestFlagLong.cs | 7 +- .../Analysis/Hunspell/TestFlagNum.cs | 7 +- .../Analysis/Hunspell/TestFullStrip.cs | 4 +- .../Analysis/Hunspell/TestHomonyms.cs | 8 +- .../Hunspell/TestHunspellStemFilter.cs | 6 +- .../Analysis/Hunspell/TestIgnore.cs | 8 +- .../Analysis/Hunspell/TestKeepCase.cs | 4 +- .../Analysis/Hunspell/TestMorph.cs | 8 +- .../Analysis/Hunspell/TestMorphAlias.cs | 4 +- .../Analysis/Hunspell/TestMorphData.cs | 4 +- .../Analysis/Hunspell/TestNeedAffix.cs | 4 +- .../Analysis/Hunspell/TestOnlyInCompound.cs | 4 +- .../Hunspell/TestOptionalCondition.cs | 7 +- .../Analysis/Hunspell/TestSpaces.cs | 4 +- .../Analysis/Hunspell/TestStemmer.cs | 10 ++- .../Hunspell/TestStrangeOvergeneration.cs | 4 +- .../Analysis/Hunspell/TestTwoFold.cs | 8 +- .../Analysis/Hunspell/TestTwoSuffixes.cs | 8 +- .../Analysis/Hunspell/TestZeroAffix.cs | 4 +- .../Analysis/Hunspell/TestZeroAffix2.cs | 4 +- .../TestOpenNLPSentenceBreakIterator.cs | 4 +- .../BenchmarkTestCase.cs | 6 +- .../ByTask/Tasks/AddIndexesTaskTest.cs | 4 +- .../ByTask/TestPerfTasksLogic.cs | 18 ++--- .../Taxonomy/TestTaxonomyFacetAssociations.cs | 12 +-- .../Taxonomy/TestTaxonomyFacetCounts2.cs | 6 +- .../TestDrillDownQuery.cs | 10 +-- .../Document/TestLazyDocument.cs | 4 +- .../Index/Sorter/IndexSortingTest.cs | 4 +- .../Index/Sorter/SorterTestBase.cs | 4 +- .../Index/Sorter/SortingAtomicReaderTest.cs | 4 +- .../Misc/TestHighFreqTerms.cs | 8 +- .../Precedence/TestPrecedenceQueryParser.cs | 4 +- .../Standard/TestNumericQueryParser.cs | 8 +- .../Flexible/Standard/TestQPHelper.cs | 10 +-- .../TestQueryParserMessagesOverridden.cs | 4 +- .../Util/QueryParserTestBase.cs | 12 +-- .../Xml/TestParser.cs | 4 +- .../TestSortedSetSortFieldSelectors.cs | 4 +- .../TestConfigurationSettings.cs | 6 +- .../Configuration/TestSystemProperties.cs | 4 +- .../TestLucene3xStoredFieldsFormat.cs | 6 +- .../Codecs/Lucene3x/TestSurrogates.cs | 4 +- .../Lucene3x/TestTermInfosReaderIndex.cs | 4 +- .../Lucene40/TestLucene40DocValuesFormat.cs | 4 +- .../Lucene40/TestLucene40PostingsFormat.cs | 4 +- .../Lucene40/TestLucene40PostingsReader.cs | 4 +- .../TestLucene40StoredFieldsFormat.cs | 4 +- .../Lucene40/TestLucene40TermVectorsFormat.cs | 4 +- .../Codecs/Lucene40/TestReuseDocsEnum.cs | 4 +- .../TestLucene41StoredFieldsFormat.cs | 4 +- .../Lucene42/TestLucene42DocValuesFormat.cs | 4 +- src/Lucene.Net.Tests/Index/Test2BDocs.cs | 4 +- .../Index/TestBackwardsCompatibility.cs | 4 +- .../Index/TestBackwardsCompatibility3x.cs | 4 +- src/Lucene.Net.Tests/Index/TestCodecs.cs | 4 +- .../Index/TestFieldsReader.cs | 4 +- .../Index/TestFlushByRamOrCountsPolicy.cs | 4 +- src/Lucene.Net.Tests/Index/TestIndexInput.cs | 14 ++-- .../Search/BaseTestRangeFilter.cs | 4 +- .../Search/Payloads/TestPayloadNearQuery.cs | 4 +- .../Search/Payloads/TestPayloadTermQuery.cs | 4 +- .../Search/Spans/TestBasics.cs | 4 +- .../Search/Spans/TestFieldMaskingSpanQuery.cs | 4 +- src/Lucene.Net.Tests/Search/TestBoolean2.cs | 4 +- .../Search/TestBooleanMinShouldMatch.cs | 4 +- src/Lucene.Net.Tests/Search/TestDateFilter.cs | 4 +- .../Search/TestExplanations.cs | 4 +- src/Lucene.Net.Tests/Search/TestFieldCache.cs | 4 +- .../Search/TestMinShouldMatch2.cs | 4 +- .../Search/TestMultiTermConstantScore.cs | 6 +- .../Search/TestMultiTermQueryRewrites.cs | 4 +- .../Search/TestNGramPhraseQuery.cs | 6 +- .../Search/TestNumericRangeQuery32.cs | 4 +- .../Search/TestNumericRangeQuery64.cs | 4 +- .../Search/TestPhraseQuery.cs | 4 +- .../Search/TestPrefixInBooleanQuery.cs | 6 +- .../Search/TestSubScorerFreqs.cs | 4 +- .../Search/TestTermVectors.cs | 6 +- .../Util/TestIndexableBinaryStringTools.cs | 4 +- .../ConfigurationSettingsTest.cs | 6 +- .../Lucene.Net.Tests.Cli/InstallationTest.cs | 4 +- 100 files changed, 313 insertions(+), 308 deletions(-) diff --git a/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs index 80c51f61ac..1b85f55f3e 100644 --- a/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs +++ b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs @@ -348,9 +348,9 @@ private static SeedPostings GetSeedPostings(string term, long seed, bool withLiv } [NUnit.Framework.OneTimeSetUp] - public override void BeforeClass() // Renamed from CreatePostings to ensure the base class setup is called before this one + public override void OneTimeSetUp() // Renamed from CreatePostings to ensure the base class setup is called before this one { - base.BeforeClass(); + base.OneTimeSetUp(); totalPostings = 0; totalPayloadBytes = 0; @@ -375,7 +375,7 @@ public override void BeforeClass() // Renamed from CreatePostings to ensure the continue; } - fieldInfoArray[fieldUpto] = new FieldInfo(field, true, fieldUpto, false, false, true, + fieldInfoArray[fieldUpto] = new FieldInfo(field, true, fieldUpto, false, false, true, IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS, DocValuesType.NONE, DocValuesType.NUMERIC, null); fieldUpto++; @@ -653,18 +653,18 @@ private class ThreadState public DocsAndPositionsEnum ReuseDocsAndPositionsEnum { get; set; } } - private void VerifyEnum(ThreadState threadState, - string field, - BytesRef term, + private void VerifyEnum(ThreadState threadState, + string field, + BytesRef term, TermsEnum termsEnum, // Maximum options (docs/freqs/positions/offsets) to test: - IndexOptions maxTestOptions, - - IndexOptions maxIndexOptions, - ISet