lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [25/32] lucenenet git commit: Passing Similarity and TimeZone into RandomIndexWriter ctors.
Date Fri, 12 Aug 2016 13:25:38 GMT
Passing Similarity and TimeZone into RandomIndexWriter ctors.


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

Branch: refs/heads/master
Commit: c8e1eae628e07b06ae2f31512c9955d66d4b81ca
Parents: f772f19
Author: Connie Yau <conniey@microsoft.com>
Authored: Sun Jul 31 23:30:36 2016 -0700
Committer: Connie Yau <conniey@microsoft.com>
Committed: Sun Jul 31 23:30:36 2016 -0700

----------------------------------------------------------------------
 .../Search/CheckHits.cs                         | 11 ++-
 .../Search/QueryUtils.cs                        |  4 +-
 .../ClassificationTestBase.cs                   |  2 +-
 .../Utils/DataSplitterTest.cs                   |  2 +-
 .../TestDemoExpressions.cs                      |  2 +-
 .../TestExpressionRescorer.cs                   |  2 +-
 .../TestExpressionSorts.cs                      |  2 +-
 .../Range/TestRangeFacetCounts.cs               | 22 ++---
 .../SortedSet/TestSortedSetDocValuesFacets.cs   | 12 +--
 .../Taxonomy/TestTaxonomyFacetAssociations.cs   | 10 +-
 .../Taxonomy/TestTaxonomyFacetCounts.cs         | 18 ++--
 .../Taxonomy/TestTaxonomyFacetCounts2.cs        |  2 +-
 .../Taxonomy/TestTaxonomyFacetSumValueSource.cs |  8 +-
 .../TestDrillDownQuery.cs                       |  2 +-
 src/Lucene.Net.Tests.Facet/TestDrillSideways.cs |  8 +-
 .../TestRandomSamplingFacetsCollector.cs        |  2 +-
 .../Lucene.Net.Tests.Join.csproj                |  2 +-
 src/Lucene.Net.Tests.Join/TestBlockJoin.cs      | 28 +++---
 .../BooleanFilterTest.cs                        |  2 +-
 .../ChainedFilterTest.cs                        |  4 +-
 .../CommonTermsQueryTest.cs                     |  6 +-
 .../Function/TestBoostedQuery.cs                |  2 +-
 .../Function/TestFieldScoreQuery.cs             |  2 +-
 .../Function/TestLongNormValueSource.cs         |  2 +-
 .../Function/TestOrdValues.cs                   |  4 +-
 .../Function/TestValueSources.cs                |  4 +-
 .../Mlt/TestMoreLikeThis.cs                     |  4 +-
 src/Lucene.Net.Tests.Queries/TermFilterTest.cs  |  4 +-
 src/Lucene.Net.Tests.Queries/TermsFilterTest.cs | 12 +--
 .../TestCustomScoreQuery.cs                     | 10 +-
 .../core/Analysis/TestCachingTokenFilter.cs     |  2 +-
 .../core/Analysis/TestMockAnalyzer.cs           |  2 +-
 .../core/Document/TestBinaryDocument.cs         |  4 +-
 .../core/Document/TestDocument.cs               | 10 +-
 .../core/Index/TestAddIndexes.cs                | 14 +--
 .../core/Index/TestBinaryDocValuesUpdates.cs    |  3 +-
 .../core/Index/TestBinaryTerms.cs               |  2 +-
 .../core/Index/TestCodecHoldsOpenFiles.cs       |  4 +-
 .../core/Index/TestCompoundFile.cs              |  2 +-
 src/Lucene.Net.Tests/core/Index/TestCrash.cs    |  6 +-
 .../core/Index/TestDirectoryReader.cs           |  2 +-
 .../core/Index/TestDirectoryReaderReopen.cs     |  6 +-
 src/Lucene.Net.Tests/core/Index/TestDocCount.cs |  2 +-
 .../core/Index/TestDocValuesIndexing.cs         | 12 +--
 .../core/Index/TestDocValuesWithThreads.cs      |  2 +-
 .../core/Index/TestDocsAndPositions.cs          |  4 +-
 .../core/Index/TestFieldsReader.cs              |  2 +-
 .../core/Index/TestIndexWriter.cs               |  4 +-
 .../core/Index/TestIndexWriterDelete.cs         |  4 +-
 .../core/Index/TestIndexWriterExceptions.cs     |  4 +-
 .../core/Index/TestIndexWriterReader.cs         |  8 +-
 .../core/Index/TestIndexWriterUnicode.cs        |  2 +-
 .../core/Index/TestIndexableField.cs            |  2 +-
 .../core/Index/TestIsCurrent.cs                 |  2 +-
 .../core/Index/TestOmitPositions.cs             |  4 +-
 src/Lucene.Net.Tests/core/Index/TestPayloads.cs |  6 +-
 .../core/Index/TestPayloadsOnVectors.cs         |  4 +-
 .../core/Index/TestPostingsOffsets.cs           |  2 +-
 src/Lucene.Net.Tests/core/Index/TestRollback.cs |  2 +-
 .../core/Index/TestSameTokenSamePosition.cs     |  4 +-
 .../core/Index/TestSizeBoundedForceMerge.cs     |  2 +-
 .../core/Index/TestStressAdvance.cs             |  2 +-
 .../core/Index/TestStressIndexing.cs            | 10 +-
 .../core/Index/TestStressIndexing2.cs           |  4 +-
 .../core/Index/TestStressNRT.cs                 |  2 +-
 .../core/Index/TestSumDocFreq.cs                |  2 +-
 .../core/Index/TestTermVectorsReader.cs         |  2 +-
 .../core/Index/TestTermsEnum.cs                 |  6 +-
 .../core/Index/TestTransactions.cs              |  4 +-
 .../core/Search/Payloads/PayloadHelper.cs       |  2 +-
 .../Search/Payloads/TestPayloadTermQuery.cs     |  2 +-
 .../core/Search/Similarities/TestSimilarity2.cs | 14 +--
 .../Search/Similarities/TestSimilarityBase.cs   |  2 +-
 .../core/Search/Spans/TestBasics.cs             |  2 +-
 .../Search/Spans/TestFieldMaskingSpanQuery.cs   |  2 +-
 .../core/Search/Spans/TestNearSpansOrdered.cs   |  2 +-
 .../core/Search/Spans/TestSpanFirstQuery.cs     |  2 +-
 .../Spans/TestSpanMultiTermQueryWrapper.cs      |  2 +-
 .../core/Search/Spans/TestSpans.cs              |  2 +-
 .../core/Search/Spans/TestSpansAdvanced.cs      |  4 +-
 .../core/Search/TestAutomatonQuery.cs           |  2 +-
 .../core/Search/TestAutomatonQueryUnicode.cs    |  2 +-
 .../core/Search/TestBoolean2.cs                 |  6 +-
 .../core/Search/TestBooleanMinShouldMatch.cs    |  8 +-
 .../core/Search/TestBooleanOr.cs                |  4 +-
 .../core/Search/TestBooleanQuery.cs             |  6 +-
 .../core/Search/TestBooleanScorer.cs            |  8 +-
 .../core/Search/TestCachingWrapperFilter.cs     | 22 ++---
 .../core/Search/TestConstantScoreQuery.cs       |  6 +-
 .../core/Search/TestCustomSearcherSort.cs       |  2 +-
 .../core/Search/TestDateFilter.cs               |  4 +-
 .../core/Search/TestDateSort.cs                 |  2 +-
 .../core/Search/TestDisjunctionMaxQuery.cs      | 24 ++---
 .../core/Search/TestDocIdSet.cs                 |  4 +-
 .../core/Search/TestDocValuesScoring.cs         | 18 ++--
 .../core/Search/TestEarlyTermination.cs         |  2 +-
 .../core/Search/TestExplanations.cs             |  2 +-
 .../core/Search/TestFieldCacheTermsFilter.cs    |  2 +-
 .../core/Search/TestFilteredQuery.cs            | 22 ++---
 .../core/Search/TestFuzzyQuery.cs               | 14 +--
 .../core/Search/TestIndexSearcher.cs            |  4 +-
 .../core/Search/TestMinShouldMatch2.cs          |  4 +-
 .../core/Search/TestMultiPhraseQuery.cs         | 18 ++--
 .../core/Search/TestMultiTermQueryRewrites.cs   |  6 +-
 .../core/Search/TestNGramPhraseQuery.cs         |  4 +-
 src/Lucene.Net.Tests/core/Search/TestNot.cs     |  2 +-
 .../core/Search/TestNumericRangeQuery32.cs      |  2 +-
 .../core/Search/TestNumericRangeQuery64.cs      |  2 +-
 .../core/Search/TestPhrasePrefixQuery.cs        |  2 +-
 .../core/Search/TestPhraseQuery.cs              | 64 ++++++-------
 .../core/Search/TestPositionIncrement.cs        |  4 +-
 .../Search/TestPositiveScoresOnlyCollector.cs   |  2 +-
 .../core/Search/TestPrefixFilter.cs             |  2 +-
 .../core/Search/TestPrefixInBooleanQuery.cs     |  2 +-
 .../core/Search/TestPrefixQuery.cs              |  2 +-
 .../core/Search/TestQueryRescorer.cs            | 10 +-
 .../core/Search/TestQueryWrapperFilter.cs       |  6 +-
 .../core/Search/TestRegexpQuery.cs              |  2 +-
 .../core/Search/TestSameScoresWithThreads.cs    |  2 +-
 .../Search/TestScoreCachingWrappingScorer.cs    |  2 +-
 .../core/Search/TestSearchAfter.cs              |  2 +-
 .../core/Search/TestSearchWithThreads.cs        |  2 +-
 .../core/Search/TestSearcherManager.cs          |  6 +-
 .../core/Search/TestSloppyPhraseQuery.cs        | 10 +-
 src/Lucene.Net.Tests/core/Search/TestSort.cs    | 98 ++++++++++----------
 .../core/Search/TestSortDocValues.cs            | 54 +++++------
 .../core/Search/TestSortRandom.cs               |  4 +-
 .../core/Search/TestSortRescorer.cs             |  4 +-
 .../core/Search/TestTermVectors.cs              |  2 +-
 .../core/Search/TestTopDocsCollector.cs         |  2 +-
 .../core/Search/TestTopDocsMerge.cs             |  2 +-
 .../core/Search/TestTopFieldCollector.cs        |  2 +-
 .../core/Search/TestTopScoreDocCollector.cs     |  2 +-
 .../core/Search/TestTotalHitCountCollector.cs   |  2 +-
 .../core/Search/TestWildcard.cs                 |  2 +-
 .../core/Store/TestLockFactory.cs               |  2 +-
 136 files changed, 446 insertions(+), 444 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.TestFramework/Search/CheckHits.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/CheckHits.cs b/src/Lucene.Net.TestFramework/Search/CheckHits.cs
