lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [34/50] [abbrv] lucenenet git commit: Reworked QueryParserTestBase to once again be abstract. Added virtual keyword to tests to match that of Java. This is prep work for fixing test context in QueryParser.
Date Sun, 23 Oct 2016 13:02:20 GMT
Reworked QueryParserTestBase to once again be abstract. Added virtual keyword to tests to match that of Java. This is prep work for fixing test context in QueryParser.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/d4d462e3
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/d4d462e3
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/d4d462e3

Branch: refs/heads/master
Commit: d4d462e33a0f855eac69e28e13490408da1ca257
Parents: 6a2d485
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Oct 23 05:30:45 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Oct 23 19:36:45 2016 +0700

----------------------------------------------------------------------
 .../Analyzing/TestAnalyzingQueryParser.cs       |  22 +-
 .../Classic/TestMultiAnalyzer.cs                |   6 +-
 .../Classic/TestMultiFieldQueryParser.cs        |  20 +-
 .../Classic/TestMultiPhraseQueryParsing.cs      |   2 +-
 .../Classic/TestQueryParser.cs                  | 165 +++++++-------
 .../ComplexPhrase/TestComplexPhraseQuery.cs     |   8 +-
 .../Ext/TestExtendableQueryParser.cs            |   8 +-
 .../Ext/TestExtensions.cs                       |  13 +-
 .../Simple/TestSimpleQueryParser.cs             |  90 ++++----
 .../Surround/Query/Test01Exceptions.cs          |   2 +-
 .../Surround/Query/Test02Boolean.cs             |  46 ++--
 .../Surround/Query/Test03Distance.cs            |  90 ++++----
 .../Util/QueryParserTestBase.cs                 | 217 +++++--------------
 13 files changed, 283 insertions(+), 406 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs
index 8424089..8ba3e12 100644
--- a/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs
@@ -92,7 +92,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
         }
 
         [Test]
-        public void TestSingleChunkExceptions()
+        public virtual void TestSingleChunkExceptions()
         {
             bool ex = false;
             string termStr = "the*tre";
@@ -129,7 +129,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
         }
 
         [Test]
-        public void TestWildcardAlone()
+        public virtual void TestWildcardAlone()
         {
             //seems like crazy edge case, but can be useful in concordance 
             bool pex = false;
@@ -158,7 +158,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
         }
 
         [Test]
