lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [26/27] lucenenet git commit: Lucene.Net.Tests.project.json: Added missing tests for .NET Core (Index.TestBackwardCompatibility + Index.TestBackwardCompatibility3x + Index.TestFlushByRamOrCountsPolicy + Search.TestFieldCache + Util.TestMathUtil). Deleted
Date Thu, 02 Mar 2017 01:11:09 GMT
Lucene.Net.Tests.project.json: Added missing tests for .NET Core (Index.TestBackwardCompatibility
+ Index.TestBackwardCompatibility3x + Index.TestFlushByRamOrCountsPolicy + Search.TestFieldCache
+ Util.TestMathUtil). Deleted unused Cache.TestSimpleLRUCache test (doesn't exist in Lucene,
and no corresponding class to test).


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

Branch: refs/heads/api-work
Commit: 38e696cfb1156cb83c2b40da68ed725ddd210d6f
Parents: 8c97a24
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Thu Mar 2 05:06:03 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu Mar 2 08:09:07 2017 +0700

----------------------------------------------------------------------
 .../Index/TestBackwardsCompatibility.cs         |  9 ++-
 .../Index/TestBackwardsCompatibility3x.cs       |  9 ++-
 .../Util/Cache/TestSimpleLRUCache.cs            | 77 --------------------
 src/Lucene.Net.Tests/project.json               |  6 --
 4 files changed, 10 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38e696cf/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 c815c91..16fdd5f 100644
--- a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
+++ b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility.cs
@@ -6,6 +6,7 @@ using System.Diagnostics;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Reflection;
 using System.Text;
 
 namespace Lucene.Net.Index
@@ -212,7 +213,7 @@ namespace Lucene.Net.Index
             foreach (string name in names)
             {
                 DirectoryInfo dir = CreateTempDir(name);
-                using (Stream zipFileStream = this.GetType().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "index." + name + ".zip"))
+                using (Stream zipFileStream = this.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "index." + name + ".zip"))
                 {
                     TestUtil.Unzip(zipFileStream, dir);
                 }
@@ -251,7 +252,7 @@ namespace Lucene.Net.Index
                     Console.WriteLine("TEST: index " + UnsupportedNames[i]);
                 }
                 DirectoryInfo oldIndxeDir = CreateTempDir(UnsupportedNames[i]);
-                using (Stream dataFile = this.GetType().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "unsupported." + UnsupportedNames[i] + ".zip"))
+                using (Stream dataFile = this.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "unsupported." + UnsupportedNames[i] + ".zip"))
                 {
                     TestUtil.Unzip(dataFile, oldIndxeDir);
                 }
@@ -960,7 +961,7 @@ namespace Lucene.Net.Index
             foreach (string name in OldIndexDirs.Keys)
             {
                 DirectoryInfo dir = CreateTempDir(name);
-                using (Stream dataFile = this.GetType().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "index." + name + ".zip"))
+                using (Stream dataFile = this.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "index." + name + ".zip"))
                 {
                     TestUtil.Unzip(dataFile, dir);
                 }
@@ -1068,7 +1069,7 @@ namespace Lucene.Net.Index
         public virtual void TestMoreTerms()
         {
             DirectoryInfo oldIndexDir = CreateTempDir("moreterms");
-            using (Stream dataFile = this.GetType().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ MoreTermsIndex))
+            using (Stream dataFile = this.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ MoreTermsIndex))
             {
                 TestUtil.Unzip(dataFile, oldIndexDir);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38e696cf/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 8b437ac..fffab02 100644
--- a/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
+++ b/src/Lucene.Net.Tests/Index/TestBackwardsCompatibility3x.cs
@@ -6,6 +6,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
+using System.Reflection;
 using System.Text;
 
 namespace Lucene.Net.Index
@@ -141,7 +142,7 @@ namespace Lucene.Net.Index
             foreach (string name in names)
             {
                 DirectoryInfo dir = CreateTempDir(name);
-                using (Stream zipFileStream = this.GetType().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "index." + name + ".zip"))
+                using (Stream zipFileStream = this.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "index." + name + ".zip"))
                 {
                     TestUtil.Unzip(zipFileStream, dir);
                 }
@@ -180,7 +181,7 @@ namespace Lucene.Net.Index
                     Console.WriteLine("TEST: index " + UnsupportedNames[i]);
                 }
                 DirectoryInfo oldIndexDir = CreateTempDir(UnsupportedNames[i]);