index d2d3f54..f7c77aa 100644
--- a/src/Lucene.Net.TestFramework/Search/CheckHits.cs
+++ b/src/Lucene.Net.TestFramework/Search/CheckHits.cs
@@ -7,6 +7,7 @@ using System.Text;
 namespace Lucene.Net.Search
 {
     using NUnit.Framework;
+    using Similarities;
     using System.IO;
 
     /*
@@ -91,9 +92,9 @@ namespace Lucene.Net.Search
         /// <param name="defaultFieldName"> used for displaying the query in assertion messages </param>
         /// <param name="results"> a list of documentIds that must match the query </param>
         /// <seealso cref= #checkHits </seealso>
-        public static void CheckHitCollector(Random random, Query query, string defaultFieldName, IndexSearcher searcher, int[] results)
+        public static void CheckHitCollector(Random random, Query query, string defaultFieldName, IndexSearcher searcher, int[] results, Similarity similarity)
         {
-            QueryUtils.Check(random, query, searcher);
+            QueryUtils.Check(random, query, searcher, similarity);
 
             Trace.TraceInformation("Checked");
 
@@ -112,7 +113,7 @@ namespace Lucene.Net.Search
             for (int i = -1; i < 2; i++)
             {
                 actual.Clear();
-                IndexSearcher s = QueryUtils.WrapUnderlyingReader(random, searcher, i);
+                IndexSearcher s = QueryUtils.WrapUnderlyingReader(random, searcher, i, similarity);
                 s.Search(query, c);
                 Assert.AreEqual(correct, actual, "Wrap Reader " + i + ": " + query.ToString(defaultFieldName));
             }
@@ -170,7 +171,7 @@ namespace Lucene.Net.Search
         /// <param name="defaultFieldName"> used for displaing the query in assertion messages </param>
         /// <param name="results"> a list of documentIds that must match the query </param>
         /// <seealso cref= #checkHitCollector </seealso>
-        public static void DoCheckHits(Random random, Query query, string defaultFieldName, IndexSearcher searcher, int[] results)
+        public static void DoCheckHits(Random random, Query query, string defaultFieldName, IndexSearcher searcher, int[] results, Similarity similarity)
         {
             ScoreDoc[] hits = searcher.Search(query, 1000).ScoreDocs;
 
@@ -188,7 +189,7 @@ namespace Lucene.Net.Search
 
             Assert.AreEqual(correct, actual, query.ToString(defaultFieldName));
 
-            QueryUtils.Check(random, query, searcher, LuceneTestCase.Rarely(random));
+            QueryUtils.Check(random, query, searcher, LuceneTestCase.Rarely(random), similarity);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
index 1c61c6e..88ff11d 100644
--- a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
+++ b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
@@ -123,9 +123,9 @@ namespace Lucene.Net.Search
         /// <seealso cref= #checkSkipTo </seealso>
         /// <seealso cref= #checkExplanations </seealso>
         /// <seealso cref= #checkEqual </seealso>
-        public static void Check(Random random, Query q1, IndexSearcher s)
+        public static void Check(Random random, Query q1, IndexSearcher s, Similarity similarity)
         {
-            Check(random, q1, s, true);
+            Check(random, q1, s, true, similarity);
         }
 
         public static void Check(Random random, Query q1, IndexSearcher s, bool wrap, Similarity similarity)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Classification/ClassificationTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Classification/ClassificationTestBase.cs b/src/Lucene.Net.Tests.Classification/ClassificationTestBase.cs
index 4762408..3ab492c 100644
--- a/src/Lucene.Net.Tests.Classification/ClassificationTestBase.cs
+++ b/src/Lucene.Net.Tests.Classification/ClassificationTestBase.cs
@@ -57,7 +57,7 @@ namespace Lucene.Net.Classification
         {
             base.SetUp();
             dir = NewDirectory();
-            indexWriter = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            indexWriter = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             textFieldName = "text";
             categoryFieldName = "cat";
             booleanFieldName = "bool";

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs b/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs
index 792b268..765e262 100644
--- a/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs
+++ b/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs
@@ -45,7 +45,7 @@ namespace Lucene.Net.Classification
         {
             base.SetUp();
             _dir = NewDirectory();
-            _indexWriter = new RandomIndexWriter(Random(), _dir, new MockAnalyzer(Random()));
+            _indexWriter = new RandomIndexWriter(Random(), _dir, new MockAnalyzer(Random()), Similarity, TimeZone);
 
             FieldType ft = new FieldType(TextField.TYPE_STORED);
             ft.StoreTermVectors = true;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Expressions/TestDemoExpressions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Expressions/TestDemoExpressions.cs b/src/Lucene.Net.Tests.Expressions/TestDemoExpressions.cs
index 5e99845..21e5656 100644
--- a/src/Lucene.Net.Tests.Expressions/TestDemoExpressions.cs
+++ b/src/Lucene.Net.Tests.Expressions/TestDemoExpressions.cs
@@ -25,7 +25,7 @@ namespace Lucene.Net.Tests.Expressions
 		{
 			base.SetUp();
 			dir = NewDirectory();
-			var iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+			var iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 			var doc = new Document
 			{
 			    NewStringField("id", "1", Field.Store.YES),

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Expressions/TestExpressionRescorer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Expressions/TestExpressionRescorer.cs b/src/Lucene.Net.Tests.Expressions/TestExpressionRescorer.cs
index 9c0d15c..854f634 100644
--- a/src/Lucene.Net.Tests.Expressions/TestExpressionRescorer.cs
+++ b/src/Lucene.Net.Tests.Expressions/TestExpressionRescorer.cs
@@ -21,7 +21,7 @@ namespace Lucene.Net.Tests.Expressions
 		{
 			base.SetUp();
 			dir = NewDirectory();
-			var iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+			var iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 			var doc = new Document
 			{
 			    NewStringField("id", "1", Field.Store.YES),

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs b/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs
index a69a93c..46084c7 100644
--- a/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs
+++ b/src/Lucene.Net.Tests.Expressions/TestExpressionSorts.cs
@@ -32,7 +32,7 @@ namespace Lucene.Net.Tests.Expressions
         {
             base.SetUp();
             dir = NewDirectory();
-            var iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            var iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             int numDocs = TestUtil.NextInt(Random(), 2049, 4000);
             for (int i = 0; i < numDocs; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
index d2a296b..e3a2623 100644
--- a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
@@ -72,7 +72,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestBasicLong()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document doc = new Document();
             NumericDocValuesField field = new NumericDocValuesField("field", 0L);
             doc.Add(field);
@@ -149,7 +149,7 @@ namespace Lucene.Net.Facet.Range
         {
 
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document doc = new Document();
             NumericDocValuesField field = new NumericDocValuesField("field", 0L);
             doc.Add(field);
@@ -180,7 +180,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestOverlappedEndStart()
         {
             Directory d = NewDirectory();
-            var w = new RandomIndexWriter(Random(), d);
+            var w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document doc = new Document();
             NumericDocValuesField field = new NumericDocValuesField("field", 0L);
             doc.Add(field);
@@ -216,7 +216,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestMixedRangeAndNonRangeTaxonomy()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Directory td = NewDirectory();
             DirectoryTaxonomyWriter tw = new DirectoryTaxonomyWriter(td, IndexWriterConfig.OpenMode_e.CREATE);
 
@@ -331,7 +331,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestBasicDouble()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document doc = new Document();
             DoubleDocValuesField field = new DoubleDocValuesField("field", 0.0);
             doc.Add(field);
@@ -358,7 +358,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestBasicFloat()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document doc = new Document();
             FloatDocValuesField field = new FloatDocValuesField("field", 0.0f);
             doc.Add(field);
@@ -386,7 +386,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestRandomLongs()
         {
             Directory dir = NewDirectory();
-            var w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            var w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             int numDocs = AtLeast(1000);
             if (VERBOSE)
@@ -579,7 +579,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestRandomFloats()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             int numDocs = AtLeast(1000);
             float[] values = new float[numDocs];
@@ -784,7 +784,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestRandomDoubles()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             int numDocs = AtLeast(1000);
             double[] values = new double[numDocs];
@@ -973,7 +973,7 @@ namespace Lucene.Net.Facet.Range
         {
             AssumeTrue("codec does not support docsWithField", DefaultCodecSupportsDocsWithField());
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document doc = new Document();
             NumericDocValuesField field = new NumericDocValuesField("field", 0L);
             doc.Add(field);
@@ -1006,7 +1006,7 @@ namespace Lucene.Net.Facet.Range
         public virtual void TestCustomDoublesValueSource()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             writer.AddDocument(doc);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs b/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs
index 51c26ec..7b42c55 100644
--- a/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs
+++ b/src/Lucene.Net.Tests.Facet/SortedSet/TestSortedSetDocValuesFacets.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Facet.SortedSet
 
             FacetsConfig config = new FacetsConfig();
             config.SetMultiValued("a", true);
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(new SortedSetDocValuesFacetField("a", "foo"));
@@ -105,7 +105,7 @@ namespace Lucene.Net.Facet.SortedSet
             AssumeTrue("Test requires SortedSetDV support", DefaultCodecSupportsSortedSet());
             Directory dir = NewDirectory();
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             FacetsConfig config = new FacetsConfig();
 
@@ -153,7 +153,7 @@ namespace Lucene.Net.Facet.SortedSet
             AssumeTrue("Test requires SortedSetDV support", DefaultCodecSupportsSortedSet());
             Directory dir = NewDirectory();
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             FacetsConfig config = new FacetsConfig();
 
@@ -211,7 +211,7 @@ namespace Lucene.Net.Facet.SortedSet
             AssumeTrue("Test requires SortedSetDV support", DefaultCodecSupportsSortedSet());
             Directory dir = NewDirectory();
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             FacetsConfig config = new FacetsConfig();
 
@@ -253,7 +253,7 @@ namespace Lucene.Net.Facet.SortedSet
             AssumeTrue("Test requires SortedSetDV support", DefaultCodecSupportsSortedSet());
             Directory dir = NewDirectory();
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             FacetsConfig config = new FacetsConfig();
 
@@ -292,7 +292,7 @@ namespace Lucene.Net.Facet.SortedSet
             Directory indexDir = NewDirectory();
             Directory taxoDir = NewDirectory();
 
-            RandomIndexWriter w = new RandomIndexWriter(Random(), indexDir);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), indexDir, Similarity, TimeZone);
             FacetsConfig config = new FacetsConfig();
             int numDocs = AtLeast(1000);
             int numDims = TestUtil.NextInt(Random(), 1, 7);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs
index 74f66f3..2df9d52 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetAssociations.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
 
         [TestFixtureSetUp]
-        public static void BeforeClass()
+        public void BeforeClass()
         {
             dir = NewDirectory();
             taxoDir = NewDirectory();
@@ -62,7 +62,7 @@ namespace Lucene.Net.Facet.Taxonomy
             config.SetIndexFieldName("float", "$facets.float");
             config.SetMultiValued("float", true);
 
-            var writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            var writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             // index documents, 50% have only 'b' and all have 'a'
             for (int i = 0; i < 110; i++)
@@ -190,7 +190,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
             TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
             FacetsConfig config = new FacetsConfig();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(new IntAssociationFacetField(14, "a", "x"));
@@ -216,7 +216,7 @@ namespace Lucene.Net.Facet.Taxonomy
             TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
             FacetsConfig config = new FacetsConfig();
             config.SetHierarchical("a", true);
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(new IntAssociationFacetField(14, "a", "x"));
@@ -241,7 +241,7 @@ namespace Lucene.Net.Facet.Taxonomy
             TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
             FacetsConfig config = new FacetsConfig();
             config.SetRequireDimCount("a", true);
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(new IntAssociationFacetField(14, "a", "x"));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
index 27aba82..a2b412e 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
@@ -67,7 +67,7 @@ namespace Lucene.Net.Facet.Taxonomy
             FacetsConfig config = new FacetsConfig();
             config.SetHierarchical("Publish Date", true);
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(new FacetField("Author", "Bob"));
@@ -152,7 +152,7 @@ namespace Lucene.Net.Facet.Taxonomy
             // main index:
             var taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode_e.CREATE);
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             FacetsConfig config = new FacetsConfig();
 
             Document doc = new Document();
@@ -214,7 +214,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
             FacetsConfig config = new FacetsConfig();
             config.SetIndexFieldName("a", "$facets2");
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(new FacetField("a", "foo1"));
@@ -318,7 +318,7 @@ namespace Lucene.Net.Facet.Taxonomy
             FacetsConfig config = new FacetsConfig();
             config.SetHierarchical("a", true);
             config.SetMultiValued("a", true);
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(NewTextField("field", "text", Field.Store.NO));
@@ -364,7 +364,7 @@ namespace Lucene.Net.Facet.Taxonomy
         {
             Store.Directory dir = NewDirectory();
             Store.Directory taxoDir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             var taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode_e.CREATE);
 
             FacetsConfig config = new FacetsConfig();
@@ -399,7 +399,7 @@ namespace Lucene.Net.Facet.Taxonomy
         {
             Store.Directory dir = NewDirectory();
             Store.Directory taxoDir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode_e.CREATE);
 
             FacetsConfig config = new FacetsConfig();
@@ -510,7 +510,7 @@ namespace Lucene.Net.Facet.Taxonomy
             Store.Directory dir = NewDirectory();
             Store.Directory taxoDir = NewDirectory();
             var taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode_e.CREATE);
-            var writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            var writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             FacetsConfig config = new FacetsConfig();
 
             Document doc = new Document();
@@ -536,7 +536,7 @@ namespace Lucene.Net.Facet.Taxonomy
             Store.Directory dir = NewDirectory();
             Store.Directory taxoDir = NewDirectory();
             TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode_e.CREATE);
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             FacetsConfig config = new FacetsConfig();
 
             Document doc = new Document();
@@ -749,7 +749,7 @@ namespace Lucene.Net.Facet.Taxonomy
             Store.Directory indexDir = NewDirectory();
             Store.Directory taxoDir = NewDirectory();
 
-            RandomIndexWriter w = new RandomIndexWriter(Random(), indexDir);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), indexDir, Similarity, TimeZone);
             var tw = new DirectoryTaxonomyWriter(taxoDir);
             FacetsConfig config = new FacetsConfig();
             int numDocs = AtLeast(1000);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
index 30f9633..6cc8314 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
@@ -246,7 +246,7 @@ namespace Lucene.Net.Facet.Taxonomy
         }
 
         [TestFixtureSetUp]
-        public static void BeforeClassCountingFacetsAggregatorTest()
+        public void BeforeClassCountingFacetsAggregatorTest()
         {
             indexDir = NewDirectory();
             taxoDir = NewDirectory();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
index 3ec1ef6..21ede3c 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
@@ -75,7 +75,7 @@ namespace Lucene.Net.Facet.Taxonomy
             // main index:
             DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode_e.CREATE);
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             FacetsConfig config = new FacetsConfig();
 
             // Reused across documents, to add the necessary facet
@@ -144,7 +144,7 @@ namespace Lucene.Net.Facet.Taxonomy
             // main index:
             var taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode_e.CREATE);
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             FacetsConfig config = new FacetsConfig();
 
             Document doc = new Document();
@@ -213,7 +213,7 @@ namespace Lucene.Net.Facet.Taxonomy
             FacetsConfig config = new FacetsConfig();
             config.SetIndexFieldName("a", "$facets2");
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(new IntField("num", 10, Field.Store.NO));
@@ -498,7 +498,7 @@ namespace Lucene.Net.Facet.Taxonomy
             Store.Directory indexDir = NewDirectory();
             Store.Directory taxoDir = NewDirectory();
 
-            RandomIndexWriter w = new RandomIndexWriter(Random(), indexDir);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), indexDir, Similarity, TimeZone);
             var tw = new DirectoryTaxonomyWriter(taxoDir);
             FacetsConfig config = new FacetsConfig();
             int numDocs = AtLeast(1000);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs b/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs
index 49ce90a..3ceb005 100644
--- a/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs
+++ b/src/Lucene.Net.Tests.Facet/TestDrillDownQuery.cs
@@ -68,7 +68,7 @@ namespace Lucene.Net.Facet
         }
 
         [TestFixtureSetUp]
-        public static void BeforeClassDrillDownQueryTest()
+        public void BeforeClassDrillDownQueryTest()
         {
             dir = NewDirectory();
             Random r = Random();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
index e0add44..366a16a 100644
--- a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
+++ b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
@@ -81,7 +81,7 @@ namespace Lucene.Net.Facet
             FacetsConfig config = new FacetsConfig();
             config.SetHierarchical("Publish Date", true);
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(new FacetField("Author", "Bob"));
@@ -252,7 +252,7 @@ namespace Lucene.Net.Facet
         {
             Directory dir = NewDirectory();
             Directory taxoDir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             // Writes facet ords to a separate directory from the
             // main index:
@@ -308,7 +308,7 @@ namespace Lucene.Net.Facet
         {
             Directory dir = NewDirectory();
             Directory taxoDir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             // Writes facet ords to a separate directory from the
             // main index:
@@ -1307,7 +1307,7 @@ namespace Lucene.Net.Facet
             // LUCENE-5045: make sure DrillSideways works with an empty index
             Directory dir = NewDirectory();
             Directory taxoDir = NewDirectory();
-            var writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            var writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             var taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode_e.CREATE);
             IndexSearcher searcher = NewSearcher(writer.Reader);
             var taxoReader = new DirectoryTaxonomyReader(taxoWriter);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs b/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs
index 69df3c9..7b5915b 100644
--- a/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs
+++ b/src/Lucene.Net.Tests.Facet/TestRandomSamplingFacetsCollector.cs
@@ -49,7 +49,7 @@ namespace Lucene.Net.Facet
             Directory taxoDir = NewDirectory();
 
             DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             FacetsConfig config = new FacetsConfig();
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Join/Lucene.Net.Tests.Join.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Join/Lucene.Net.Tests.Join.csproj b/src/Lucene.Net.Tests.Join/Lucene.Net.Tests.Join.csproj
index f49b920..838b1fd 100644
--- a/src/Lucene.Net.Tests.Join/Lucene.Net.Tests.Join.csproj
+++ b/src/Lucene.Net.Tests.Join/Lucene.Net.Tests.Join.csproj
@@ -31,7 +31,7 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
-      <HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
+      <HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
       <Private>True</Private>
     </Reference>
     <Reference Include="System" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Join/TestBlockJoin.cs b/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
index 2359946..c140c75 100644
--- a/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
+++ b/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
@@ -131,7 +131,7 @@ namespace Lucene.Net.Tests.Join
         public void TestSimple()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             IList<Document> docs = new List<Document>();
 
@@ -221,7 +221,7 @@ namespace Lucene.Net.Tests.Join
         public void TestBugCausedByRewritingTwice()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             IList<Document> docs = new List<Document>();
 
@@ -278,7 +278,7 @@ namespace Lucene.Net.Tests.Join
         public virtual void TestSimpleFilter()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             IList<Document> docs = new List<Document>();
             docs.Add(MakeJob("java", 2007));
@@ -376,13 +376,13 @@ namespace Lucene.Net.Tests.Join
         public void TestBoostBug()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             IndexReader r = w.Reader;
             w.Dispose();
             IndexSearcher s = NewSearcher(r);
 
             ToParentBlockJoinQuery q = new ToParentBlockJoinQuery(new MatchAllDocsQuery(), new QueryWrapperFilter(new MatchAllDocsQuery()), ScoreMode.Avg);
-            QueryUtils.Check(Random(), q, s);
+            QueryUtils.Check(Random(), q, s, Similarity);
             s.Search(q, 10);
             BooleanQuery bq = new BooleanQuery();
             bq.Boost = 2f; // we boost the BQ
@@ -521,8 +521,8 @@ namespace Lucene.Net.Tests.Join
             IList<int> toDelete = new List<int>();
 
             // TODO: parallel star join, nested join cases too!
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
-            RandomIndexWriter joinW = new RandomIndexWriter(Random(), joinDir);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
+            RandomIndexWriter joinW = new RandomIndexWriter(Random(), joinDir, Similarity, TimeZone);
             for (int parentDocID = 0; parentDocID < numParentDocs; parentDocID++)
             {
                 Document parentDoc = new Document();
@@ -1125,7 +1125,7 @@ namespace Lucene.Net.Tests.Join
         public void TestMultiChildTypes()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             IList<Document> docs = new List<Document>();
 
@@ -1212,7 +1212,7 @@ namespace Lucene.Net.Tests.Join
         public void TestAdvanceSingleParentSingleChild()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document childDoc = new Document();
             childDoc.Add(NewStringField("child", "1", Field.Store.NO));
             Document parentDoc = new Document();
@@ -1271,7 +1271,7 @@ namespace Lucene.Net.Tests.Join
         {
 
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             IList<Document> docs = new List<Document>();
             docs.Add(MakeJob("ruby", 2005));
@@ -1365,7 +1365,7 @@ namespace Lucene.Net.Tests.Join
         public void TestSometimesParentOnlyMatches()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document parent = new Document();
             parent.Add(new StoredField("parentID", "0"));
             parent.Add(NewTextField("parentText", "text", Field.Store.NO));
@@ -1430,7 +1430,7 @@ namespace Lucene.Net.Tests.Join
         public void TestChildQueryNeverMatches()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document parent = new Document();
             parent.Add(new StoredField("parentID", "0"));
             parent.Add(NewTextField("parentText", "text", Field.Store.NO));
@@ -1496,7 +1496,7 @@ namespace Lucene.Net.Tests.Join
         public void TestChildQueryMatchesParent()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             Document parent = new Document();
             parent.Add(new StoredField("parentID", "0"));
             parent.Add(NewTextField("parentText", "text", Field.Store.NO));
@@ -1547,7 +1547,7 @@ namespace Lucene.Net.Tests.Join
         public void TestAdvanceSingleDeletedParentNoChild()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             // First doc with 1 children
             Document parentDoc = new Document();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs b/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
index 2bd949a..3b5e22a 100644
--- a/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/BooleanFilterTest.cs
@@ -19,7 +19,7 @@ namespace Lucene.Net.Tests.Queries
         {
             base.SetUp();
             directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false), Similarity, TimeZone);
 
             AddDoc(writer, @"admin guest", @"010", @"20040101", @"Y");
             AddDoc(writer, @"guest", @"020", @"20040101", @"Y");

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs b/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
index 9d63a8c..cd6255d 100644
--- a/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/ChainedFilterTest.cs
@@ -28,7 +28,7 @@ namespace Lucene.Net.Tests.Queries
         {
             base.SetUp();
             directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
             // we use the default Locale/TZ since LuceneTestCase randomizes it
             var cal = new DateTime(1970, 1, 1, 0, 0, 0, (int)TestUtil.NextLong(Random(), 0, long.MaxValue), new GregorianCalendar());
 
@@ -160,7 +160,7 @@ namespace Lucene.Net.Tests.Queries
         public virtual void TestWithCachingFilter()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             IndexReader reader = writer.Reader;
             writer.Dispose();
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs b/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
index 05c43cd..a9dc7b4 100644
--- a/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
+++ b/src/Lucene.Net.Tests.Queries/CommonTermsQueryTest.cs
@@ -21,7 +21,7 @@ namespace Lucene.Net.Tests.Queries
         {
             Directory dir = NewDirectory();
             MockAnalyzer analyzer = new MockAnalyzer(Random());
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, analyzer);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, analyzer, Similarity, TimeZone);
             var docs = new string[]
             {
                 @"this is the end of the world right", @"is this it or maybe not",
@@ -153,7 +153,7 @@ namespace Lucene.Net.Tests.Queries
         {
             Directory dir = NewDirectory();
             MockAnalyzer analyzer = new MockAnalyzer(Random());
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, analyzer);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, analyzer, Similarity, TimeZone);
             string[] docs = new string[]
             {
                 @"this is the end of the world right", @"is this it or maybe not",
@@ -305,7 +305,7 @@ namespace Lucene.Net.Tests.Queries
         {
             Directory dir = NewDirectory();
             MockAnalyzer analyzer = new MockAnalyzer(Random());
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, analyzer);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, analyzer, Similarity, TimeZone);
             var docs = new string[]
             {
                 @"this is the end of the world right", @"is this it or maybe not",

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs b/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
index 8ddd281..39ee59d 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestBoostedQuery.cs
@@ -71,7 +71,7 @@ namespace Lucene.Net.Tests.Queries.Function
                 expected[i] = new ScoreDoc(i, scores[i]);
             }
             TopDocs docs = @is.Search(q, 10, new Sort(new SortField("id", SortField.Type_e.STRING)));
-            CheckHits.DoCheckHits(Random(), q, "", @is, expectedDocs);
+            CheckHits.DoCheckHits(Random(), q, "", @is, expectedDocs, Similarity);
             CheckHits.CheckHitsQuery(q, expected, docs.ScoreDocs, expectedDocs);
             CheckHits.CheckExplanations(q, "", @is);
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
index 39938bd..13495cb 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestFieldScoreQuery.cs
@@ -76,7 +76,7 @@ namespace Lucene.Net.Tests.Queries.Function
             IndexReader r = DirectoryReader.Open(dir);
             IndexSearcher s = NewSearcher(r);
             Log("test: " + functionQuery);
-            QueryUtils.Check(Random(), functionQuery, s);
+            QueryUtils.Check(Random(), functionQuery, s, Similarity);
             ScoreDoc[] h = s.Search(functionQuery, null, 1000).ScoreDocs;
             assertEquals("All docs should be matched!", N_DOCS, h.Length);
             string prevID = "ID" + (N_DOCS + 1); // greater than all ids of docs in this test

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs b/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
index 38ebe7f..ef0b2f1 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestLongNormValueSource.cs
@@ -89,7 +89,7 @@ namespace Lucene.Net.Tests.Queries.Function
             }
             */
 
-            CheckHits.DoCheckHits(Random(), q, "", searcher, expectedDocs);
+            CheckHits.DoCheckHits(Random(), q, "", searcher, expectedDocs, Similarity);
             CheckHits.CheckHitsQuery(q, expected, docs.ScoreDocs, expectedDocs);
             CheckHits.CheckExplanations(q, "", searcher);
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
index ef396ee..3067d63 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestOrdValues.cs
@@ -49,7 +49,7 @@ namespace Lucene.Net.Tests.Queries.Function
         /// </summary>
         /// <param name="field"></param>
         /// <param name="inOrder"></param>
-        private static void DoTestRank(string field, bool inOrder)
+        private void DoTestRank(string field, bool inOrder)
         {
             IndexReader r = DirectoryReader.Open(dir);
             IndexSearcher s = NewSearcher(r);
@@ -65,7 +65,7 @@ namespace Lucene.Net.Tests.Queries.Function
 
             Query q = new FunctionQuery(vs);
             Log("test: " + q);
-            QueryUtils.Check(Random(), q, s);
+            QueryUtils.Check(Random(), q, s, Similarity);
             ScoreDoc[] h = s.Search(q, null, 1000).ScoreDocs;
             assertEquals("All docs should be matched!", N_DOCS, h.Length);
             string prevID = inOrder ? "IE" : "IC"; // smaller than all ids of docs in this test ("ID0001", etc.) -  greater than all ids of docs in this test ("ID0001", etc.)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
index d48d41c..4e14abe 100644
--- a/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
+++ b/src/Lucene.Net.Tests.Queries/Function/TestValueSources.cs
@@ -321,7 +321,7 @@ namespace Lucene.Net.Tests.Queries.Function
             }
         }
 