-        public void TestWildCardEscapes()
+        public virtual void TestWildCardEscapes()
         {
             foreach (var entry in wildcardEscapeHits)
             {
@@ -173,7 +173,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
         }
 
         [Test]
-        public void TestWildCardQueryNoLeadingAllowed()
+        public virtual void TestWildCardQueryNoLeadingAllowed()
         {
             bool ex = false;
             try
@@ -190,7 +190,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
         }
 
         [Test]
-        public void TestWildCardQuery()
+        public virtual void TestWildCardQuery()
         {
             for (int i = 0; i < wildcardInput.Length; i++)
             {
@@ -200,7 +200,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
         }
 
         [Test]
-        public void TestPrefixQuery()
+        public virtual void TestPrefixQuery()
         {
             for (int i = 0; i < prefixInput.Length; i++)
             {
@@ -210,7 +210,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
         }
 
         [Test]
-        public void TestRangeQuery()
+        public virtual void TestRangeQuery()
         {
             for (int i = 0; i < rangeInput.Length; i++)
             {
@@ -220,7 +220,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
         }
 
         [Test]
-        public void TestFuzzyQuery()
+        public virtual void TestFuzzyQuery()
         {
             for (int i = 0; i < fuzzyInput.Length; i++)
             {
@@ -296,7 +296,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
 
         // LUCENE-4176
         [Test]
-        public void TestByteTerms()
+        public virtual void TestByteTerms()
         {
             string s = "เข";
             Analyzer analyzer = new MockBytesAnalyzer();
@@ -310,9 +310,7 @@ namespace Lucene.Net.QueryParsers.Analyzing
             int hits;
             using (Directory ramDir = NewDirectory())
             {
-                // LUCENENET TODO: It seems the overload this test depends on has been removed from the RandomIndexWriter
-                //using (RandomIndexWriter writer = new RandomIndexWriter(Random(), ramDir, analyzer))
-                using (RandomIndexWriter writer = new RandomIndexWriter(Random(), ramDir, NewIndexWriterConfig(Random(), TEST_VERSION_CURRENT, analyzer)))
+                using (RandomIndexWriter writer = new RandomIndexWriter(Random(), ramDir, analyzer, Similarity, TimeZone))
                 {
                     Document doc = new Document();
                     FieldType fieldType = new FieldType();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs
index b98ba83..8e352d5 100644
--- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs
@@ -18,7 +18,7 @@ namespace Lucene.Net.QueryParsers.Classic
         private static int multiToken = 0;
 
         [Test]
-        public void TestMultiAnalyzer()
+        public virtual void TestMultiAnalyzer()
         {
 
             QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "", new MultiAnalyzer());
@@ -75,7 +75,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestMultiAnalyzerWithSubclassOfQueryParser()
+        public virtual void TestMultiAnalyzerWithSubclassOfQueryParser()
         {
 
             DumbQueryParser qp = new DumbQueryParser("", new MultiAnalyzer());
@@ -96,7 +96,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestPosIncrementAnalyzer()
+        public virtual void TestPosIncrementAnalyzer()
         {
 #pragma warning disable 612, 618
             QueryParser qp = new QueryParser(LuceneVersion.LUCENE_40, "", new PosIncrementAnalyzer());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs
index 9e90937..94fd0a1 100644
--- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// corresponding static form (qtxt, fields[]).
         /// </summary>
         [Test]
-        public void TestStopwordsParsing()
+        public virtual void TestStopwordsParsing()
         {
             AssertStopQueryEquals("one", "b:one t:one");
             AssertStopQueryEquals("one stop", "b:one t:one");
@@ -66,7 +66,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestSimple()
+        public virtual void TestSimple()
         {
             string[] fields = { "b", "t" };
             MultiFieldQueryParser mfqp = new MultiFieldQueryParser(TEST_VERSION_CURRENT, fields, new MockAnalyzer(Random()));
@@ -127,7 +127,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestBoostsSimple()
+        public virtual void TestBoostsSimple()
         {
             IDictionary<string, float> boosts = new Dictionary<string, float>();
             boosts["b"] = (float)5;
@@ -157,7 +157,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestStaticMethod1()
+        public virtual void TestStaticMethod1()
         {
             string[] fields = { "b", "t" };
             string[] queries = { "one", "two" };
@@ -200,7 +200,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestStaticMethod2()
+        public virtual void TestStaticMethod2()
         {
             string[] fields = { "b", "t" };
             BooleanClause.Occur[] flags = { BooleanClause.Occur.MUST, BooleanClause.Occur.MUST_NOT };
@@ -223,7 +223,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestStaticMethod2Old()
+        public virtual void TestStaticMethod2Old()
         {
             string[] fields = { "b", "t" };
             //int[] flags = {MultiFieldQueryParser.REQUIRED_FIELD, MultiFieldQueryParser.PROHIBITED_FIELD};
@@ -248,7 +248,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestStaticMethod3()
+        public virtual void TestStaticMethod3()
         {
             string[] queries = { "one", "two", "three" };
             string[] fields = { "f1", "f2", "f3" };
@@ -270,7 +270,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestStaticMethod3Old()
+        public virtual void TestStaticMethod3Old()
         {
             string[] queries = { "one", "two" };
             string[] fields = { "b", "t" };
@@ -307,7 +307,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestStopWordSearching()
+        public virtual void TestStopWordSearching()
         {
             Analyzer analyzer = new MockAnalyzer(Random());
             using (var ramDir = NewDirectory())
@@ -362,7 +362,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestSimpleRegex()
+        public virtual void TestSimpleRegex()
         {
             string[] fields = new string[] { "a", "b" };
             MultiFieldQueryParser mfqp = new MultiFieldQueryParser(TEST_VERSION_CURRENT, fields, new MockAnalyzer(Random()));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs
index e203ad1..8e4eae4 100644
--- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs
@@ -95,7 +95,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestMultiPhraseQueryParsing()
+        public virtual void TestMultiPhraseQueryParsing()
         {
             TokenAndPos[] INCR_0_QUERY_TOKENS_AND = new TokenAndPos[]
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
index fd3f23e..d1fb5e6 100644
--- a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
@@ -50,81 +50,71 @@ namespace Lucene.Net.QueryParsers.Classic
 
         }
 
-        // Moved to QueryParserTestBase
-        //public QueryParser GetParser(Analyzer a)
-        //{
-        //    if (a == null) a = new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true);
-        //    QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, DefaultField, a);
-        //    qp.DefaultOperator = (QueryParserBase.OR_OPERATOR);
-        //    return qp;
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override ICommonQueryParserConfiguration GetParserConfig(Analyzer a)
-        //{
-        //    return GetParser(a);
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override Query GetQuery(string query, ICommonQueryParserConfiguration cqpC)
-        //{
-        //    Debug.Assert(cqpC != null, "Parameter must not be null");
-        //    Debug.Assert(cqpC is QueryParser, "Parameter must be instance of QueryParser");
-        //    QueryParser qp = (QueryParser)cqpC;
-        //    return qp.Parse(query);
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override Query GetQuery(string query, Analyzer a)
-        //{
-        //    return GetParser(a).Parse(query);
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override bool IsQueryParserException(Exception exception)
-        //{
-        //    return exception is ParseException;
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override void SetDefaultOperatorOR(ICommonQueryParserConfiguration cqpC)
-        //{
-        //    Debug.Assert(cqpC is QueryParser);
-        //    QueryParser qp = (QueryParser)cqpC;
-        //    qp.DefaultOperator = QueryParserBase.Operator.OR;
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC)
-        //{
-        //    Debug.Assert(cqpC is QueryParser);
-        //    QueryParser qp = (QueryParser)cqpC;
-        //    qp.DefaultOperator = QueryParserBase.Operator.AND;
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value)
-        //{
-        //    Debug.Assert(cqpC is QueryParser);
-        //    QueryParser qp = (QueryParser)cqpC;
-        //    qp.AnalyzeRangeTerms = (value);
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value)
-        //{
-        //    Debug.Assert(cqpC is QueryParser);
-        //    QueryParser qp = (QueryParser)cqpC;
-        //    qp.AutoGeneratePhraseQueries = value;
-        //}
-
-        // Moved to QueryParserTestBase
-        //public override void SetDateResolution(ICommonQueryParserConfiguration cqpC, ICharSequence field, DateTools.Resolution value)
-        //{
-        //    Debug.Assert(cqpC is QueryParser);
-        //    QueryParser qp = (QueryParser)cqpC;
-        //    qp.SetDateResolution(field.toString(), value);
-        //}
+        public virtual QueryParser GetParser(Analyzer a)
+        {
+            if (a == null) a = new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true);
+            QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, DefaultField, a);
+            qp.DefaultOperator = (QueryParserBase.OR_OPERATOR);
+            return qp;
+        }
+
+        public override ICommonQueryParserConfiguration GetParserConfig(Analyzer a)
+        {
+            return GetParser(a);
+        }
+
+        public override Query GetQuery(string query, ICommonQueryParserConfiguration cqpC)
+        {
+            Debug.Assert(cqpC != null, "Parameter must not be null");
+            Debug.Assert(cqpC is QueryParser, "Parameter must be instance of QueryParser");
+            QueryParser qp = (QueryParser)cqpC;
+            return qp.Parse(query);
+        }
+
+        public override Query GetQuery(string query, Analyzer a)
+        {
+            return GetParser(a).Parse(query);
+        }
+
+        public override bool IsQueryParserException(Exception exception)
+        {
+            return exception is ParseException;
+        }
+
+        public override void SetDefaultOperatorOR(ICommonQueryParserConfiguration cqpC)
+        {
+            Debug.Assert(cqpC is QueryParser);
+            QueryParser qp = (QueryParser)cqpC;
+            qp.DefaultOperator = QueryParserBase.Operator.OR;
+        }
+
+        public override void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC)
+        {
+            Debug.Assert(cqpC is QueryParser);
+            QueryParser qp = (QueryParser)cqpC;
+            qp.DefaultOperator = QueryParserBase.Operator.AND;
+        }
+
+        public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value)
+        {
+            Debug.Assert(cqpC is QueryParser);
+            QueryParser qp = (QueryParser)cqpC;
+            qp.AnalyzeRangeTerms = (value);
+        }
+
+        public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value)
+        {
+            Debug.Assert(cqpC is QueryParser);
+            QueryParser qp = (QueryParser)cqpC;
+            qp.AutoGeneratePhraseQueries = value;
+        }
+
+        public override void SetDateResolution(ICommonQueryParserConfiguration cqpC, ICharSequence field, DateTools.Resolution value)
+        {
+            Debug.Assert(cqpC is QueryParser);
+            QueryParser qp = (QueryParser)cqpC;
+            qp.SetDateResolution(field.toString(), value);
+        }
 
         [Test]
         public override void TestDefaultOperator()
@@ -149,7 +139,7 @@ namespace Lucene.Net.QueryParsers.Classic
         // This test is here as a safety, in case that ant step
         // doesn't work for some reason.
         [Test]
-        public void TestProtectedCtors()
+        public virtual void TestProtectedCtors()
         {
             try
             {
@@ -195,7 +185,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestFuzzySlopeExtendability()
+        public virtual void TestFuzzySlopeExtendability()
         {
             QueryParser qp = new TestFuzzySlopeExtendabilityQueryParser();
             assertEquals(qp.Parse("a:[11.95 TO 12.95]"), qp.Parse("12.45~1€"));
@@ -273,7 +263,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestCustomQueryParserWildcard()
+        public virtual void TestCustomQueryParserWildcard()
         {
             try
             {
@@ -288,7 +278,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestCustomQueryParserFuzzy()
+        public virtual void TestCustomQueryParserFuzzy()
         {
             try
             {
@@ -321,6 +311,7 @@ namespace Lucene.Net.QueryParsers.Classic
             }
         }
 
+        [Test]
         public override void TestNewFieldQuery()
         {
             /** ordinary behavior, synonyms form uncoordinated boolean query */
@@ -363,7 +354,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// simple synonyms test
         /// </summary>
         [Test]
-        public void TestSynonyms()
+        public virtual void TestSynonyms()
         {
             BooleanQuery expected = new BooleanQuery(true);
             expected.Add(new TermQuery(new Index.Term("field", "dogs")), BooleanClause.Occur.SHOULD);
@@ -383,7 +374,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// forms multiphrase query
         /// </summary>
         [Test]
-        public void TestSynonymsPhrase()
+        public virtual void TestSynonymsPhrase()
         {
             MultiPhraseQuery expected = new MultiPhraseQuery();
             expected.Add(new Index.Term("field", "old"));
@@ -450,7 +441,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// simple CJK synonym test
         /// </summary>
         [Test]
-        public void TestCJKSynonym()
+        public virtual void TestCJKSynonym()
         {
             BooleanQuery expected = new BooleanQuery(true);
             expected.Add(new TermQuery(new Index.Term("field", "国")), BooleanClause.Occur.SHOULD);
@@ -467,7 +458,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// synonyms with default OR operator 
         /// </summary>
         [Test]
-        public void TestCJKSynonymsOR()
+        public virtual void TestCJKSynonymsOR()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Index.Term("field", "中")), BooleanClause.Occur.SHOULD);
@@ -485,7 +476,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// more complex synonyms with default OR operator
         /// </summary>
         [Test]
-        public void TestCJKSynonymsOR2()
+        public virtual void TestCJKSynonymsOR2()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Index.Term("field", "中")), BooleanClause.Occur.SHOULD);
@@ -507,7 +498,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// synonyms with default AND operator
         /// </summary>
         [Test]
-        public void TestCJKSynonymsAND()
+        public virtual void TestCJKSynonymsAND()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Index.Term("field", "中")), BooleanClause.Occur.MUST);
@@ -526,7 +517,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// more complex synonyms with default AND operator
         /// </summary>
         [Test]
-        public void TestCJKSynonymsAND2()
+        public virtual void TestCJKSynonymsAND2()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Index.Term("field", "中")), BooleanClause.Occur.MUST);
@@ -546,7 +537,7 @@ namespace Lucene.Net.QueryParsers.Classic
         }
 
         [Test]
-        public void TestCJKSynonymsPhrase()
+        public virtual void TestCJKSynonymsPhrase()
         {
             MultiPhraseQuery expected = new MultiPhraseQuery();
             expected.Add(new Index.Term("field", "中"));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs b/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs
index e93e4a5..fcdb4dd 100644
--- a/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs
+++ b/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.QueryParsers.ComplexPhrase
         bool inOrder = true;
 
         [Test]
-        public void TestComplexPhrases()
+        public virtual void TestComplexPhrases()
         {
             CheckMatches("\"john smith\"", "1"); // Simple multi-term still works
             CheckMatches("\"j*   smyth~\"", "1,2"); // wildcards and fuzzies are OK in
@@ -72,7 +72,7 @@ namespace Lucene.Net.QueryParsers.ComplexPhrase
         }
 
         [Test]
-        public void TestUnOrderedProximitySearches()
+        public virtual void TestUnOrderedProximitySearches()
         {
             inOrder = true;
             CheckMatches("\"smith jo*\"~2", ""); // ordered proximity produces empty set
@@ -128,7 +128,7 @@ namespace Lucene.Net.QueryParsers.ComplexPhrase
         }
 
         [Test]
-        public void TestFieldedQuery()
+        public virtual void TestFieldedQuery()
         {
             CheckMatches("name:\"john smith\"", "1");
             CheckMatches("name:\"j*   smyth~\"", "1,2");
@@ -142,7 +142,7 @@ namespace Lucene.Net.QueryParsers.ComplexPhrase
         }
 
         [Test]
-        public void TestHashcodeEquals()
+        public virtual void TestHashcodeEquals()
         {
             ComplexPhraseQueryParser qp = new ComplexPhraseQueryParser(TEST_VERSION_CURRENT, defaultFieldName, analyzer);
             qp.InOrder = true;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs
index 9ce7e01..e90b365 100644
--- a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs
@@ -49,7 +49,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestUnescapedExtDelimiter()
+        public virtual void TestUnescapedExtDelimiter()
         {
             Extensions ext = NewExtensions(':');
             ext.Add("testExt", new ExtensionStub());
@@ -65,7 +65,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestExtFieldUnqoted()
+        public virtual void TestExtFieldUnqoted()
         {
             for (int i = 0; i < DELIMITERS.Length; i++)
             {
@@ -100,7 +100,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestExtDefaultField()
+        public virtual void TestExtDefaultField()
         {
             for (int i = 0; i < DELIMITERS.Length; i++)
             {
@@ -124,7 +124,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestExtField()
+        public virtual void TestExtField()
         {
             for (int i = 0; i < DELIMITERS.Length; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs
index ffb6f07..c8a0d6c 100644
--- a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs
@@ -36,7 +36,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestBuildExtensionField()
+        public virtual void TestBuildExtensionField()
         {
             assertEquals("field\\:key", ext.BuildExtensionField("key", "field"));
             assertEquals("\\:key", ext.BuildExtensionField("key"));
@@ -47,7 +47,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestSplitExtensionField()
+        public virtual void TestSplitExtensionField()
         {
             assertEquals("field\\:key", ext.BuildExtensionField("key", "field"));
             assertEquals("\\:key", ext.BuildExtensionField("key"));
@@ -58,7 +58,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestAddGetExtension()
+        public virtual void TestAddGetExtension()
         {
             ParserExtension extension = new ExtensionStub();
             assertNull(ext.GetExtension("foo"));
@@ -69,7 +69,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestGetExtDelimiter()
+        public virtual void TestGetExtDelimiter()
         {
             assertEquals(Extensions.DEFAULT_EXTENSION_FIELD_DELIMITER, this.ext
                 .ExtensionFieldDelimiter);
@@ -78,7 +78,7 @@ namespace Lucene.Net.QueryParsers.Ext
         }
 
         [Test]
-        public void TestEscapeExtension()
+        public virtual void TestEscapeExtension()
         {
             assertEquals("abc\\:\\?\\{\\}\\[\\]\\\\\\(\\)\\+\\-\\!\\~", ext
                 .EscapeExtensionField("abc:?{}[]\\()+-!~"));
@@ -87,8 +87,7 @@ namespace Lucene.Net.QueryParsers.Ext
                 ext.EscapeExtensionField(null);
                 fail("should throw NPE - escape string is null");
             }
-            //catch (NullPointerException e)
-            catch (Exception /*e*/)
+            catch (NullReferenceException /*e*/)
             {
                 // 
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs
index f05b467..1c8ccc6 100644
--- a/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs
@@ -64,7 +64,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test a simple term */
         [Test]
-        public void TestTerm()
+        public virtual void TestTerm()
         {
             Query expected = new TermQuery(new Term("field", "foobar"));
 
@@ -73,7 +73,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test a fuzzy query */
         [Test]
-        public void TestFuzzy()
+        public virtual void TestFuzzy()
         {
             Query regular = new TermQuery(new Term("field", "foobar"));
             Query expected = new FuzzyQuery(new Term("field", "foobar"), 2);
@@ -93,7 +93,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test a simple phrase */
         [Test]
-        public void TestPhrase()
+        public virtual void TestPhrase()
         {
             PhraseQuery expected = new PhraseQuery();
             expected.Add(new Term("field", "foo"));
@@ -104,7 +104,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test a simple phrase with various slop settings */
         [Test]
-        public void TestPhraseWithSlop()
+        public virtual void TestPhraseWithSlop()
         {
             PhraseQuery expectedWithSlop = new PhraseQuery();
             expectedWithSlop.Add(new Term("field", "foo"));
@@ -143,7 +143,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test a simple prefix */
         [Test]
-        public void TestPrefix()
+        public virtual void TestPrefix()
         {
             PrefixQuery expected = new PrefixQuery(new Term("field", "foobar"));
 
@@ -152,7 +152,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test some AND'd terms using '+' operator */
         [Test]
-        public void TestAND()
+        public virtual void TestAND()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "foo")), BooleanClause.Occur.MUST);
@@ -163,7 +163,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test some AND'd phrases using '+' operator */
         [Test]
-        public void TestANDPhrase()
+        public virtual void TestANDPhrase()
         {
             PhraseQuery phrase1 = new PhraseQuery();
             phrase1.Add(new Term("field", "foo"));
@@ -180,7 +180,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test some AND'd terms (just using whitespace) */
         [Test]
-        public void TestANDImplicit()
+        public virtual void TestANDImplicit()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "foo")), BooleanClause.Occur.MUST);
@@ -191,7 +191,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test some OR'd terms */
         [Test]
-        public void TestOR()
+        public virtual void TestOR()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "foo")), BooleanClause.Occur.SHOULD);
@@ -203,7 +203,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test some OR'd terms (just using whitespace) */
         [Test]
-        public void TestORImplicit()
+        public virtual void TestORImplicit()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "foo")), BooleanClause.Occur.SHOULD);
@@ -215,7 +215,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test some OR'd phrases using '|' operator */
         [Test]
-        public void TestORPhrase()
+        public virtual void TestORPhrase()
         {
             PhraseQuery phrase1 = new PhraseQuery();
             phrase1.Add(new Term("field", "foo"));
@@ -232,7 +232,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test negated term */
         [Test]
-        public void TestNOT()
+        public virtual void TestNOT()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "foo")), BooleanClause.Occur.MUST_NOT);
@@ -245,7 +245,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test crazy prefixes with multiple asterisks */
         [Test]
-        public void TestCrazyPrefixes1()
+        public virtual void TestCrazyPrefixes1()
         {
             Query expected = new PrefixQuery(new Term("field", "st*ar"));
 
@@ -254,7 +254,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test prefixes with some escaping */
         [Test]
-        public void TestCrazyPrefixes2()
+        public virtual void TestCrazyPrefixes2()
         {
             Query expected = new PrefixQuery(new Term("field", "st*ar\\*"));
 
@@ -263,7 +263,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** not a prefix query! the prefix operator is escaped */
         [Test]
-        public void TestTermInDisguise()
+        public virtual void TestTermInDisguise()
         {
             Query expected = new TermQuery(new Term("field", "st*ar\\*"));
 
@@ -276,7 +276,7 @@ namespace Lucene.Net.QueryParsers.Simple
         // input was trying to be
 
         [Test]
-        public void TestGarbageTerm()
+        public virtual void TestGarbageTerm()
         {
             Query expected = new TermQuery(new Term("field", "star"));
 
@@ -292,7 +292,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestGarbageEmpty()
+        public virtual void TestGarbageEmpty()
         {
             assertNull(Parse(""));
             assertNull(Parse("  "));
@@ -308,7 +308,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestGarbageAND()
+        public virtual void TestGarbageAND()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "star")), BooleanClause.Occur.MUST);
@@ -323,7 +323,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestGarbageOR()
+        public virtual void TestGarbageOR()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "star")), BooleanClause.Occur.SHOULD);
@@ -336,7 +336,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestGarbageNOT()
+        public virtual void TestGarbageNOT()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "star")), BooleanClause.Occur.MUST_NOT);
@@ -348,7 +348,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestGarbagePhrase()
+        public virtual void TestGarbagePhrase()
         {
             PhraseQuery expected = new PhraseQuery();
             expected.Add(new Term("field", "star"));
@@ -361,7 +361,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestGarbageSubquery()
+        public virtual void TestGarbageSubquery()
         {
             Query expected = new TermQuery(new Term("field", "star"));
 
@@ -373,7 +373,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestCompoundAnd()
+        public virtual void TestCompoundAnd()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "star")), BooleanClause.Occur.MUST);
@@ -386,7 +386,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestCompoundOr()
+        public virtual void TestCompoundOr()
         {
             BooleanQuery expected = new BooleanQuery();
             expected.Add(new TermQuery(new Term("field", "star")), BooleanClause.Occur.SHOULD);
@@ -399,7 +399,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestComplex00()
+        public virtual void TestComplex00()
         {
             BooleanQuery expected = new BooleanQuery();
             BooleanQuery inner = new BooleanQuery();
@@ -414,7 +414,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestComplex01()
+        public virtual void TestComplex01()
         {
             BooleanQuery expected = new BooleanQuery();
             BooleanQuery inner = new BooleanQuery();
@@ -429,7 +429,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestComplex02()
+        public virtual void TestComplex02()
         {
             BooleanQuery expected = new BooleanQuery();
             BooleanQuery inner = new BooleanQuery();
@@ -445,7 +445,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestComplex03()
+        public virtual void TestComplex03()
         {
             BooleanQuery expected = new BooleanQuery();
             BooleanQuery inner = new BooleanQuery();
@@ -464,7 +464,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestComplex04()
+        public virtual void TestComplex04()
         {
             BooleanQuery expected = new BooleanQuery();
             BooleanQuery inner = new BooleanQuery();
@@ -483,7 +483,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestComplex05()
+        public virtual void TestComplex05()
         {
             BooleanQuery expected = new BooleanQuery();
             BooleanQuery inner1 = new BooleanQuery();
@@ -513,7 +513,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestComplex06()
+        public virtual void TestComplex06()
         {
             BooleanQuery expected = new BooleanQuery();
             BooleanQuery inner1 = new BooleanQuery();
@@ -539,7 +539,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test a term with field weights */
         [Test]
-        public void TestWeightedTerm()
+        public virtual void TestWeightedTerm()
         {
             IDictionary<string, float> weights = new Dictionary<string, float>();
             weights["field0"] = 5f;
@@ -560,7 +560,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test a more complex query with field weights */
         [Test]
-        public void testWeightedOR()
+        public virtual void testWeightedOR()
         {
             IDictionary<string, float> weights = new Dictionary<string, float>();
             weights["field0"] = 5f;
@@ -602,7 +602,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test the ability to enable/disable phrase operator */
         [Test]
-        public void TestDisablePhrase()
+        public virtual void TestDisablePhrase()
         {
             Query expected = new TermQuery(new Term("field", "\"test\""));
             assertEquals(expected, ParseKeyword("\"test\"", ~SimpleQueryParser.PHRASE_OPERATOR));
@@ -610,7 +610,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test the ability to enable/disable prefix operator */
         [Test]
-        public void TestDisablePrefix()
+        public virtual void TestDisablePrefix()
         {
             Query expected = new TermQuery(new Term("field", "test*"));
             assertEquals(expected, ParseKeyword("test*", ~SimpleQueryParser.PREFIX_OPERATOR));
@@ -618,7 +618,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test the ability to enable/disable AND operator */
         [Test]
-        public void TestDisableAND()
+        public virtual void TestDisableAND()
         {
             Query expected = new TermQuery(new Term("field", "foo+bar"));
             assertEquals(expected, ParseKeyword("foo+bar", ~SimpleQueryParser.AND_OPERATOR));
@@ -628,7 +628,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test the ability to enable/disable OR operator */
         [Test]
-        public void TestDisableOR()
+        public virtual void TestDisableOR()
         {
             Query expected = new TermQuery(new Term("field", "foo|bar"));
             assertEquals(expected, ParseKeyword("foo|bar", ~SimpleQueryParser.OR_OPERATOR));
@@ -638,7 +638,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test the ability to enable/disable NOT operator */
         [Test]
-        public void TestDisableNOT()
+        public virtual void TestDisableNOT()
         {
             Query expected = new TermQuery(new Term("field", "-foo"));
             assertEquals(expected, ParseKeyword("-foo", ~SimpleQueryParser.NOT_OPERATOR));
@@ -646,7 +646,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test the ability to enable/disable precedence operators */
         [Test]
-        public void TestDisablePrecedence()
+        public virtual void TestDisablePrecedence()
         {
             Query expected = new TermQuery(new Term("field", "(foo)"));
             assertEquals(expected, ParseKeyword("(foo)", ~SimpleQueryParser.PRECEDENCE_OPERATORS));
@@ -656,7 +656,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         /** test the ability to enable/disable escape operators */
         [Test]
-        public void TestDisableEscape()
+        public virtual void TestDisableEscape()
         {
             Query expected = new TermQuery(new Term("field", "foo\\bar"));
             assertEquals(expected, ParseKeyword("foo\\bar", ~SimpleQueryParser.ESCAPE_OPERATOR));
@@ -665,7 +665,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestDisableWhitespace()
+        public virtual void TestDisableWhitespace()
         {
             Query expected = new TermQuery(new Term("field", "foo foo"));
             assertEquals(expected, ParseKeyword("foo foo", ~SimpleQueryParser.WHITESPACE_OPERATOR));
@@ -676,14 +676,14 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void TestDisableFuzziness()
+        public virtual void TestDisableFuzziness()
         {
             Query expected = new TermQuery(new Term("field", "foo~1"));
             assertEquals(expected, ParseKeyword("foo~1", ~SimpleQueryParser.FUZZY_OPERATOR));
         }
 
         [Test]
-        public void TestDisableSlop()
+        public virtual void TestDisableSlop()
         {
             PhraseQuery expectedPhrase = new PhraseQuery();
             expectedPhrase.Add(new Term("field", "foo"));
@@ -697,7 +697,7 @@ namespace Lucene.Net.QueryParsers.Simple
 
         // we aren't supposed to barf on any input...
         [Test]
-        public void TestRandomQueries()
+        public virtual void TestRandomQueries()
         {
             for (int i = 0; i < 1000; i++)
             {
@@ -708,7 +708,7 @@ namespace Lucene.Net.QueryParsers.Simple
         }
 
         [Test]
-        public void testRandomQueries2()
+        public virtual void testRandomQueries2()
         {
             char[] chars = new char[] { 'a', '1', '|', '&', ' ', '(', ')', '"', '-', '~' };
             StringBuilder sb = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs
index 14b38c0..09940cc 100644
--- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs
@@ -60,7 +60,7 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         };
 
         [Test]
-        public void Test01Exceptions()
+        public virtual void Test01Exceptions()
         {
             string m = ExceptionQueryTst.GetFailQueries(exceptionQueries, verbose);
             if (m.Length > 0)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs
index c0e5407..7dd6c62 100644
--- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs
@@ -58,119 +58,119 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         }
 
         [Test]
-        public void Test02Terms01()
+        public virtual void Test02Terms01()
         {
             int[] expdnrs = { 0 }; NormalTest1("word1", expdnrs);
         }
         [Test]
-        public void Test02Terms02()
+        public virtual void Test02Terms02()
         {
             int[] expdnrs = { 0, 1, 3 }; NormalTest1("word*", expdnrs);
         }
         [Test]
-        public void Test02Terms03()
+        public virtual void Test02Terms03()
         {
             int[] expdnrs = { 2 }; NormalTest1("ord2", expdnrs);
         }
         [Test]
-        public void Test02Terms04()
+        public virtual void Test02Terms04()
         {
             int[] expdnrs = { }; NormalTest1("kxork*", expdnrs);
         }
         [Test]
-        public void Test02Terms05()
+        public virtual void Test02Terms05()
         {
             int[] expdnrs = { 0, 1, 3 }; NormalTest1("wor*", expdnrs);
         }
         [Test]
-        public void Test02Terms06()
+        public virtual void Test02Terms06()
         {
             int[] expdnrs = { }; NormalTest1("ab", expdnrs);
         }
 
         [Test]
-        public void Test02Terms10()
+        public virtual void Test02Terms10()
         {
             int[] expdnrs = { }; NormalTest1("abc?", expdnrs);
         }
         [Test]
-        public void Test02Terms13()
+        public virtual void Test02Terms13()
         {
             int[] expdnrs = { 0, 1, 3 }; NormalTest1("word?", expdnrs);
         }
         [Test]
-        public void Test02Terms14()
+        public virtual void Test02Terms14()
         {
             int[] expdnrs = { 0, 1, 3 }; NormalTest1("w?rd?", expdnrs);
         }
         [Test]
-        public void Test02Terms20()
+        public virtual void Test02Terms20()
         {
             int[] expdnrs = { 0, 1, 3 }; NormalTest1("w*rd?", expdnrs);
         }
         [Test]
-        public void Test02Terms21()
+        public virtual void Test02Terms21()
         {
             int[] expdnrs = { 3 }; NormalTest1("w*rd??", expdnrs);
         }
         [Test]
-        public void Test02Terms22()
+        public virtual void Test02Terms22()
         {
             int[] expdnrs = { 3 }; NormalTest1("w*?da?", expdnrs);
         }
         [Test]
-        public void Test02Terms23()
+        public virtual void Test02Terms23()
         {
             int[] expdnrs = { }; NormalTest1("w?da?", expdnrs);
         }
 
         [Test]
-        public void Test03And01()
+        public virtual void Test03And01()
         {
             int[] expdnrs = { 0 }; NormalTest1("word1 AND word2", expdnrs);
         }
         [Test]
-        public void Test03And02()
+        public virtual void Test03And02()
         {
             int[] expdnrs = { 3 }; NormalTest1("word* and ord*", expdnrs);
         }
         [Test]
-        public void Test03And03()
+        public virtual void Test03And03()
         {
             int[] expdnrs = { 0 }; NormalTest1("and(word1,word2)", expdnrs);
         }
         [Test]
-        public void Test04Or01()
+        public virtual void Test04Or01()
         {
             int[] expdnrs = { 0, 3 }; NormalTest1("word1 or word2", expdnrs);
         }
         [Test]
-        public void Test04Or02()
+        public virtual void Test04Or02()
         {
             int[] expdnrs = { 0, 1, 2, 3 }; NormalTest1("word* OR ord*", expdnrs);
         }
         [Test]
-        public void Test04Or03()
+        public virtual void Test04Or03()
         {
             int[] expdnrs = { 0, 3 }; NormalTest1("OR (word1, word2)", expdnrs);
         }
         [Test]
-        public void Test05Not01()
+        public virtual void Test05Not01()
         {
             int[] expdnrs = { 3 }; NormalTest1("word2 NOT word1", expdnrs);
         }
         [Test]
-        public void Test05Not02()
+        public virtual void Test05Not02()
         {
             int[] expdnrs = { 0 }; NormalTest1("word2* not ord*", expdnrs);
         }
         [Test]
-        public void Test06AndOr01()
+        public virtual void Test06AndOr01()
         {
             int[] expdnrs = { 0 }; NormalTest1("(word1 or ab)and or(word2,xyz, defg)", expdnrs);
         }
         [Test]
-        public void Test07AndOrNot02()
+        public virtual void Test07AndOrNot02()
         {
             int[] expdnrs = { 0 }; NormalTest1("or( word2* not ord*, and(xyz,def))", expdnrs);
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs
index 12a4e76..1504537 100644
--- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs
@@ -44,7 +44,7 @@ namespace Lucene.Net.QueryParsers.Surround.Query
         };
 
         [Test]
-        public void Test00Exceptions()
+        public virtual void Test00Exceptions()
         {
             string m = ExceptionQueryTst.GetFailQueries(exceptionQueries, verbose);
             if (m.Length > 0)
@@ -81,167 +81,167 @@ namespace Lucene.Net.QueryParsers.Surround.Query
             bqt.DoTest();
         }
 
-        public void DistanceTest1(string query, int[] expdnrs)
+        public virtual void DistanceTest1(string query, int[] expdnrs)
         {
             DistanceTst(query, expdnrs, db1);
         }
 
         [Test]
-        public void Test0W01()
+        public virtual void Test0W01()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word1 w word2", expdnrs);
         }
         [Test]
-        public void Test0N01()
+        public virtual void Test0N01()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word1 n word2", expdnrs);
         }
         [Test]
-        public void Test0N01r()
+        public virtual void Test0N01r()
         { /* r reverse */
             int[] expdnrs = { 0 }; DistanceTest1("word2 n word1", expdnrs);
         }
         [Test]
-        public void Test0W02()
+        public virtual void Test0W02()
         {
             int[] expdnrs = { }; DistanceTest1("word2 w word1", expdnrs);
         }
         [Test]
-        public void Test0W03()
+        public virtual void Test0W03()
         {
             int[] expdnrs = { }; DistanceTest1("word2 2W word1", expdnrs);
         }
         [Test]
-        public void Test0N03()
+        public virtual void Test0N03()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word2 2N word1", expdnrs);
         }
         [Test]
-        public void Test0N03r()
+        public virtual void Test0N03r()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word1 2N word2", expdnrs);
         }
 
         [Test]
-        public void Test0W04()
+        public virtual void Test0W04()
         {
             int[] expdnrs = { }; DistanceTest1("word2 3w word1", expdnrs);
         }
 
         [Test]
-        public void Test0N04()
+        public virtual void Test0N04()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word2 3n word1", expdnrs);
         }
         [Test]
-        public void Test0N04r()
+        public virtual void Test0N04r()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word1 3n word2", expdnrs);
         }
 
         [Test]
-        public void Test0W05()
+        public virtual void Test0W05()
         {
             int[] expdnrs = { }; DistanceTest1("orda1 w orda3", expdnrs);
         }
         [Test]
-        public void Test0W06()
+        public virtual void Test0W06()
         {
             int[] expdnrs = { 3 }; DistanceTest1("orda1 2w orda3", expdnrs);
         }
 
         [Test]
-        public void Test1Wtrunc01()
+        public virtual void Test1Wtrunc01()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word1* w word2", expdnrs);
         }
         [Test]
-        public void Test1Wtrunc02()
+        public virtual void Test1Wtrunc02()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word* w word2", expdnrs);
         }
         [Test]
-        public void Test1Wtrunc02r()
+        public virtual void Test1Wtrunc02r()
         {
             int[] expdnrs = { 0, 3 }; DistanceTest1("word2 w word*", expdnrs);
         }
         [Test]
-        public void Test1Ntrunc02()
+        public virtual void Test1Ntrunc02()
         {
             int[] expdnrs = { 0, 3 }; DistanceTest1("word* n word2", expdnrs);
         }
         [Test]
-        public void Test1Ntrunc02r()
+        public virtual void Test1Ntrunc02r()
         {
             int[] expdnrs = { 0, 3 }; DistanceTest1("word2 n word*", expdnrs);
         }
 
         [Test]
-        public void Test1Wtrunc03()
+        public virtual void Test1Wtrunc03()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word1* w word2*", expdnrs);
         }
         [Test]
-        public void Test1Ntrunc03()
+        public virtual void Test1Ntrunc03()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word1* N word2*", expdnrs);
         }
 
         [Test]
-        public void Test1Wtrunc04()
+        public virtual void Test1Wtrunc04()
         {
             int[] expdnrs = { }; DistanceTest1("kxork* w kxor*", expdnrs);
         }
         [Test]
-        public void Test1Ntrunc04()
+        public virtual void Test1Ntrunc04()
         {
             int[] expdnrs = { }; DistanceTest1("kxork* 99n kxor*", expdnrs);
         }
 
         [Test]
-        public void Test1Wtrunc05()
+        public virtual void Test1Wtrunc05()
         {
             int[] expdnrs = { }; DistanceTest1("word2* 2W word1*", expdnrs);
         }
         [Test]
-        public void Test1Ntrunc05()
+        public virtual void Test1Ntrunc05()
         {
             int[] expdnrs = { 0 }; DistanceTest1("word2* 2N word1*", expdnrs);
         }
 
         [Test]
-        public void Test1Wtrunc06()
+        public virtual void Test1Wtrunc06()
         {
             int[] expdnrs = { 3 }; DistanceTest1("ord* W word*", expdnrs);
         }
         [Test]
-        public void Test1Ntrunc06()
+        public virtual void Test1Ntrunc06()
         {
             int[] expdnrs = { 3 }; DistanceTest1("ord* N word*", expdnrs);
         }
         [Test]
-        public void Test1Ntrunc06r()
+        public virtual void Test1Ntrunc06r()
         {
             int[] expdnrs = { 3 }; DistanceTest1("word* N ord*", expdnrs);
         }
 
         [Test]
-        public void Test1Wtrunc07()
+        public virtual void Test1Wtrunc07()
         {
             int[] expdnrs = { 3 }; DistanceTest1("(orda2 OR orda3) W word*", expdnrs);
         }
         [Test]
-        public void Test1Wtrunc08()
+        public virtual void Test1Wtrunc08()
         {
             int[] expdnrs = { 3 }; DistanceTest1("(orda2 OR orda3) W (word2 OR worda3)", expdnrs);
         }
         [Test]
-        public void Test1Wtrunc09()
+        public virtual void Test1Wtrunc09()
         {
             int[] expdnrs = { 3 }; DistanceTest1("(orda2 OR orda3) 2W (word2 OR worda3)", expdnrs);
         }
         [Test]
-        public void Test1Ntrunc09()
+        public virtual void Test1Ntrunc09()
         {
             int[] expdnrs = { 3 }; DistanceTest1("(orda2 OR orda3) 2N (word2 OR worda3)", expdnrs);
         }
@@ -254,62 +254,62 @@ namespace Lucene.Net.QueryParsers.Surround.Query
 
         SingleFieldTestDb db2;
 
-        public void DistanceTest2(string query, int[] expdnrs)
+        public virtual void DistanceTest2(string query, int[] expdnrs)
         {
             DistanceTst(query, expdnrs, db2);
         }
 
         [Test]
-        public void Test2Wprefix01()
+        public virtual void Test2Wprefix01()
         {
             int[] expdnrs = { 0 }; DistanceTest2("W (w1, w2, w3)", expdnrs);
         }
         [Test]
-        public void Test2Nprefix01a()
+        public virtual void Test2Nprefix01a()
         {
             int[] expdnrs = { 0, 1 }; DistanceTest2("N(w1, w2, w3)", expdnrs);
         }
         [Test]
-        public void Test2Nprefix01b()
+        public virtual void Test2Nprefix01b()
         {
             int[] expdnrs = { 0, 1 }; DistanceTest2("N(w3, w1, w2)", expdnrs);
         }
 
         [Test]
-        public void Test2Wprefix02()
+        public virtual void Test2Wprefix02()
         {
             int[] expdnrs = { 0, 1 }; DistanceTest2("2W(w1,w2,w3)", expdnrs);
         }
 
         [Test]
-        public void Test2Nprefix02a()
+        public virtual void Test2Nprefix02a()
         {
             int[] expdnrs = { 0, 1 }; DistanceTest2("2N(w1,w2,w3)", expdnrs);
         }
         [Test]
-        public void Test2Nprefix02b()
+        public virtual void Test2Nprefix02b()
         {
             int[] expdnrs = { 0, 1 }; DistanceTest2("2N(w2,w3,w1)", expdnrs);
         }
 
         [Test]
-        public void Test2Wnested01()
+        public virtual void Test2Wnested01()
         {
             int[] expdnrs = { 0 }; DistanceTest2("w1 W w2 W w3", expdnrs);
         }
         [Test]
-        public void Test2Nnested01()
+        public virtual void Test2Nnested01()
         {
             int[] expdnrs = { 0 }; DistanceTest2("w1 N w2 N w3", expdnrs);
         }
 
         [Test]
-        public void Test2Wnested02()
+        public virtual void Test2Wnested02()
         {
             int[] expdnrs = { 0, 1 }; DistanceTest2("w1 2W w2 2W w3", expdnrs);
         }
         [Test]
-        public void Test2Nnested02()
+        public virtual void Test2Nnested02()
         {
             int[] expdnrs = { 0, 1 }; DistanceTest2("w1 2N w2 2N w3", expdnrs);
         }
@@ -323,13 +323,13 @@ namespace Lucene.Net.QueryParsers.Surround.Query
 
         SingleFieldTestDb db3;
 
-        public void DistanceTest3(string query, int[] expdnrs)
+        public virtual void DistanceTest3(string query, int[] expdnrs)
         {
             DistanceTst(query, expdnrs, db3);
         }
 
         [Test]
-        public void Test3Example01()
+        public virtual void Test3Example01()
         {
             int[] expdnrs = { 0, 2 }; // query does not match doc 1 because "gradient" is in wrong place there.
             DistanceTest3("50n((low w pressure*) or depression*,"

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d4d462e3/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs b/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs
index 4fe01c5..e484902 100644
--- a/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs
@@ -11,12 +11,6 @@ using Lucene.Net.Util;
 using Lucene.Net.Util.Automaton;
 using NUnit.Framework;
 using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace Lucene.Net.QueryParsers.Util
 {
@@ -26,7 +20,7 @@ namespace Lucene.Net.QueryParsers.Util
     /// abstract classes.
     /// </summary>
     [TestFixture]
-    public class QueryParserTestBase : AbstractQueryParserTestBase
+    public abstract class QueryParserTestBase : LuceneTestCase
     {
         public static Analyzer qpAnalyzer;
 
@@ -113,82 +107,23 @@ namespace Lucene.Net.QueryParsers.Util
             originalMaxClauses = BooleanQuery.MaxClauseCount;
         }
 
-        // Moved from TestQueryParser
-        public virtual Classic.QueryParser GetParser(Analyzer a)
-        {
-            if (a == null) a = new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true);
-            Classic.QueryParser qp = new Classic.QueryParser(TEST_VERSION_CURRENT, DefaultField, a);
-            qp.DefaultOperator = (QueryParserBase.OR_OPERATOR);
-            return qp;
-        }
-
-        // Moved to AbstractQueryParserTestBase
-        public override ICommonQueryParserConfiguration GetParserConfig(Analyzer a)
-        {
-            return GetParser(a);
-        }
-
-        // Moved to AbstractQueryParserTestBase
-        public override void SetDefaultOperatorOR(ICommonQueryParserConfiguration cqpC)
-        {
-            Debug.Assert(cqpC is Classic.QueryParser);
-            Classic.QueryParser qp = (Classic.QueryParser)cqpC;
-            qp.DefaultOperator = QueryParserBase.Operator.OR;
-        }
+        public abstract ICommonQueryParserConfiguration GetParserConfig(Analyzer a);
 
-        // Moved to AbstractQueryParserTestBase
-        public override void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC)
-        {
-            Debug.Assert(cqpC is Classic.QueryParser);
-            Classic.QueryParser qp = (Classic.QueryParser)cqpC;
-            qp.DefaultOperator = QueryParserBase.Operator.AND;
-        }
+        public abstract void SetDefaultOperatorOR(ICommonQueryParserConfiguration cqpC);
 
-        // Moved to AbstractQueryParserTestBase
-        public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value)
-        {
-            Debug.Assert(cqpC is Classic.QueryParser);
-            Classic.QueryParser qp = (Classic.QueryParser)cqpC;
-            qp.AnalyzeRangeTerms = (value);
-        }
+        public abstract void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC);
 
-        // Moved to AbstractQueryParserTestBase
-        public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value)
-        {
-            Debug.Assert(cqpC is Classic.QueryParser);
-            Classic.QueryParser qp = (Classic.QueryParser)cqpC;
-            qp.AutoGeneratePhraseQueries = value;
-        }
+        public abstract void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value);
 
-        // Moved to AbstractQueryParserTestBase
-        public override void SetDateResolution(ICommonQueryParserConfiguration cqpC, ICharSequence field, DateTools.Resolution value)
-        {
-            Debug.Assert(cqpC is Classic.QueryParser);
-            Classic.QueryParser qp = (Classic.QueryParser)cqpC;
-            qp.SetDateResolution(field.toString(), value);
-        }
+        public abstract void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value);
 
-        // Moved to AbstractQueryParserTestBase
-        public override Query GetQuery(string query, ICommonQueryParserConfiguration cqpC)
-        {
-            Debug.Assert(cqpC != null, "Parameter must not be null");
-            Debug.Assert(cqpC is Classic.QueryParser, "Parameter must be instance of QueryParser");
-            Classic.QueryParser qp = (Classic.QueryParser)cqpC;
-            return qp.Parse(query);
-        }
+        public abstract void SetDateResolution(ICommonQueryParserConfiguration cqpC, ICharSequence field, DateTools.Resolution value);
 
-        // Moved to AbstractQueryParserTestBase
-        public override Query GetQuery(string query, Analyzer a)
-        {
-            return GetParser(a).Parse(query);
-        }
+        public abstract Query GetQuery(string query, ICommonQueryParserConfiguration cqpC);
 
+        public abstract Query GetQuery(string query, Analyzer a);
 
-        // Moved to AbstractQueryParserTestBase
-        public override bool IsQueryParserException(Exception exception)
-        {
-            return exception is ParseException;
-        }
+        public abstract bool IsQueryParserException(Exception exception);
 
         public Query GetQuery(string query)
         {
@@ -278,7 +213,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestCJK()
+        public virtual void TestCJK()
         {
             // Test Ideographic Space - As wide as a CJK character cell (fullwidth)
             // used google to translate the word "term" to japanese -> 用語
@@ -316,7 +251,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestCJKTerm()
+        public virtual void TestCJKTerm()
         {
             // individual CJK chars as terms
             SimpleCJKAnalyzer analyzer = new SimpleCJKAnalyzer();
@@ -329,7 +264,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestCJKBoostedTerm()
+        public virtual void TestCJKBoostedTerm()
         {
             // individual CJK chars as terms
             SimpleCJKAnalyzer analyzer = new SimpleCJKAnalyzer();
@@ -343,7 +278,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestCJKPhrase()
+        public virtual void TestCJKPhrase()
         {
             // individual CJK chars as terms
             SimpleCJKAnalyzer analyzer = new SimpleCJKAnalyzer();
@@ -356,7 +291,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestCJKBoostedPhrase()
+        public virtual void TestCJKBoostedPhrase()
         {
             // individual CJK chars as terms
             SimpleCJKAnalyzer analyzer = new SimpleCJKAnalyzer();
@@ -370,7 +305,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestCJKSloppyPhrase()
+        public virtual void TestCJKSloppyPhrase()
         {
             // individual CJK chars as terms
             SimpleCJKAnalyzer analyzer = new SimpleCJKAnalyzer();
@@ -384,7 +319,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestAutoGeneratePhraseQueriesOn()
+        public virtual void TestAutoGeneratePhraseQueriesOn()
         {
             // individual CJK chars as terms
             SimpleCJKAnalyzer analyzer = new SimpleCJKAnalyzer();
@@ -398,7 +333,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestSimple()
+        public virtual void TestSimple()
         {
             AssertQueryEquals("term term term", null, "term term term");
             AssertQueryEquals("türm term term", new MockAnalyzer(Random()), "türm term term");
@@ -453,11 +388,7 @@ namespace Lucene.Net.QueryParsers.Util
 
         }
 
-        // Moved to AbstractQueryParserTestBase
-        public override void TestDefaultOperator()
-        {
-            throw new NotImplementedException();
-        }
+        public abstract void TestDefaultOperator();
 
         private class OperatorVsWhitespaceAnalyzer : Analyzer
         {
@@ -468,7 +399,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestOperatorVsWhitespace()
+        public virtual void TestOperatorVsWhitespace()
         { //LUCENE-2566
             // +,-,! should be directly adjacent to operand (i.e. not separated by whitespace) to be treated as an operator
             Analyzer a = new OperatorVsWhitespaceAnalyzer();
@@ -478,7 +409,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestPunct()
+        public virtual void TestPunct()
         {
             Analyzer a = new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false);
             AssertQueryEquals("a&b", a, "a&b");
@@ -487,7 +418,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestSlop()
+        public virtual void TestSlop()
         {
             AssertQueryEquals("\"term germ\"~2", null, "\"term germ\"~2");
             AssertQueryEquals("\"term germ\"~2 flork", null, "\"term germ\"~2 flork");
@@ -497,7 +428,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestNumber()
+        public virtual void TestNumber()
         {
             // The numbers go away because SimpleAnalzyer ignores them
             AssertQueryEquals("3", null, "");
@@ -511,7 +442,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestWildcard()
+        public virtual void TestWildcard()
         {
             AssertQueryEquals("term*", null, "term*");
             AssertQueryEquals("term*^2", null, "term*^2.0");
@@ -605,7 +536,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestLeadingWildcardType()
+        public virtual void TestLeadingWildcardType()
         {
             ICommonQueryParserConfiguration cqpC = GetParserConfig(null);
             cqpC.AllowLeadingWildcard = (true);
@@ -615,7 +546,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestQPA()
+        public virtual void TestQPA()
         {
             AssertQueryEquals("term term^3.0 term", qpAnalyzer, "term term^3.0 term");
             AssertQueryEquals("term stop^3.0 term", qpAnalyzer, "term term");
@@ -653,7 +584,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestRange()
+        public virtual void TestRange()
         {
             AssertQueryEquals("[ a TO z]", null, "[a TO z]");
             AssertQueryEquals("[ a TO z}", null, "[a TO z}");
@@ -692,7 +623,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestRangeWithPhrase()
+        public virtual void TestRangeWithPhrase()
         {
             AssertQueryEquals("[\\* TO \"*\"]", null, "[\\* TO \\*]");
             AssertQueryEquals("[\"*\" TO *]", null, "[\\* TO *]");
@@ -748,7 +679,7 @@ namespace Lucene.Net.QueryParsers.Util
 
         // TODO: Fix this test
         [Test]
-        public void TestDateRange()
+        public virtual void TestDateRange()
         {
             Assert.Fail("Test is not implemented");
 
@@ -797,7 +728,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestEscaped()
+        public virtual void TestEscaped()
         {
             Analyzer a = new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false);
 
@@ -887,7 +818,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestEscapedVsQuestionMarkAsWildcard()
+        public virtual void TestEscapedVsQuestionMarkAsWildcard()
         {
             Analyzer a = new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false);
             AssertQueryEquals("a:b\\-?c", a, "a:b\\-?c");
@@ -898,7 +829,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestQueryStringEscaping()
+        public virtual void TestQueryStringEscaping()
         {
             Analyzer a = new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false);
 
@@ -939,7 +870,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestTabNewlineCarriageReturn()
+        public virtual void TestTabNewlineCarriageReturn()
         {
             AssertQueryEqualsDOA("+weltbank +worlbank", null,
               "+weltbank +worlbank");
@@ -976,7 +907,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestSimpleDAO()
+        public virtual void TestSimpleDAO()
         {
             AssertQueryEqualsDOA("term term term", null, "+term +term +term");
             AssertQueryEqualsDOA("term +term term", null, "+term +term +term");
@@ -986,7 +917,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestBoost()
+        public virtual void TestBoost()
         {
             CharacterRunAutomaton stopWords = new CharacterRunAutomaton(BasicAutomata.MakeString("on"));
             Analyzer oneStopAnalyzer = new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true, stopWords);
@@ -1044,7 +975,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestException()
+        public virtual void TestException()
         {
             AssertParseException("\"some phrase");
             AssertParseException("(foo bar");
@@ -1055,7 +986,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestBooleanQuery()
+        public virtual void TestBooleanQuery()
         {
             BooleanQuery.MaxClauseCount = (2);
             Analyzer purWhitespaceAnalyzer = new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false);
@@ -1063,7 +994,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestPrecedence()
+        public virtual void TestPrecedence()
         {
             ICommonQueryParserConfiguration qp = GetParserConfig(new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
             Query query1 = GetQuery("A AND B OR C AND D", qp);
@@ -1099,14 +1030,10 @@ namespace Lucene.Net.QueryParsers.Util
         //    iw.addDocument(d);
         //  }
 
-        // Moved to AbstractQueryParserTestBase
-        public override void TestStarParsing()
-        {
-            throw new NotImplementedException();
-        }
+        public abstract void TestStarParsing();
 
         [Test]
-        public void TestEscapedWildcard()
+        public virtual void TestEscapedWildcard()
         {
             ICommonQueryParserConfiguration qp = GetParserConfig(new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
             WildcardQuery q = new WildcardQuery(new Term("field", "foo\\?ba?r"));
@@ -1114,7 +1041,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestRegexps()
+        public virtual void TestRegexps()
         {
             ICommonQueryParserConfiguration qp = GetParserConfig(new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
             RegexpQuery q = new RegexpQuery(new Term("field", "[a-z][123]"));
@@ -1164,7 +1091,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestStopwords()
+        public virtual void TestStopwords()
         {
             CharacterRunAutomaton stopSet = new CharacterRunAutomaton(new RegExp("the|foo").ToAutomaton());
             ICommonQueryParserConfiguration qp = GetParserConfig(new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true, stopSet));
@@ -1183,7 +1110,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestPositionIncrement()
+        public virtual void TestPositionIncrement()
         {
             ICommonQueryParserConfiguration qp = GetParserConfig(new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET));
             qp.EnablePositionIncrements = (true);
@@ -1203,7 +1130,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestMatchAllDocs()
+        public virtual void TestMatchAllDocs()
         {
             ICommonQueryParserConfiguration qp = GetParserConfig(new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
             assertEquals(new MatchAllDocsQuery(), GetQuery("*:*", qp));
@@ -1235,7 +1162,7 @@ namespace Lucene.Net.QueryParsers.Util
         // enableStopPositionIncr & QueryParser's enablePosIncr
         // "match"
         [Test]
-        public void TestPositionIncrements()
+        public virtual void TestPositionIncrements()
         {
             using (Directory dir = NewDirectory())
             {
@@ -1324,11 +1251,7 @@ namespace Lucene.Net.QueryParsers.Util
             }
         }
 
-        // Moved to AbstractQueryParserTestBase
-        public override void TestNewFieldQuery()
-        {
-            throw new NotImplementedException();
-        }
+        public abstract void TestNewFieldQuery();
 
         /// <summary>
         /// Mock collation analyzer: indexes terms as "collated" + term
@@ -1368,7 +1291,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestCollatedRange()
+        public virtual void TestCollatedRange()
         {
             ICommonQueryParserConfiguration qp = GetParserConfig(new MockCollationAnalyzer());
             SetAnalyzeRangeTerms(qp, true);
@@ -1378,14 +1301,14 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestDistanceAsEditsParsing()
+        public virtual void TestDistanceAsEditsParsing()
         {
             FuzzyQuery q = (FuzzyQuery)GetQuery("foobar~2", new MockAnalyzer(Random()));
             assertEquals(2, q.MaxEdits);
         }
 
         [Test]
-        public void TestPhraseQueryToString()
+        public virtual void TestPhraseQueryToString()
         {
             Analyzer analyzer = new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET);
             ICommonQueryParserConfiguration qp = GetParserConfig(analyzer);
@@ -1395,7 +1318,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestParseWildcardAndPhraseQueries()
+        public virtual void TestParseWildcardAndPhraseQueries()
         {
             string field = "content";
             string oldDefaultField = DefaultField;
@@ -1440,7 +1363,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestPhraseQueryPositionIncrements()
+        public virtual void TestPhraseQueryPositionIncrements()
         {
             CharacterRunAutomaton stopStopList =
             new CharacterRunAutomaton(new RegExp("[sS][tT][oO][pP]").ToAutomaton());
@@ -1458,7 +1381,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestMatchAllQueryParsing()
+        public virtual void TestMatchAllQueryParsing()
         {
             // test simple parsing of MatchAllDocsQuery
             string oldDefaultField = DefaultField;
@@ -1474,7 +1397,7 @@ namespace Lucene.Net.QueryParsers.Util
         }
 
         [Test]
-        public void TestNestedAndClausesFoo()
+        public virtual void TestNestedAndClausesFoo()
         {
             string query = "(field1:[1 TO *] AND field1:[* TO 2]) AND field2:(z)";
             BooleanQuery q = new BooleanQuery();
@@ -1486,38 +1409,4 @@ namespace Lucene.Net.QueryParsers.Util
             assertEquals(q, GetQuery(query, new MockAnalyzer(Random())));
         }
     }
-
-
-    /// <summary>
-    /// This class was added in .NET because the Visual Studio test runner
-    /// does not detect tests in abstract classes. Therefore, the abstract members
-    /// of QueryParserTestBase were moved here so the QueryParserTestBase class
-    /// could be made concrete.
-    /// </summary>
-    public abstract class AbstractQueryParserTestBase : LuceneTestCase
-    {
-        public abstract void TestStarParsing();
-
-        public abstract void TestNewFieldQuery();
-
-        public abstract void TestDefaultOperator();
-
-        public abstract ICommonQueryParserConfiguration GetParserConfig(Analyzer a);
-
-        public abstract void SetDefaultOperatorOR(ICommonQueryParserConfiguration cqpC);
-
-        public abstract void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC);
-
-        public abstract void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value);
-
-        public abstract void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value);
-
-        public abstract void SetDateResolution(ICommonQueryParserConfiguration cqpC, ICharSequence field, DateTools.Resolution value);
-
-        public abstract Query GetQuery(string query, ICommonQueryParserConfiguration cqpC);
-
-        public abstract Query GetQuery(string query, Analyzer a);
-
-        public abstract bool IsQueryParserException(Exception exception);
-    }
 }


Mime
View raw message