lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [02/20] lucenenet git commit: Lucene.Net.TestFramework: Setup TestRuleSetupAndRestoreClassEnv to function similarly to the way it did in JUnit by executing it directly from LuceneTestCase. Completed more of the implementation, including setting the defau
Date Tue, 28 Feb 2017 12:29:53 GMT
Lucene.Net.TestFramework: Setup TestRuleSetupAndRestoreClassEnv to function similarly to the way it did in JUnit by executing it directly from LuceneTestCase. Completed more of the implementation, including setting the default codec randomly and excluding codecs from SuppressCodecsAttribute.


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

Branch: refs/heads/api-work
Commit: 51075743778b32dbde8acb020db79e5bdd0a443d
Parents: 3527406
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Mon Feb 27 20:16:03 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Mon Feb 27 23:19:59 2017 +0700

----------------------------------------------------------------------
 .../Analysis/BaseTokenStreamTestCase.cs         |   2 +-
 .../Index/BaseDocValuesFormatTestCase.cs        |  24 +-
 .../Index/BaseStoredFieldsFormatTestCase.cs     |   6 +-
 .../Index/BaseTermVectorsFormatTestCase.cs      |  14 +-
 .../AbstractBeforeAfterRule.cs                  |  19 ++
 .../Lucene.Net.TestFramework.csproj             |   1 +
 .../Search/SearchEquivalenceTestBase.cs         |   2 +-
 .../Util/LuceneTestCase.cs                      |  28 +-
 .../Util/TestRuleSetupAndRestoreClassEnv.cs     | 280 +++++++++++--------
 src/Lucene.Net.Tests.Facet/FacetTestCase.cs     |   1 -
 .../Taxonomy/TestTaxonomyCombined.cs            |   1 -
 .../Index/TestBackwardsCompatibility.cs         |   1 -
 .../Index/TestBackwardsCompatibility3x.cs       |   1 -
 .../TestControlledRealTimeReopenThread.cs       |   1 -
 14 files changed, 224 insertions(+), 157 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs b/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