-        private static void AssertHits(Query q, float[] scores)
+        private void AssertHits(Query q, float[] scores)
         {
             ScoreDoc[] expected = new ScoreDoc[scores.Length];
             int[] expectedDocs = new int[scores.Length];
@@ -331,7 +331,7 @@ namespace Lucene.Net.Tests.Queries.Function
                 expected[i] = new ScoreDoc(i, scores[i]);
             }
             TopDocs docs = searcher.Search(q, null, documents.Count, new Sort(new SortField("id", SortField.Type_e.STRING)), true, false);
-            CheckHits.DoCheckHits(Random(), q, "", searcher, expectedDocs);
+            CheckHits.DoCheckHits(Random(), q, "", searcher, expectedDocs, Similarity);
             CheckHits.CheckHitsQuery(q, expected, docs.ScoreDocs, expectedDocs);
             CheckHits.CheckExplanations(q, "", searcher);
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs b/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
index 3b33bdc..bed7c26 100644
--- a/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
+++ b/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
@@ -22,7 +22,7 @@ namespace Lucene.Net.Tests.Queries.Mlt
         {
             base.SetUp();
             directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
 
             // Add series of docs with specific information for MoreLikeThis
             AddDoc(writer, "lucene");
@@ -126,7 +126,7 @@ namespace Lucene.Net.Tests.Queries.Mlt
         public void TestMoreLikeThisQuery()
         {
             Query query = new MoreLikeThisQuery("this is a test", new[] { "text" }, new MockAnalyzer(Random()), "text");
-            QueryUtils.Check(Random(), query, searcher);
+            QueryUtils.Check(Random(), query, searcher, Similarity);
         }
 
         // TODO: add tests for the MoreLikeThisQuery

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/TermFilterTest.cs b/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
index ef19de1..5837c3c 100644
--- a/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/TermFilterTest.cs
@@ -29,7 +29,7 @@ namespace Lucene.Net.Tests.Queries
         {
             string fieldName = @"field1";
             Directory rd = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), rd);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), rd, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField(fieldName, @"value1", Field.Store.NO));
             w.AddDocument(doc);
