From a3b9f0c91eb20eab46a275a9da775b80f90dbf08 Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Wed, 27 Nov 2024 08:29:13 -0700 Subject: [PATCH] Remove unnecessary comments; Fix docs in LuceneTestCase w/r/t setup/teardown --- src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs | 10 ++++++++-- .../Taxonomy/TestTaxonomyFacetAssociations.cs | 4 ---- src/Lucene.Net.Tests/Search/Spans/TestBasics.cs | 4 ---- .../Search/Spans/TestFieldMaskingSpanQuery.cs | 4 ---- .../Search/TestBooleanMinShouldMatch.cs | 4 ---- src/Lucene.Net.Tests/Search/TestFieldCache.cs | 2 -- src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs | 4 ---- .../Search/TestMultiTermQueryRewrites.cs | 4 ---- src/Lucene.Net.Tests/Search/TestNGramPhraseQuery.cs | 4 ---- src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs | 4 ---- src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs | 4 ---- .../Search/TestPrefixInBooleanQuery.cs | 4 ---- src/Lucene.Net.Tests/Search/TestTermVectors.cs | 4 ---- 13 files changed, 8 insertions(+), 48 deletions(-) diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs index ddfcda9ead..52ccaf1abd 100644 --- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs +++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs @@ -66,8 +66,14 @@ namespace Lucene.Net.Util ///

Class and instance setup.