-                using (Stream dataFile = this.GetType().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "unsupported." + UnsupportedNames[i] + ".zip"))
+                using (Stream dataFile = this.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ "unsupported." + UnsupportedNames[i] + ".zip"))
                 {
                     TestUtil.Unzip(dataFile, oldIndexDir);
                 }
@@ -967,7 +968,7 @@ namespace Lucene.Net.Index
         public virtual void TestSurrogates()
         {
             DirectoryInfo oldIndexDir = CreateTempDir("surrogates");
-            using (Stream dataFile = this.GetType().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ SurrogatesIndexName))
+            using (Stream dataFile = this.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ SurrogatesIndexName))
             {
                 TestUtil.Unzip(dataFile, oldIndexDir);
             }
@@ -1029,7 +1030,7 @@ namespace Lucene.Net.Index
         public virtual void TestNegativePositions()
         {
             DirectoryInfo oldIndexDir = CreateTempDir("negatives");
-            using (Stream dataFile = this.GetType().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ Bogus24IndexName))
+            using (Stream dataFile = this.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(CURRENT_RESOURCE_DIRECTORY
+ Bogus24IndexName))
             {
                 TestUtil.Unzip(dataFile, oldIndexDir);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38e696cf/src/Lucene.Net.Tests/Util/Cache/TestSimpleLRUCache.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Util/Cache/TestSimpleLRUCache.cs b/src/Lucene.Net.Tests/Util/Cache/TestSimpleLRUCache.cs
deleted file mode 100644
index 6b765e0..0000000
--- a/src/Lucene.Net.Tests/Util/Cache/TestSimpleLRUCache.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-
-using NUnit.Framework;
-
-using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
-
-namespace Lucene.Net.Util.Cache
-{
-
-    [TestFixture]
-    public class TestSimpleLRUCache : LuceneTestCase
-    {
-
-        [Test]
-        public virtual void TestLRUCache()
-        {
-            int n = 100;
-            object dummy = new object();
-
-            Cache<int, object> cache = new SimpleLRUCache<int, object>(n);
-
-            for (int i = 0; i < n; i++)
-            {
-                cache.Put(i, dummy);
-            }
-
-            // access every 2nd item in cache
-            for (int i = 0; i < n; i += 2)
-            {
-                Assert.IsNotNull(cache.Get(i));
-            }
-
-            // add n/2 elements to cache, the ones that weren't
-            // touched in the previous loop should now be thrown away
-            for (int i = n; i < n + (n / 2); i++)
-            {
-                cache.Put(i, dummy);
-            }
-
-            // access every 4th item in cache
-            for (int i = 0; i < n; i += 4)
-            {
-                Assert.IsNotNull(cache.Get(i));
-            }
-
-            // add 3/4n elements to cache, the ones that weren't
-            // touched in the previous loops should now be thrown away
-            for (int i = n; i < n + (n * 3 / 4); i++)
-            {
-                cache.Put(i, dummy);
-            }
-
-            // access every 4th item in cache
-            for (int i = 0; i < n; i += 4)
-            {
-                Assert.IsNotNull(cache.Get(i));
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38e696cf/src/Lucene.Net.Tests/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/project.json b/src/Lucene.Net.Tests/project.json
index b4fbc30..82d1117 100644
--- a/src/Lucene.Net.Tests/project.json
+++ b/src/Lucene.Net.Tests/project.json
@@ -12,19 +12,14 @@
     "define": [ "NETSTANDARD", "FEATURE_TASKMERGESCHEDULER" ],
     "compile": {
       "exclude": [
-        "Util/Cache",
         "Util/JunitCompat"
       ],
       "excludeFiles": [
         "TestApiConsistency.cs",
         "TestMergeSchedulerExternal.cs",
         "TestWorstCaseTestBehavior.cs",
-        "Index/TestBackwardsCompatibility.cs",
-        "Index/TestBackwardsCompatibility3x.cs",
         "Index/TestConcurrentMergeScheduler.cs",
-        "Index/TestFlushByRamOrCountsPolicy.cs",
         "Search/TestControlledRealTimeReopenThread.cs",
-        "Search/TestFieldCache.cs",
         "Support/BigObject.cs",
         "Support/CollisionTester.cs",
         "Support/SmallObject.cs",
@@ -42,7 +37,6 @@
         "Support/TestWeakDictionary.cs",
         "Support/TestWeakDictionaryBehavior.cs",
         "Support/TestWeakDictionaryPerformance.cs",
-        "Util/TestMathUtil.cs",
         "Util/TestMaxFailuresRule.cs"
       ]
     },


Mime
View raw message