@@ -54,7 +54,7 @@ namespace Lucene.Net.Tests.Queries
         public void TestRandom()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             int num = AtLeast(100);
             var terms = new List<Term>();
             for (int i = 0; i < num; i++)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs b/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
index 6fbd43f..7c5624d 100644
--- a/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
+++ b/src/Lucene.Net.Tests.Queries/TermsFilterTest.cs
@@ -33,7 +33,7 @@ namespace Lucene.Net.Tests.Queries
         {
             string fieldName = "field1";
             Directory rd = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), rd);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), rd, Similarity, TimeZone);
             for (int i = 0; i < 100; i++)
             {
                 Document doc = new Document();
@@ -72,7 +72,7 @@ namespace Lucene.Net.Tests.Queries
         {
             string fieldName = "field1";
             Directory rd1 = NewDirectory();
-            RandomIndexWriter w1 = new RandomIndexWriter(Random(), rd1);
+            RandomIndexWriter w1 = new RandomIndexWriter(Random(), rd1, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField(fieldName, "content1", Field.Store.YES));
             w1.AddDocument(doc);
@@ -81,7 +81,7 @@ namespace Lucene.Net.Tests.Queries
 
             fieldName = "field2";
             Directory rd2 = NewDirectory();
-            RandomIndexWriter w2 = new RandomIndexWriter(Random(), rd2);
+            RandomIndexWriter w2 = new RandomIndexWriter(Random(), rd2, Similarity, TimeZone);
             doc = new Document();
             doc.Add(NewStringField(fieldName, "content2", Field.Store.YES));
             w2.AddDocument(doc);
@@ -114,7 +114,7 @@ namespace Lucene.Net.Tests.Queries
         public void TestFieldNotPresent()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             int num = AtLeast(3);
             int skip = Random().Next(num);
             var terms = new List<Term>();
@@ -150,7 +150,7 @@ namespace Lucene.Net.Tests.Queries
         public void TestSkipField()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             int num = AtLeast(10);
             var terms = new HashSet<Term>();
             for (int i = 0; i < num; i++)
@@ -192,7 +192,7 @@ namespace Lucene.Net.Tests.Queries
         public void TestRandom()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             int num = AtLeast(100);
             bool singleField = Random().NextBoolean();
             IList<Term> terms = new List<Term>();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs b/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
index 3fbb797..b074df9 100644
--- a/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
+++ b/src/Lucene.Net.Tests.Queries/TestCustomScoreQuery.cs
@@ -334,11 +334,11 @@ namespace Lucene.Net.Tests.Queries
             assertEquals("queries should have same #hits", h1.Count, h4CustomAdd.Count);
             assertEquals("queries should have same #hits", h1.Count, h5CustomMulAdd.Count);
 
-            QueryUtils.Check(Random(), q1, s, Rarely());
-            QueryUtils.Check(Random(), q2, s, Rarely());
-            QueryUtils.Check(Random(), q3, s, Rarely());
-            QueryUtils.Check(Random(), q4, s, Rarely());
-            QueryUtils.Check(Random(), q5, s, Rarely());
+            QueryUtils.Check(Random(), q1, s, Rarely(), Similarity);
+            QueryUtils.Check(Random(), q2, s, Rarely(), Similarity);
+            QueryUtils.Check(Random(), q3, s, Rarely(), Similarity);
+            QueryUtils.Check(Random(), q4, s, Rarely(), Similarity);
+            QueryUtils.Check(Random(), q5, s, Rarely(), Similarity);
 
             // verify scores ratios
             foreach (int doc in h1.Keys)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Analysis/TestCachingTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Analysis/TestCachingTokenFilter.cs b/src/Lucene.Net.Tests/core/Analysis/TestCachingTokenFilter.cs
index 004a4ac..b7d326a 100644
--- a/src/Lucene.Net.Tests/core/Analysis/TestCachingTokenFilter.cs
+++ b/src/Lucene.Net.Tests/core/Analysis/TestCachingTokenFilter.cs
@@ -42,7 +42,7 @@ namespace Lucene.Net.Analysis
         public virtual void TestCaching()
         {
             Directory dir = new RAMDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             TokenStream stream = new TokenStreamAnonymousInnerClassHelper(this);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs b/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs
index 9a52c52..351c4fc 100644
--- a/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs
+++ b/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs
@@ -349,7 +349,7 @@ namespace Lucene.Net.Analysis
             Analyzer @delegate = new MockAnalyzer(Random());
             Analyzer a = new AnalyzerWrapperAnonymousInnerClassHelper2(this, @delegate.Strategy, positionGap, offsetGap, @delegate);
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), NewDirectory());
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), NewDirectory(), Similarity, TimeZone);
             Document doc = new Document();
             FieldType ft = new FieldType();
             ft.Indexed = true;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Document/TestBinaryDocument.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Document/TestBinaryDocument.cs b/src/Lucene.Net.Tests/core/Document/TestBinaryDocument.cs
