lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [06/15] lucenenet git commit: Lucene.Net.Tests: Added missing test TestWorstCaseTestBehavior on .NET Core
Date Sat, 08 Apr 2017 21:37:56 GMT
Lucene.Net.Tests: Added missing test TestWorstCaseTestBehavior on .NET Core


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

Branch: refs/heads/api-work
Commit: f4b7dae5eb9a384e701b13b5d10fe921f7d8c130
Parents: b7f2ac1
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Apr 9 02:23:23 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Apr 9 02:23:23 2017 +0700

----------------------------------------------------------------------
 .../TestWorstCaseTestBehavior.cs                | 24 +++++++++++++++++---
 src/Lucene.Net.Tests/project.json               |  1 -
 2 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f4b7dae5/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs b/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs
index 531c7d9..fbbe4d6 100644
--- a/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs
+++ b/src/Lucene.Net.Tests/TestWorstCaseTestBehavior.cs
@@ -25,6 +25,7 @@ namespace Lucene.Net
 
     public class TestWorstCaseTestBehavior : LuceneTestCase
     {
+#if !NETSTANDARD
         [Ignore("Ignored in Lucene")]
         [Test]
         public virtual void TestThreadLeak()
@@ -34,11 +35,12 @@ namespace Lucene.Net
 
             while (!t.IsAlive)
             {
-                Thread.@Yield();
+                Thread.Yield();
             }
 
             // once alive, leave it to run outside of the test scope.
         }
+#endif
 
         private class ThreadAnonymousInnerClassHelper : ThreadClass
         {
@@ -51,9 +53,12 @@ namespace Lucene.Net
 
             public override void Run()
             {
+#if !NETSTANDARD
                 try
                 {
+#endif
                     Thread.Sleep(10000);
+#if !NETSTANDARD
                 }
 #pragma warning disable 168
                 catch (ThreadInterruptedException e)
@@ -61,6 +66,7 @@ namespace Lucene.Net
                 {
                     // Ignore.
                 }
+#endif
             }
         }
 
@@ -122,7 +128,11 @@ namespace Lucene.Net
         }
 
         [Ignore("Ignored in Lucene")]
-        [Test, Timeout(500)]
+#if !NETSTANDARD
+        // LUCENENET: There is no Timeout on NUnit for .NET Core.
+        [Timeout(500)]
+#endif
+        [Test]
         public virtual void TestTimeout()
         {
             Thread.Sleep(5000);
@@ -130,20 +140,28 @@ namespace Lucene.Net
 
 
         [Ignore("Ignored in Lucene")]
-        [Test, Timeout(1000)]
+#if !NETSTANDARD
+        // LUCENENET: There is no Timeout on NUnit for .NET Core.
+        [Timeout(1000)]
+#endif
+        [Test]
         public virtual void TestZombie()
         {
             while (true)
             {
+#if !NETSTANDARD
                 try
                 {
+#endif
                     Thread.Sleep(1000);
+#if !NETSTANDARD
                 }
 #pragma warning disable 168
                 catch (ThreadInterruptedException e)
 #pragma warning restore 168
                 {
                 }
+#endif
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f4b7dae5/src/Lucene.Net.Tests/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/project.json b/src/Lucene.Net.Tests/project.json
index 550bc5e..b41e3a5 100644
--- a/src/Lucene.Net.Tests/project.json
+++ b/src/Lucene.Net.Tests/project.json
@@ -73,7 +73,6 @@
           "excludeFiles": [
             "Support/TestApiConsistency.cs",
             "TestMergeSchedulerExternal.cs",
-            "TestWorstCaseTestBehavior.cs",
             "Index/TestConcurrentMergeScheduler.cs",
             "Support/BigObject.cs",
             "Support/CollisionTester.cs",


Mime
View raw message