index 79b5c5f..f7acb7b 100644
--- a/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
@@ -659,7 +659,7 @@ namespace Lucene.Net.Analysis
             if (Rarely(random) && codecOk)
             {
                 dir = NewFSDirectory(CreateTempDir("bttc"));
-                iw = new RandomIndexWriter(new Random((int)seed), dir, a, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+                iw = new RandomIndexWriter(new Random((int)seed), dir, a, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             }
 
             bool success = false;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
index 07a7970..ff00927 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
@@ -88,7 +88,7 @@ namespace Lucene.Net.Index
         public virtual void TestOneNumber()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             string longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm";
             string text = "this is the text to be indexed. " + longTerm;
@@ -123,7 +123,7 @@ namespace Lucene.Net.Index
         public virtual void TestOneFloat()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             string longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm";
             string text = "this is the text to be indexed. " + longTerm;
@@ -158,7 +158,7 @@ namespace Lucene.Net.Index
         public virtual void TestTwoNumbers()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             string longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm";
             string text = "this is the text to be indexed. " + longTerm;
@@ -196,7 +196,7 @@ namespace Lucene.Net.Index
         public virtual void TestTwoBinaryValues()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             string longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm";
             string text = "this is the text to be indexed. " + longTerm;
@@ -237,7 +237,7 @@ namespace Lucene.Net.Index
         public virtual void TestTwoFieldsMixed()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             string longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm";
             string text = "this is the text to be indexed. " + longTerm;
@@ -277,7 +277,7 @@ namespace Lucene.Net.Index
         public virtual void TestThreeFieldsMixed()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             string longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm";
             string text = "this is the text to be indexed. " + longTerm;
@@ -322,7 +322,7 @@ namespace Lucene.Net.Index
         public virtual void TestThreeFieldsMixed2()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             string longTerm = "longtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongtermlongterm";
             string text = "this is the text to be indexed. " + longTerm;
@@ -1835,7 +1835,7 @@ namespace Lucene.Net.Index
         {
             AssumeTrue("Codec does not support SORTED_SET", DefaultCodecSupportsSortedSet());
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
 
             Document doc = new Document();
             doc.Add(new SortedSetDocValuesField("field", new BytesRef("hello")));
@@ -1863,7 +1863,7 @@ namespace Lucene.Net.Index
         {
             AssumeTrue("Codec does not support SORTED_SET", DefaultCodecSupportsSortedSet());
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
 
             Document doc = new Document();
             doc.Add(new SortedSetDocValuesField("field", new BytesRef("hello")));
@@ -1946,7 +1946,7 @@ namespace Lucene.Net.Index
         {
             AssumeTrue("Codec does not support SORTED_SET", DefaultCodecSupportsSortedSet());
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
 
             Document doc = new Document();
             doc.Add(new SortedSetDocValuesField("field", new BytesRef("hello")));
@@ -1979,7 +1979,7 @@ namespace Lucene.Net.Index
         {
             AssumeTrue("Codec does not support SORTED_SET", DefaultCodecSupportsSortedSet());
             Directory directory = NewDirectory();
-            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iwriter = new RandomIndexWriter(Random(), directory, ClassEnvRule.similarity, ClassEnvRule.timeZone);
 
             Document doc = new Document();
             doc.Add(new SortedSetDocValuesField("field", new BytesRef("world")));
@@ -3478,7 +3478,7 @@ namespace Lucene.Net.Index
                     break;
                 }
                 Directory dir = NewDirectory();
-                RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+                RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
                 BytesRef bytes = new BytesRef();
                 bytes.Bytes = new byte[1 << i];
                 bytes.Length = 1 << i;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
index 4b831fb..3391128 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
@@ -266,7 +266,7 @@ namespace Lucene.Net.Index
         public virtual void TestNumericField()
         {
             Directory dir = NewDirectory();
-            var w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            var w = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             var numDocs = AtLeast(500);
             var answers = new object[numDocs];
             NumericType[] typeAnswers = new NumericType[numDocs];
@@ -351,7 +351,7 @@ namespace Lucene.Net.Index
         public virtual void TestIndexedBit()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             FieldType onlyStored = new FieldType();
             onlyStored.IsStored = true;
@@ -769,7 +769,7 @@ namespace Lucene.Net.Index
             }
             w.Commit();
             w.Dispose();
-            w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            w = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             w.ForceMerge(TestUtil.NextInt(Random(), 1, 3));
             w.Commit();
             w.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
index fb903a8..a7deafe 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
@@ -682,7 +682,7 @@ namespace Lucene.Net.Index
                 int docWithVectors = Random().Next(numDocs);
                 Document emptyDoc = new Document();
                 Directory dir = NewDirectory();
-                RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+                RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
                 RandomDocument doc = docFactory.NewDocument(TestUtil.NextInt(Random(), 1, 3), 20, options);
                 for (int i = 0; i < numDocs; ++i)
                 {
@@ -729,7 +729,7 @@ namespace Lucene.Net.Index
                     continue;
                 }
                 using (Directory dir = NewDirectory())
-                using (RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone))
+                using (RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone))
                 {
                     RandomDocument doc = docFactory.NewDocument(TestUtil.NextInt(Random(), 1, 2), AtLeast(20000),
                         options);
@@ -747,7 +747,7 @@ namespace Lucene.Net.Index
             foreach (Options options in ValidOptions())
             {
                 Directory dir = NewDirectory();
-                RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+                RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
                 RandomDocument doc = docFactory.NewDocument(AtLeast(100), 5, options);
                 writer.AddDocument(doc.ToDocument());
                 IndexReader reader = writer.Reader;
@@ -774,7 +774,7 @@ namespace Lucene.Net.Index
                     }
                     using (Directory dir = NewDirectory())
                     {
-                        using (var writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone))
+                        using (var writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone))
                         {
                             RandomDocument doc1 = docFactory.NewDocument(numFields, 20, options1);
                             RandomDocument doc2 = docFactory.NewDocument(numFields, 20, options2);
@@ -804,7 +804,7 @@ namespace Lucene.Net.Index
                 docs[i] = docFactory.NewDocument(TestUtil.NextInt(Random(), 1, 3), TestUtil.NextInt(Random(), 10, 50), RandomOptions());
             }
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             for (int i = 0; i < numDocs; ++i)
             {
                 writer.AddDocument(AddId(docs[i].ToDocument(), "" + i));
@@ -839,7 +839,7 @@ namespace Lucene.Net.Index
                     docs[i] = docFactory.NewDocument(TestUtil.NextInt(Random(), 1, 3), AtLeast(10), options);
                 }
                 Directory dir = NewDirectory();
-                RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+                RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
                 for (int i = 0; i < numDocs; ++i)
                 {
                     writer.AddDocument(AddId(docs[i].ToDocument(), "" + i));
@@ -884,7 +884,7 @@ namespace Lucene.Net.Index
                     docs[i] = docFactory.NewDocument(TestUtil.NextInt(Random(), 1, 3), AtLeast(10), options);
                 }
                 Directory dir = NewDirectory();
-                RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+                RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.similarity, ClassEnvRule.timeZone);
                 for (int i = 0; i < numDocs; ++i)
                 {
                     writer.AddDocument(AddId(docs[i].ToDocument(), "" + i));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/JavaCompatibility/AbstractBeforeAfterRule.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/JavaCompatibility/AbstractBeforeAfterRule.cs b/src/Lucene.Net.TestFramework/JavaCompatibility/AbstractBeforeAfterRule.cs
new file mode 100644
index 0000000..025f548
--- /dev/null
+++ b/src/Lucene.Net.TestFramework/JavaCompatibility/AbstractBeforeAfterRule.cs
@@ -0,0 +1,19 @@
+´╗┐using Lucene.Net.Util;
+
+namespace Lucene.Net.JavaCompatibility
+{
+    /// <summary>
+    /// LUCENENET specific for mimicking the JUnit rule functionality.
+    /// We simplify things by just running the rules inside LuceneTestCase.
+    /// </summary>
+    public abstract class AbstractBeforeAfterRule
+    {
+        public virtual void Before(LuceneTestCase testInstance)
+        {
+        }
+
+        public virtual void After(LuceneTestCase testInstance)
+        {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj b/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
index c6ad07b..f008111 100644
--- a/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
+++ b/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
@@ -320,6 +320,7 @@
     <Compile Include="Index\ThreadedIndexingAndSearchingTestCase.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="JavaCompatibility\AbstractBeforeAfterRule.cs" />
     <Compile Include="Randomized\Attributes\SeedAttribute.cs">
       <SubType>Code</SubType>
     </Compile>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs b/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
index 76c929a..312203b 100644
--- a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
+++ b/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
@@ -71,7 +71,7 @@ namespace Lucene.Net.Search
             Stopword = "" + RandomChar();
             CharacterRunAutomaton stopset = new CharacterRunAutomaton(BasicAutomata.MakeString(Stopword));
             Analyzer = new MockAnalyzer(random, MockTokenizer.WHITESPACE, false, stopset);
-            RandomIndexWriter iw = new RandomIndexWriter(random, Directory, Analyzer, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(random, Directory, Analyzer, ClassEnvRule.similarity, ClassEnvRule.timeZone);
             Document doc = new Document();
             Field id = new StringField("id", "", Field.Store.NO);
             Field field = new TextField("field", "", Field.Store.NO);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 5dd3542..812e273 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -256,9 +256,9 @@ namespace Lucene.Net.Util
         /// (because they are expensive, for example).
         /// </summary>
         [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
-        public class SuppressCodecs : System.Attribute
+        public class SuppressCodecsAttribute : System.Attribute
         {
-            public SuppressCodecs(params string[] value)
+            public SuppressCodecsAttribute(params string[] value)
             {
                 this.Value = value;
             }
@@ -454,7 +454,7 @@ namespace Lucene.Net.Util
         /// Exposed because <see cref="TestRuleSetupAndRestoreClassEnv"/> is
         /// internal and this field is needed by other classes.
         /// </summary>
-        public Similarity Similarity { get { return ClassEnvRule.Similarity; } }
+        public Similarity Similarity { get { return ClassEnvRule.similarity; } }
 
         /// <summary>
         /// Gets the Timezone from the Class Environment setup rule
@@ -463,7 +463,7 @@ namespace Lucene.Net.Util
         /// Exposed because <see cref="TestRuleSetupAndRestoreClassEnv"/> is
         /// internal and this field is needed by other classes.
         /// </summary>
-        public TimeZoneInfo TimeZone { get { return ClassEnvRule.TimeZone; } }
+        public TimeZoneInfo TimeZone { get { return ClassEnvRule.timeZone; } }
 
         // LUCENENET TODO
         /// <summary>
@@ -603,7 +603,7 @@ namespace Lucene.Net.Util
             /* LUCENENET TODO: Not sure how to convert these
                 ParentChainCallRule.TeardownCalled = true;
                 */
-            CleanupTemporaryFiles(); // LUCENENET TODO: Move this to OneTimeTearDown()? Calling it here deletes files too early.
+            CleanupTemporaryFiles(); // LUCENENET TODO: Move this to OneTimeTearDown()? Calling it here deletes shared files too early.
         }
 
         // LUCENENET specific constants to scan the test framework for codecs/docvaluesformats/postingsformats only once
@@ -616,12 +616,20 @@ namespace Lucene.Net.Util
         [OneTimeSetUp]
         public virtual void BeforeClass()
         {
-            OLD_FORMAT_IMPERSONATION_IS_ACTIVE = false;
-
             // Setup the factories
             Codec.SetCodecFactory(TEST_CODEC_FACTORY);
             DocValuesFormat.SetDocValuesFormatFactory(TEST_DOCVALUES_FORMAT_FACTORY);
             PostingsFormat.SetPostingsFormatFactory(TEST_POSTINGS_FORMAT_FACTORY);
+
+            // IMPORTANT: Call this line after calling Codec.SetCodecFactory() because both
+            // of them change Codec.Default
+            ClassEnvRule.Before(this);
+        }
+
+        [OneTimeTearDown]
+        public virtual void AfterClass()
+        {
+            ClassEnvRule.After(this);
         }
 
         // -----------------------------------------------------------------
@@ -900,7 +908,7 @@ namespace Lucene.Net.Util
         /// </summary>
         public IndexWriterConfig NewIndexWriterConfig(Random r, LuceneVersion v, Analyzer a)
         {
-            return NewIndexWriterConfig(r, v, a, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            return NewIndexWriterConfig(r, v, a, ClassEnvRule.similarity, ClassEnvRule.timeZone);
         }
 
         /// <summary>
@@ -1657,7 +1665,7 @@ namespace Lucene.Net.Util
         /// </summary>
         public IndexSearcher NewSearcher(IndexReader r)
         {
-            return NewSearcher(r, ClassEnvRule.Similarity);
+            return NewSearcher(r, ClassEnvRule.similarity);
         }
 
         /// <param name="similarity">
@@ -1693,7 +1701,7 @@ namespace Lucene.Net.Util
 
         public IndexSearcher NewSearcher(IndexReader r, bool maybeWrap, bool wrapWithAssertions)
         {
-            return NewSearcher(r, maybeWrap, wrapWithAssertions, ClassEnvRule.Similarity);
+            return NewSearcher(r, maybeWrap, wrapWithAssertions, ClassEnvRule.similarity);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs b/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
index 68d8bdf..797d974 100644
--- a/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
+++ b/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
@@ -7,8 +7,21 @@ using System.Threading;
 namespace Lucene.Net.Util
 {
     using Codecs;
+    using Codecs.Asserting;
+    using Codecs.Compressing;
+    using Codecs.Lucene3x;
+    using Codecs.Lucene40;
+    using Codecs.Lucene41;
+    using Codecs.Lucene42;
+    using Codecs.Lucene45;
+    using Codecs.SimpleText;
+    using JavaCompatibility;
     //using AssumptionViolatedException = org.junit.@internal.AssumptionViolatedException;
     using Lucene.Net.Randomized.Generators;
+    using Support;
+    using System.Diagnostics;
+    using System.Linq;
+    using System.Reflection;
 
     /*
          * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -58,94 +71,119 @@ namespace Lucene.Net.Util
     /// Setup and restore suite-level environment (fine grained junk that
     /// doesn't fit anywhere else).
     /// </summary>
-    internal sealed class TestRuleSetupAndRestoreClassEnv// : AbstractBeforeAfterRule
+    internal sealed class TestRuleSetupAndRestoreClassEnv : AbstractBeforeAfterRule
     {
         /// <summary>
         /// Restore these system property values.
         /// </summary>
-        private Dictionary<string, string> RestoreProperties = new Dictionary<string, string>();
+        private Dictionary<string, string> restoreProperties = new Dictionary<string, string>();
 
-        //private Codec SavedCodec;
+        private Codec savedCodec;
         //private CultureInfo SavedLocale;
         //private InfoStream SavedInfoStream;
         //private TimeZoneInfo SavedTimeZone;
 
-        internal CultureInfo Locale;
-        internal TimeZoneInfo TimeZone;
-        internal Similarity Similarity;
-        internal Codec Codec;
+        internal CultureInfo locale;
+        internal TimeZoneInfo timeZone;
+        internal Similarity similarity;
+        internal Codec codec;
 
         /// <seealso cref= SuppressCodecs </seealso>
-        internal HashSet<string> AvoidCodecs;
+        internal HashSet<string> avoidCodecs;
 
-        public TestRuleSetupAndRestoreClassEnv()
+        public override void Before(LuceneTestCase testInstance)
         {
-            /*// if verbose: print some debugging stuff about which codecs are loaded.
+            // if verbose: print some debugging stuff about which codecs are loaded.
             if (LuceneTestCase.VERBOSE)
             {
-                ISet<string> codecs = Codec.AvailableCodecs();
+                ICollection<string> codecs = Codec.AvailableCodecs();
                 foreach (string codec in codecs)
                 {
                     Console.WriteLine("Loaded codec: '" + codec + "': " + Codec.ForName(codec).GetType().Name);
                 }
 
-                ISet<string> postingsFormats = PostingsFormat.AvailablePostingsFormats();
+                ICollection<string> postingsFormats = PostingsFormat.AvailablePostingsFormats();
                 foreach (string postingsFormat in postingsFormats)
                 {
                     Console.WriteLine("Loaded postingsFormat: '" + postingsFormat + "': " + PostingsFormat.ForName(postingsFormat).GetType().Name);
                 }
             }
 
-            SavedInfoStream = InfoStream.Default;
-            Random random = RandomizedContext.Current.Random;
-            bool v = random.NextBoolean();
-            if (LuceneTestCase.INFOSTREAM)
-            {
-                InfoStream.Default = new ThreadNameFixingPrintStreamInfoStream(Console.Out);
-            }
-            else if (v)
+            // LUCENENET TODO: Finish implementation ?
+            //SavedInfoStream = InfoStream.Default;
+            Random random = LuceneTestCase.Random(); //RandomizedContext.Current.Random;
+            //bool v = random.NextBoolean();
+            //if (LuceneTestCase.INFOSTREAM)
+            //{
+            //    InfoStream.Default = new ThreadNameFixingPrintStreamInfoStream(Console.Out);
+            //}
+            //else if (v)
+            //{
+            //    InfoStream.Default = new NullInfoStream();
+            //}
+
+            Type targetClass = testInstance.GetType();
+            avoidCodecs = new HashSet<string>();
+            var suppressCodecsAttribute = targetClass.GetTypeInfo().GetCustomAttribute<LuceneTestCase.SuppressCodecsAttribute>();
+            if (suppressCodecsAttribute != null)
             {
-                InfoStream.Default = new NullInfoStream();
+                avoidCodecs.AddAll(suppressCodecsAttribute.Value);
             }
 
-            Type targetClass = RandomizedContext.Current.GetTargetType;
-            AvoidCodecs = new HashSet<string>();
-
             // set back to default
             LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE = false;
 
-            SavedCodec = Codec.Default;
+            savedCodec = Codec.Default;
             int randomVal = random.Next(10);
-            if ("Lucene3x".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) && "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) && "random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) && randomVal == 3 && !ShouldAvoidCodec("Lucene3x"))) // preflex-only setup
-            {
-                Codec = Codec.ForName("Lucene3x");
-                Debug.Assert((Codec is PreFlexRWCodec), "fix your classpath to have tests-framework.jar before lucene-core.jar");
+            if ("Lucene3x".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) &&
+                                                                "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) &&
+                                                                "random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) &&
+                                                                randomVal == 3 &&
+                                                                !ShouldAvoidCodec("Lucene3x"))) // preflex-only setup
+            {
+                codec = Codec.ForName("Lucene3x");
+                Debug.Assert((codec is PreFlexRWCodec), "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
                 LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
             }
-            else if ("Lucene40".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) && "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) && randomVal == 0 && !ShouldAvoidCodec("Lucene40"))) // 4.0 setup
+            else if ("Lucene40".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) &&
+                                                                    "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) &&
+                                                                    randomVal == 0 &&
+                                                                    !ShouldAvoidCodec("Lucene40"))) // 4.0 setup
             {
-                Codec = Codec.ForName("Lucene40");
+                codec = Codec.ForName("Lucene40");
                 LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
-                Debug.Assert(Codec is Lucene40RWCodec, "fix your classpath to have tests-framework.jar before lucene-core.jar");
-                Debug.Assert((PostingsFormat.ForName("Lucene40") is Lucene40RWPostingsFormat), "fix your classpath to have tests-framework.jar before lucene-core.jar");
+                Debug.Assert((codec is Lucene40RWCodec), "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
+                Debug.Assert((PostingsFormat.ForName("Lucene40") is Lucene40RWPostingsFormat), "fix your IPostingsFormatFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
             }
-            else if ("Lucene41".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) && "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) && "random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) && randomVal == 1 && !ShouldAvoidCodec("Lucene41")))
+            else if ("Lucene41".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) &&
+                                                                    "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) &&
+                                                                    "random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) &&
+                                                                    randomVal == 1 &&
+                                                                    !ShouldAvoidCodec("Lucene41")))
             {
-                Codec = Codec.ForName("Lucene41");
+                codec = Codec.ForName("Lucene41");
                 LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
-                Debug.Assert(Codec is Lucene41RWCodec, "fix your classpath to have tests-framework.jar before lucene-core.jar");
+                Debug.Assert((codec is Lucene41RWCodec), "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
             }
-            else if ("Lucene42".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) && "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) && "random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) && randomVal == 2 && !ShouldAvoidCodec("Lucene42")))
+            else if ("Lucene42".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) &&
+                                                                    "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) &&
+                                                                    "random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) &&
+                                                                    randomVal == 2 &&
+                                                                    !ShouldAvoidCodec("Lucene42")))
             {
-                Codec = Codec.ForName("Lucene42");
+                codec = Codec.ForName("Lucene42");
                 LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
-                Debug.Assert(Codec is Lucene42RWCodec, "fix your classpath to have tests-framework.jar before lucene-core.jar");
+                Debug.Assert((codec is Lucene42RWCodec), "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
             }
-            else if ("Lucene45".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) && "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) && "random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) && randomVal == 5 && !ShouldAvoidCodec("Lucene45")))
+            else if ("Lucene45".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) &&
+                                                                    "random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) &&
+                                                                    "random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) &&
+                                                                    randomVal == 5 &&
+                                                                    !ShouldAvoidCodec("Lucene45")))
             {
-                Codec = Codec.ForName("Lucene45");
+                codec = Codec.ForName("Lucene45");
                 LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
-                Debug.Assert(Codec is Lucene45RWCodec, "fix your classpath to have tests-framework.jar before lucene-core.jar");
+                Debug.Assert((codec is Lucene45RWCodec), "fix your ICodecFactory to scan Lucene.Net.Tests before Lucene.Net.TestFramework");
             }
             else if (("random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT) == false) || ("random".Equals(LuceneTestCase.TEST_DOCVALUESFORMAT) == false))
             {
@@ -157,6 +195,11 @@ namespace Lucene.Net.Util
                 {
                     format = PostingsFormat.ForName("Lucene41");
                 }
+                // LUCENENET TODO: Implement MockRandomPostingsFormat
+                //else if ("MockRandom".Equals(LuceneTestCase.TEST_POSTINGSFORMAT))
+                //{
+                //    format = new MockRandomPostingsFormat(new Random(random.Next()));
+                //}
                 else
                 {
                     format = PostingsFormat.ForName(LuceneTestCase.TEST_POSTINGSFORMAT);
@@ -172,71 +215,72 @@ namespace Lucene.Net.Util
                     dvFormat = DocValuesFormat.ForName(LuceneTestCase.TEST_DOCVALUESFORMAT);
                 }
 
-                Codec = new Lucene46CodecAnonymousInnerClassHelper(this, format, dvFormat);
+                codec = new Lucene46CodecAnonymousInnerClassHelper(this, format, dvFormat);
             }
+            else if ("SimpleText".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) && randomVal == 9 && LuceneTestCase.Rarely(random) && !ShouldAvoidCodec("SimpleText")))
+            {
+                codec = new SimpleTextCodec();
+            }
+            // LUCENENET TODO: Implement CheapBastardCodec
+            //else if ("CheapBastard".equals(LuceneTestCase.TEST_CODEC) || ("random".equals(LuceneTestCase.TEST_CODEC) && randomVal == 8 && !ShouldAvoidCodec("CheapBastard") && !ShouldAvoidCodec("Lucene41")))
+            //{
+            //    // we also avoid this codec if Lucene41 is avoided, since thats the postings format it uses.
+            //    codec = new CheapBastardCodec();
+            //}
             else if ("Asserting".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) && randomVal == 6 && !ShouldAvoidCodec("Asserting")))
             {
-                Codec = new AssertingCodec();
+                codec = new AssertingCodec();
             }
             else if ("Compressing".Equals(LuceneTestCase.TEST_CODEC) || ("random".Equals(LuceneTestCase.TEST_CODEC) && randomVal == 5 && !ShouldAvoidCodec("Compressing")))
             {
-                Codec = CompressingCodec.RandomInstance(random);
+                codec = CompressingCodec.RandomInstance(random);
             }
             else if (!"random".Equals(LuceneTestCase.TEST_CODEC))
             {
-                Codec = Codec.ForName(LuceneTestCase.TEST_CODEC);
+                codec = Codec.ForName(LuceneTestCase.TEST_CODEC);
             }
             else if ("random".Equals(LuceneTestCase.TEST_POSTINGSFORMAT))
             {
-                Codec = new RandomCodec(random, AvoidCodecs);
+                codec = new RandomCodec(random, avoidCodecs);
             }
             else
             {
                 Debug.Assert(false);
             }