index 1e010f8..742a0f4 100644
--- a/src/Lucene.Net.Tests/core/Document/TestBinaryDocument.cs
+++ b/src/Lucene.Net.Tests/core/Document/TestBinaryDocument.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Document
             /// add the doc to a ram index </summary>
             Directory dir = NewDirectory();
             Random r = Random();
-            RandomIndexWriter writer = new RandomIndexWriter(r, dir);
+            RandomIndexWriter writer = new RandomIndexWriter(r, dir, Similarity, TimeZone);
             writer.AddDocument(doc);
 
             /// <summary>
@@ -98,7 +98,7 @@ namespace Lucene.Net.Document
             var doc = new Documents.Document {binaryFldCompressed, stringFldCompressed};
 
             using (Directory dir = NewDirectory())
-            using (RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone))
+            using (RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone))
             {
                 writer.AddDocument(doc);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Document/TestDocument.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Document/TestDocument.cs b/src/Lucene.Net.Tests/core/Document/TestDocument.cs
index cc35b32..36ac3b4 100644
--- a/src/Lucene.Net.Tests/core/Document/TestDocument.cs
+++ b/src/Lucene.Net.Tests/core/Document/TestDocument.cs
@@ -190,7 +190,7 @@ namespace Lucene.Net.Document
         public virtual void TestGetValuesForIndexedDocument()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             writer.AddDocument(MakeDocumentWithFields());
             IndexReader reader = writer.Reader;
 
@@ -223,7 +223,7 @@ namespace Lucene.Net.Document
         public virtual void TestPositionIncrementMultiFields()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             writer.AddDocument(MakeDocumentWithFields());
             IndexReader reader = writer.Reader;
 
@@ -303,7 +303,7 @@ namespace Lucene.Net.Document
             doc.Add(new StringField("keyword", "test", Field.Store.YES));
 
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             writer.AddDocument(doc);
             field.StringValue = "id2";
             writer.AddDocument(doc);
@@ -366,7 +366,7 @@ namespace Lucene.Net.Document
         public virtual void TestTransitionAPI()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Documents.Document doc = new Documents.Document();
             doc.Add(new Field("stored", "abc", Field.Store.YES, Field.Index.NO));
@@ -443,7 +443,7 @@ namespace Lucene.Net.Document
             Assert.AreEqual(new string[] { "5", "4" }, doc.GetValues("int"));
 
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             iw.AddDocument(doc);
             DirectoryReader ir = iw.Reader;
             Documents.Document sdoc = ir.Document(0);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs b/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs
index bed2d07..b3bf19f 100644
--- a/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs
@@ -1267,7 +1267,7 @@ namespace Lucene.Net.Index
         public virtual void TestFieldNamesChanged()
         {
             Directory d1 = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d1);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d1, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("f1", "doc1 field1", Field.Store.YES));
             doc.Add(NewStringField("id", "1", Field.Store.YES));
