ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [3/6] ignite git commit: IGNITE-2193: .NET: Fixed SerivceTest.cs.
Date Fri, 18 Dec 2015 06:46:21 GMT
IGNITE-2193: .NET: Fixed SerivceTest.cs.


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

Branch: refs/heads/ignite-843-rc2
Commit: 889b2689816a7185029eb7c992bf73f14600844c
Parents: 057ad5b
Author: Pavel Tupitsyn <ptupitsyn@gridgain.com>
Authored: Thu Dec 17 17:31:31 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Dec 17 17:31:31 2015 +0300

----------------------------------------------------------------------
 .../Services/ServicesTest.cs                    | 23 +++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/889b2689/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Services/ServicesTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Services/ServicesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Services/ServicesTest.cs
index 33f255e..ffcdea8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Services/ServicesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Services/ServicesTest.cs
@@ -218,10 +218,10 @@ namespace Apache.Ignite.Core.Tests.Services
             }
 
             Services.Cancel(SvcName + 0);
-            Services.Cancel(SvcName + 1);
+            AssertNoService(SvcName + 0);
 
-            Assert.IsNull(Services.GetService<ITestIgniteService>(SvcName + 0));
-            Assert.IsNull(Services.GetService<ITestIgniteService>(SvcName + 1));
+            Services.Cancel(SvcName + 1);
+            AssertNoService(SvcName + 1);
 
             for (var i = 2; i < 10; i++)
                 Assert.IsNotNull(Services.GetService<ITestIgniteService>(SvcName +
i));
@@ -229,7 +229,7 @@ namespace Apache.Ignite.Core.Tests.Services
             Services.CancelAll();
 
             for (var i = 0; i < 10; i++)
-                Assert.IsNull(Services.GetService<ITestIgniteService>(SvcName + i));
+                AssertNoService(SvcName + i);
         }
 
         /// <summary>
@@ -477,8 +477,7 @@ namespace Apache.Ignite.Core.Tests.Services
             Services.CancelAll();
 
             // Cancellation failed, but service is removed.
-            foreach (var grid in Grids)
-                Assert.IsNull(grid.GetServices().GetService<ITestIgniteService>(SvcName));
+            AssertNoService();
         }
 
         [Test]
@@ -579,6 +578,18 @@ namespace Apache.Ignite.Core.Tests.Services
         }
 
         /// <summary>
+        /// Asserts that there is no service on any grid with given name.
+        /// </summary>
+        /// <param name="name">The name.</param>
+        private void AssertNoService(string name = SvcName)
+        {
+            foreach (var grid in Grids)
+                Assert.IsTrue(
+                    TestUtils.WaitForCondition(() => grid.GetServices()
+                        .GetService<ITestIgniteService>(name) == null, 5000));
+        }
+
+        /// <summary>
         /// Gets the services.
         /// </summary>
         protected virtual IServices Services


Mime
View raw message