/// /// - /// The preferred way to specify class (suite-level) setup/cleanup is to use - /// static methods annotated with and . Any + /// The preferred way to specify class (suite-level) setup/cleanup is to override + /// and . Be sure + /// to call base.OneTimeSetUp() BEFORE you initialize your class and + /// call base.OneTimeTearDown() AFTER you clean up your class. NUnit + /// will find the and + /// of the base class, + /// so using them on the and + /// method overrides is not strictly required. Any /// code in these methods is executed within the test framework's control and /// ensure proper setup has been made. Try not to use static initializers /// (including complex readonly field initializers). Static initializers are diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs index 38a09b6cd3..359afb2075 100644 --- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs +++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs @@ -48,10 +48,6 @@ public class TestTaxonomyFacetAssociations : FacetTestCase private static FacetsConfig config; - /// - /// LUCENENET specific - /// Is non-static because Similarity and TimeZone are not static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/Spans/TestBasics.cs b/src/Lucene.Net.Tests/Search/Spans/TestBasics.cs index 97aa69a723..d54678ae93 100644 --- a/src/Lucene.Net.Tests/Search/Spans/TestBasics.cs +++ b/src/Lucene.Net.Tests/Search/Spans/TestBasics.cs @@ -97,10 +97,6 @@ public override void Reset() internal static Analyzer simplePayloadAnalyzer; - /// - /// LUCENENET specific - /// Is non-static because NewIndexWriterConfig is no longer static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/Spans/TestFieldMaskingSpanQuery.cs b/src/Lucene.Net.Tests/Search/Spans/TestFieldMaskingSpanQuery.cs index 79b60189e2..1492bc2393 100644 --- a/src/Lucene.Net.Tests/Search/Spans/TestFieldMaskingSpanQuery.cs +++ b/src/Lucene.Net.Tests/Search/Spans/TestFieldMaskingSpanQuery.cs @@ -57,10 +57,6 @@ protected internal static Field GetField(string name, string value) protected internal static Directory directory; protected internal static IndexReader reader; - /// - /// LUCENENET specific - /// Is non-static because NewIndexWriterConfig is no longer static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestBooleanMinShouldMatch.cs b/src/Lucene.Net.Tests/Search/TestBooleanMinShouldMatch.cs index 69cf6d222e..1c77c349b7 100644 --- a/src/Lucene.Net.Tests/Search/TestBooleanMinShouldMatch.cs +++ b/src/Lucene.Net.Tests/Search/TestBooleanMinShouldMatch.cs @@ -45,10 +45,6 @@ public class TestBooleanMinShouldMatch : LuceneTestCase private static IndexReader r; private static IndexSearcher s; - /// - /// LUCENENET specific - /// Is non-static because NewStringField is no longer static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestFieldCache.cs b/src/Lucene.Net.Tests/Search/TestFieldCache.cs index ce9e0a708c..390daa7e54 100644 --- a/src/Lucene.Net.Tests/Search/TestFieldCache.cs +++ b/src/Lucene.Net.Tests/Search/TestFieldCache.cs @@ -104,8 +104,6 @@ public override void TearDown() base.TearDown(); } - - // LUCENENET: Changed to non-static because NewIndexWriterConfig is non-static [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs b/src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs index 4c7d478307..68d6cfe812 100644 --- a/src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs +++ b/src/Lucene.Net.Tests/Search/TestMinShouldMatch2.cs @@ -62,10 +62,6 @@ public class TestMinShouldMatch2 : LuceneTestCase internal static readonly string[] mediumTerms = new string[] { "e", "f", "g" }; internal static readonly string[] rareTerms = new string[] { "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; - /// - /// LUCENENET specific - /// Is non-static because Similarity and TimeZone are not static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs b/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs index 7fcbfbd158..95645b0fef 100644 --- a/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs +++ b/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs @@ -47,10 +47,6 @@ public class TestMultiTermQueryRewrites : LuceneTestCase private static IndexReader reader, multiReader, multiReaderDupls; private static IndexSearcher searcher, multiSearcher, multiSearcherDupls; - /// - /// LUCENENET specific - /// Is non-static because Similarity and TimeZone are not static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestNGramPhraseQuery.cs b/src/Lucene.Net.Tests/Search/TestNGramPhraseQuery.cs index 069d42c5d4..cb82fea61e 100644 --- a/src/Lucene.Net.Tests/Search/TestNGramPhraseQuery.cs +++ b/src/Lucene.Net.Tests/Search/TestNGramPhraseQuery.cs @@ -33,10 +33,6 @@ public class TestNGramPhraseQuery : LuceneTestCase private static IndexReader reader; private static Directory directory; - /// - /// LUCENENET specific - /// Is non-static because Similarity and TimeZone are not static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs b/src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs index 7604396e29..326054aa12 100644 --- a/src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs +++ b/src/Lucene.Net.Tests/Search/TestNumericRangeQuery32.cs @@ -62,10 +62,6 @@ public class TestNumericRangeQuery32 : LuceneTestCase private static IndexReader reader = null; private static IndexSearcher searcher = null; - /// - /// LUCENENET specific - /// Is non-static because NewIndexWriterConfig is no longer static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs b/src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs index 69dc6351ad..23b51420e1 100644 --- a/src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs +++ b/src/Lucene.Net.Tests/Search/TestNumericRangeQuery64.cs @@ -62,10 +62,6 @@ public class TestNumericRangeQuery64 : LuceneTestCase private static IndexReader reader = null; private static IndexSearcher searcher = null; - /// - /// LUCENENET specific - /// Is non-static because NewIndexWriterConfig is no longer static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestPrefixInBooleanQuery.cs b/src/Lucene.Net.Tests/Search/TestPrefixInBooleanQuery.cs index 03a2a9f848..814e05e705 100644 --- a/src/Lucene.Net.Tests/Search/TestPrefixInBooleanQuery.cs +++ b/src/Lucene.Net.Tests/Search/TestPrefixInBooleanQuery.cs @@ -46,10 +46,6 @@ public class TestPrefixInBooleanQuery : LuceneTestCase private static IndexReader reader; private static IndexSearcher searcher; - /// - /// LUCENENET specific - /// Is non-static because Similarity and TimeZone are not static. - /// [OneTimeSetUp] public override void OneTimeSetUp() { diff --git a/src/Lucene.Net.Tests/Search/TestTermVectors.cs b/src/Lucene.Net.Tests/Search/TestTermVectors.cs index 5709b07d20..2a2c6cb171 100644 --- a/src/Lucene.Net.Tests/Search/TestTermVectors.cs +++ b/src/Lucene.Net.Tests/Search/TestTermVectors.cs @@ -48,10 +48,6 @@ public class TestTermVectors : LuceneTestCase private static IndexReader reader; private static Directory directory; - /// - /// LUCENENET specific - /// Is non-static because NewIndexWriterConfig is no longer static. - /// [OneTimeSetUp] public override void OneTimeSetUp() {