@@ -1276,7 +1276,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             Directory d2 = NewDirectory();
-            w = new RandomIndexWriter(Random(), d2);
+            w = new RandomIndexWriter(Random(), d2, Similarity, TimeZone);
             doc = new Document();
             doc.Add(NewStringField("f2", "doc2 field2", Field.Store.YES));
             doc.Add(NewStringField("id", "2", Field.Store.YES));
@@ -1285,7 +1285,7 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             Directory d3 = NewDirectory();
-            w = new RandomIndexWriter(Random(), d3);
+            w = new RandomIndexWriter(Random(), d3, Similarity, TimeZone);
             w.AddIndexes(r1, r2);
             r1.Dispose();
             d1.Dispose();
@@ -1315,7 +1315,7 @@ namespace Lucene.Net.Index
         public virtual void TestAddEmpty()
         {
             Directory d1 = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d1);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d1, Similarity, TimeZone);
             MultiReader empty = new MultiReader();
             w.AddIndexes(empty);
             w.Dispose();
@@ -1336,12 +1336,12 @@ namespace Lucene.Net.Index
         public virtual void TestFakeAllDeleted()
         {
             Directory src = NewDirectory(), dest = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), src);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), src, Similarity, TimeZone);
             w.AddDocument(new Document());
             IndexReader allDeletedReader = new AllDeletedFilterReader((AtomicReader)w.Reader.Leaves[0].Reader);
             w.Dispose();
 
