lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject lucenenet git commit: Updated TestDefaultCodecFactory to account for the new lazy loading behavior of DefaultCodecFactory
Date Thu, 18 May 2017 13:52:55 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 3e9c4ab0a -> 33abcb79e


Updated TestDefaultCodecFactory to account for the new lazy loading behavior of DefaultCodecFactory


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

Branch: refs/heads/master
Commit: 33abcb79e108b626892538b39ecc19c5cfd98252
Parents: 3e9c4ab
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Thu May 18 20:52:37 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu May 18 20:52:37 2017 +0700

----------------------------------------------------------------------
 .../Support/Codecs/TestDefaultCodecFactory.cs     | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/33abcb79/src/Lucene.Net.Tests/Support/Codecs/TestDefaultCodecFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Support/Codecs/TestDefaultCodecFactory.cs b/src/Lucene.Net.Tests/Support/Codecs/TestDefaultCodecFactory.cs
index d8c0fd4..5b7159a 100644
--- a/src/Lucene.Net.Tests/Support/Codecs/TestDefaultCodecFactory.cs
+++ b/src/Lucene.Net.Tests/Support/Codecs/TestDefaultCodecFactory.cs
@@ -45,8 +45,9 @@ namespace Lucene.Net.Codecs
 
         private class ScanningCodecFactory : DefaultCodecFactory
         {
-            public ScanningCodecFactory()
+            protected override void Initialize()
             {
+                base.Initialize();
                 base.ScanForCodecs(this.GetType().GetTypeInfo().Assembly);
             }
         }
@@ -78,8 +79,9 @@ namespace Lucene.Net.Codecs
 
         private class ExplicitCodecFactory : DefaultCodecFactory
         {
-            public ExplicitCodecFactory()
+            protected override void Initialize()
             {
+                base.Initialize();
                 base.PutCodecType(typeof(PrivateCodec));
             }
         }
@@ -96,8 +98,9 @@ namespace Lucene.Net.Codecs
 
         private class InvalidNameCodecFactory : DefaultCodecFactory
         {
-            public InvalidNameCodecFactory()
+            protected override void Initialize()
             {
+                base.Initialize();
                 base.PutCodecType(typeof(InvalidNamedCodec));
             }
         }
@@ -105,13 +108,15 @@ namespace Lucene.Net.Codecs
         [Test]
         public void TestInvalidName()
         {
-            Assert.Throws<ArgumentException>(() => new InvalidNameCodecFactory());
+            var factory = new InvalidNameCodecFactory();
+            Assert.Throws<ArgumentException>(() => factory.GetCodec("SomeCodec"));
         }
 
         private class CustomNameCodecFactory : DefaultCodecFactory
         {
-            public CustomNameCodecFactory()
+            protected override void Initialize()
             {
+                base.Initialize();
                 base.PutCodecType(typeof(CustomNamedCodec));
             }
         }
@@ -150,8 +155,9 @@ namespace Lucene.Net.Codecs
 
         private class ReplaceCodecFactory : DefaultCodecFactory
         {
-            public ReplaceCodecFactory()
+            protected override void Initialize()
             {
+                base.Initialize();
                 base.PutCodecType(typeof(TestLucene40Codec));
             }
         }


Mime
View raw message