-            Codec.Default = Codec;
-            */
-            Random random = new Random(1);
-            Similarity = random.NextBoolean() ? (Similarity)new DefaultSimilarity() : new RandomSimilarityProvider(new Random(1));
-            /*
+            Codec.Default = codec;
+
+            // LUCENENET TODO: Locale/time zone
+            //// Initialize locale/ timezone.
+            //string testLocale = System.getProperty("tests.locale", "random");
+            //string testTimeZone = System.getProperty("tests.timezone", "random");
+
+            //// Always pick a random one for consistency (whether tests.locale was specified or not).
+            //SavedLocale = Locale.Default;
+            //Locale randomLocale = RandomLocale(random);
+            //Locale = testLocale.Equals("random") ? randomLocale : localeForName(testLocale);
+            //Locale.Default = Locale;
+
+            //// TimeZone.getDefault will set user.timezone to the default timezone of the user's locale.
+            //// So store the original property value and restore it at end.
+            //RestoreProperties["user.timezone"] = System.getProperty("user.timezone");
+            //SavedTimeZone = TimeZone.Default;
+            //TimeZone randomTimeZone = RandomTimeZone(random);
+            //TimeZone = testTimeZone.Equals("random") ? randomTimeZone : TimeZone.getTimeZone(testTimeZone);
+            //TimeZone.Default = TimeZone;
+
+            similarity = random.NextBoolean() ? (Similarity)new DefaultSimilarity() : new RandomSimilarityProvider(new Random(1));
+            
             // Check codec restrictions once at class level.
             try
             {
-                CheckCodecRestrictions(Codec);
+                CheckCodecRestrictions(codec);
             }
             catch (Exception e)
             {
-                Console.Error.WriteLine("NOTE: " + e.Message + " Suppressed codecs: " + Arrays.ToString(AvoidCodecs.ToArray()));
+                Console.Error.WriteLine("NOTE: " + e.Message + " Suppressed codecs: " + Arrays.ToString(avoidCodecs.ToArray()));
                 throw e;
-            }*/
-        }
-
-        /*~TestRuleSetupAndRestoreClassEnv()
-        {
-            foreach (KeyValuePair<string, string> e in RestoreProperties)
-            {
-                if (e.Value == null)
-                {
-                    System.ClearProperty(e.Key);
-                }
-                else
-                {
-                    System.setProperty(e.Key, e.Value);
-                }
-            }
-            RestoreProperties.Clear();
-
-            Codec.Default = SavedCodec;
-            InfoStream.Default = SavedInfoStream;
-            if (SavedLocale != null)
-            {
-                Locale = SavedLocale;
             }
-            if (SavedTimeZone != null)
-            {
-                TimeZone = SavedTimeZone;
-            }
-        }*/
+        }
 
         internal class ThreadNameFixingPrintStreamInfoStream : PrintStreamInfoStream
         {
@@ -448,31 +492,31 @@ namespace Lucene.Net.Util
 
         private class Lucene46CodecAnonymousInnerClassHelper : Lucene46Codec
         {
-            private readonly TestRuleSetupAndRestoreClassEnv OuterInstance;
+            private readonly TestRuleSetupAndRestoreClassEnv outerInstance;
 
-            private PostingsFormat Format;
-            private DocValuesFormat DvFormat;
+            private PostingsFormat format;
+            private DocValuesFormat dvFormat;
 
             public Lucene46CodecAnonymousInnerClassHelper(TestRuleSetupAndRestoreClassEnv outerInstance, PostingsFormat format, DocValuesFormat dvFormat)
             {
-                this.OuterInstance = outerInstance;
-                this.Format = format;
-                this.DvFormat = dvFormat;
+                this.outerInstance = outerInstance;
+                this.format = format;
+                this.dvFormat = dvFormat;
             }
 
             public override PostingsFormat GetPostingsFormatForField(string field)
             {
-                return Format;
+                return format;
             }
 
             public override DocValuesFormat GetDocValuesFormatForField(string field)
             {
-                return DvFormat;
+                return dvFormat;
             }
 
             public override string ToString()
             {
-                return base.ToString() + ": " + Format.ToString() + ", " + DvFormat.ToString();
+                return base.ToString() + ": " + format.ToString() + ", " + dvFormat.ToString();
             }
         }
 
@@ -484,7 +528,7 @@ namespace Lucene.Net.Util
         {
             LuceneTestCase.AssumeFalse("Class not allowed to use codec: " + codec.Name + ".", ShouldAvoidCodec(codec.Name));
 
-            if (codec is RandomCodec && AvoidCodecs.Count > 0)
+            if (codec is RandomCodec && avoidCodecs.Count > 0)
             {
                 foreach (string name in ((RandomCodec)codec).FormatNames)
                 {
@@ -501,39 +545,39 @@ namespace Lucene.Net.Util
         /// <summary>
         /// After suite cleanup (always invoked).
         /// </summary>
-        /*protected internal override void After()
+        public override void After(LuceneTestCase testInstance)
         {
-          foreach (KeyValuePair<string, string> e in RestoreProperties)
-          {
-            if (e.Value == null)
-            {
-              System.ClearProperty(e.Key);
-            }
-            else
-            {
-              System.setProperty(e.Key, e.Value);
-            }
-          }
-          RestoreProperties.Clear();
-
-          Codec.Default = SavedCodec;
-          InfoStream.Default = SavedInfoStream;
-          if (SavedLocale != null)
-          {
-              Locale = SavedLocale;
-          }
-          if (SavedTimeZone != null)
-          {
-              TimeZone = SavedTimeZone;
-          }
-        }*/
+            //foreach (KeyValuePair<string, string> e in restoreProperties)
+            //{
+            //    if (e.Value == null)
+            //    {
+            //        System.ClearProperty(e.Key);
+            //    }
+            //    else
+            //    {
+            //        System.setProperty(e.Key, e.Value);
+            //    }
+            //}
+            restoreProperties.Clear();
+
+            Codec.Default = savedCodec;
+            //InfoStream.Default = savedInfoStream;
+            //if (savedLocale != null)
+            //{
+            //    locale = savedLocale;
+            //}
+            //if (savedTimeZone != null)
+            //{
+            //    timeZone = savedTimeZone;
+            //}
+        }
 
         /// <summary>
         /// Should a given codec be avoided for the currently executing suite?
         /// </summary>
         private bool ShouldAvoidCodec(string codec)
         {
-            return AvoidCodecs.Count > 0 && AvoidCodecs.Contains(codec);
+            return avoidCodecs.Count > 0 && avoidCodecs.Contains(codec);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/FacetTestCase.cs b/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
index 849f32a..39b9b6e 100644
--- a/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
+++ b/src/Lucene.Net.Tests.Facet/FacetTestCase.cs
@@ -35,7 +35,6 @@ namespace Lucene.Net.Facet
     using TaxonomyFacetCounts = Lucene.Net.Facet.Taxonomy.TaxonomyFacetCounts;
     using TaxonomyReader = Lucene.Net.Facet.Taxonomy.TaxonomyReader;
     using BytesRef = Lucene.Net.Util.BytesRef;
-    using SuppressCodecs = Lucene.Net.Util.LuceneTestCase.SuppressCodecs;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
     using TestUtil = Lucene.Net.Util.TestUtil;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs
index 4e4b164..c722d7e 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyCombined.cs
@@ -15,7 +15,6 @@ namespace Lucene.Net.Facet.Taxonomy
     using Directory = Lucene.Net.Store.Directory;
     using LockObtainFailedException = Lucene.Net.Store.LockObtainFailedException;
     using RAMDirectory = Lucene.Net.Store.RAMDirectory;
-    using SuppressCodecs = Lucene.Net.Util.LuceneTestCase.SuppressCodecs;
 
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
index 8b6f78d..163bbc7 100644
--- a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
+++ b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
@@ -59,7 +59,6 @@ namespace Lucene.Net.Index
     using Constants = Lucene.Net.Util.Constants;
     using IOUtils = Lucene.Net.Util.IOUtils;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
-    using SuppressCodecs = Lucene.Net.Util.LuceneTestCase.SuppressCodecs;
     using StringHelper = Lucene.Net.Util.StringHelper;
     using TestUtil = Lucene.Net.Util.TestUtil;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
index 9ee601f..19a2e98 100644
--- a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
+++ b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
@@ -58,7 +58,6 @@ namespace Lucene.Net.Index
     using BytesRef = Lucene.Net.Util.BytesRef;
     using Constants = Lucene.Net.Util.Constants;
     using StringHelper = Lucene.Net.Util.StringHelper;
-    using SuppressCodecs = Lucene.Net.Util.LuceneTestCase.SuppressCodecs;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
     using TestUtil = Lucene.Net.Util.TestUtil;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/51075743/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs b/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs
index d447b9e..7e6d24e 100644
--- a/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs
+++ b/src/Lucene.Net.Tests/Search/TestControlledRealTimeReopenThread.cs
@@ -49,7 +49,6 @@ namespace Lucene.Net.Search
     using Directory = Lucene.Net.Store.Directory;
     using NRTCachingDirectory = Lucene.Net.Store.NRTCachingDirectory;
     using IOUtils = Lucene.Net.Util.IOUtils;
-    using SuppressCodecs = Lucene.Net.Util.LuceneTestCase.SuppressCodecs;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
     using TestUtil = Lucene.Net.Util.TestUtil;
     //using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;


Mime
View raw message