-            w = new RandomIndexWriter(Random(), dest);
+            w = new RandomIndexWriter(Random(), dest, Similarity, TimeZone);
             w.AddIndexes(allDeletedReader);
             w.Dispose();
             DirectoryReader dr = DirectoryReader.Open(src);
@@ -1363,7 +1363,7 @@ namespace Lucene.Net.Index
         public virtual void TestLocksBlock()
         {
             Directory src = NewDirectory();
-            RandomIndexWriter w1 = new RandomIndexWriter(Random(), src);
+            RandomIndexWriter w1 = new RandomIndexWriter(Random(), src, Similarity, TimeZone);
             w1.AddDocument(new Document());
             w1.Commit();
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestBinaryDocValuesUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestBinaryDocValuesUpdates.cs b/src/Lucene.Net.Tests/core/Index/TestBinaryDocValuesUpdates.cs
index 2caa695..eadd065 100644
--- a/src/Lucene.Net.Tests/core/Index/TestBinaryDocValuesUpdates.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestBinaryDocValuesUpdates.cs
@@ -1110,6 +1110,7 @@ namespace Lucene.Net.Index
         public virtual void TestUpdateOldSegments()
         {
             OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
+
             Codec[] oldCodecs = new Codec[] {
                 new Lucene40RWCodec(OLD_FORMAT_IMPERSONATION_IS_ACTIVE),
                 new Lucene41RWCodec(OLD_FORMAT_IMPERSONATION_IS_ACTIVE),
@@ -1128,8 +1129,6 @@ namespace Lucene.Net.Index
             writer.AddDocument(doc);
             writer.Dispose();
             dir.Dispose();
-
-            OLD_FORMAT_IMPERSONATION_IS_ACTIVE = false;
         }
 
         [Test]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestBinaryTerms.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestBinaryTerms.cs b/src/Lucene.Net.Tests/core/Index/TestBinaryTerms.cs
index ef7fa5a..0c0fabc 100644
--- a/src/Lucene.Net.Tests/core/Index/TestBinaryTerms.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestBinaryTerms.cs
@@ -43,7 +43,7 @@ namespace Lucene.Net.Index
         public virtual void TestBinary()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             BytesRef bytes = new BytesRef(2);
             BinaryTokenStream tokenStream = new BinaryTokenStream(bytes);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestCodecHoldsOpenFiles.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestCodecHoldsOpenFiles.cs b/src/Lucene.Net.Tests/core/Index/TestCodecHoldsOpenFiles.cs
index db7e926..1c2a37e 100644
--- a/src/Lucene.Net.Tests/core/Index/TestCodecHoldsOpenFiles.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestCodecHoldsOpenFiles.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.Index
         public virtual void Test()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             int numDocs = AtLeast(100);
             for (int i = 0; i < numDocs; i++)
             {
@@ -73,7 +73,7 @@ namespace Lucene.Net.Index
         public virtual void TestExposeUnclosedFiles()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             //int numDocs = AtLeast(100);
             int numDocs = 5;
             for (int i = 0; i < numDocs; i++)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs b/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs
index e43aae9..f64ddc6 100644
--- a/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs
@@ -850,7 +850,7 @@ namespace Lucene.Net.Index
         {
             Directory dir = NewDirectory();
             // riw should sometimes create docvalues fields, etc
-            RandomIndexWriter riw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter riw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             // these fields should sometimes get term vectors, etc
             Field idField = NewStringField("id", "", Field.Store.NO);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestCrash.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestCrash.cs b/src/Lucene.Net.Tests/core/Index/TestCrash.cs
index 4c13291..0a4e374 100644
--- a/src/Lucene.Net.Tests/core/Index/TestCrash.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestCrash.cs
@@ -101,7 +101,7 @@ namespace Lucene.Net.Index
             Directory dir2 = NewDirectory(dir);
             dir.Dispose();
 
-            (new RandomIndexWriter(Random(), dir2)).Dispose();
+            (new RandomIndexWriter(Random(), dir2, Similarity, TimeZone)).Dispose();
             dir2.Dispose();
         }
 
@@ -137,7 +137,7 @@ namespace Lucene.Net.Index
             Directory dir2 = NewDirectory(dir);
             dir.Dispose();
 
-            (new RandomIndexWriter(Random(), dir2)).Dispose();
+            (new RandomIndexWriter(Random(), dir2, Similarity, TimeZone)).Dispose();
             dir2.Dispose();
         }
 
@@ -176,7 +176,7 @@ namespace Lucene.Net.Index
             Directory dir2 = NewDirectory(dir);
             dir.Dispose();
 
-            (new RandomIndexWriter(Random(), dir2)).Dispose();
+            (new RandomIndexWriter(Random(), dir2, Similarity, TimeZone)).Dispose();
             dir2.Dispose();
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
index aa61570..2de7c4d 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
@@ -1206,7 +1206,7 @@ namespace Lucene.Net.Index
         public virtual void TestLoadCertainFields()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("field1", "foobar", Field.Store.YES));
             doc.Add(NewStringField("field2", "foobaz", Field.Store.YES));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestDirectoryReaderReopen.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDirectoryReaderReopen.cs b/src/Lucene.Net.Tests/core/Index/TestDirectoryReaderReopen.cs
index 5a21c47..95dcfa9 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDirectoryReaderReopen.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDirectoryReaderReopen.cs
@@ -400,7 +400,7 @@ namespace Lucene.Net.Index
                             refreshed = r;
                         }
 
-                        IndexSearcher searcher = NewSearcher(refreshed);
+                        IndexSearcher searcher = OuterInstance.NewSearcher(refreshed);
                         ScoreDoc[] hits = searcher.Search(new TermQuery(new Term("field1", "a" + rnd.Next(refreshed.MaxDoc))), null, 1000).ScoreDocs;
                         if (hits.Length > 0)
                         {
@@ -559,10 +559,10 @@ namespace Lucene.Net.Index
             }
         }
 
-        public static void CreateIndex(Random random, Directory dir, bool multiSegment)
+        public void CreateIndex(Random random, Directory dir, bool multiSegment)
         {
             IndexWriter.Unlock(dir);
-            IndexWriter w = new IndexWriter(dir, LuceneTestCase.NewIndexWriterConfig(random, TEST_VERSION_CURRENT, new MockAnalyzer(random)).SetMergePolicy(new LogDocMergePolicy()));
+            IndexWriter w = new IndexWriter(dir, NewIndexWriterConfig(random, TEST_VERSION_CURRENT, new MockAnalyzer(random)).SetMergePolicy(new LogDocMergePolicy()));
 
             for (int i = 0; i < 100; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Index/TestDocCount.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocCount.cs b/src/Lucene.Net.Tests/core/Index/TestDocCount.cs
index 11165b2..01ef636 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocCount.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocCount.cs
@@ -40,7 +40,7 @@ namespace Lucene.Net.Index
         public virtual void TestSimple()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             int numDocs = AtLeast(100);
             for (int i = 0; i < numDocs; i++)
             {


Mime
View raw message