You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ti...@apache.org on 2022/03/30 12:38:01 UTC

[ignite] branch master updated: IGNITE-16759 .NET: Fix services tests for Windows platform (#9919)

This is an automated email from the ASF dual-hosted git repository.

timoninmaxim pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new e446040  IGNITE-16759 .NET: Fix services tests for Windows platform (#9919)
e446040 is described below

commit e446040161c425c964a628b51cc704d5ae05b48c
Author: Vladimir Steshin <vl...@gmail.com>
AuthorDate: Wed Mar 30 15:37:32 2022 +0300

    IGNITE-16759 .NET: Fix services tests for Windows platform (#9919)
---
 .../Services/ServicesTest.cs                       | 31 +++++++++++-----------
 1 file changed, 15 insertions(+), 16 deletions(-)

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 a89a539..69a794c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Services/ServicesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Services/ServicesTest.cs
@@ -1443,18 +1443,17 @@ namespace Apache.Ignite.Core.Tests.Services
 
             producer.Deploy(cfg);
 
-            var svc = dyn
-                ? consumer.GetDynamicServiceProxy(cfg.Name, false, callCtx)
-                : consumer.GetServiceProxy<IJavaService>(cfg.Name, false, callCtx);
+            var dynSvc = dyn ? consumer.GetDynamicServiceProxy(cfg.Name, false, callCtx) : null;
+            var svc = dyn ? null : consumer.GetServiceProxy<IJavaService>(cfg.Name, false, callCtx);
 
             // Subject service, calculates invocations.
             var helperSvc = producer.GetServiceProxy<IJavaOnlyService>(_javaSvcName, false);
             
             // Do 4 invocations.
-            Assert.AreEqual(3, dyn ? svc.testOverload(1, 2) : ((IJavaService)svc).testOverload(1, 2));
-            Assert.AreEqual(2, dyn ? svc.test(1) : ((IJavaService)svc).test(1));
-            Assert.AreEqual(true, dyn ? svc.test(false) : ((IJavaService)svc).test(false));
-            Assert.AreEqual(null, dyn ? svc.testNull(null) : ((IJavaService)svc).testNull(null));
+            Assert.AreEqual(3, dyn ? dynSvc.testOverload(1, 2) : svc.testOverload(1, 2));
+            Assert.AreEqual(2, dyn ? dynSvc.test(1) : svc.test(1));
+            Assert.AreEqual(true, dyn ? dynSvc.test(false) : svc.test(false));
+            Assert.AreEqual(null, dyn ? dynSvc.testNull(null) : svc.testNull(null));
 
             // Service stats. is not enabled.
             Assert.AreEqual(0, helperSvc.testNumberOfInvocations(cfg.Name));
@@ -1468,25 +1467,24 @@ namespace Apache.Ignite.Core.Tests.Services
             cfg.Service = new PlatformTestService();
             producer.Deploy(cfg);
             
-            svc = dyn
-                ? consumer.GetDynamicServiceProxy(cfg.Name, false, callCtx)
-                : consumer.GetServiceProxy<IJavaService>(cfg.Name, false, callCtx);
+            dynSvc = dyn ? consumer.GetDynamicServiceProxy(cfg.Name, false, callCtx) : null;
+            svc = dyn ? null : consumer.GetServiceProxy<IJavaService>(cfg.Name, false, callCtx);
             
             // Service metrics exists but holds no values.
             Assert.AreEqual(0, helperSvc.testNumberOfInvocations(cfg.Name));
 
             // One invocation.
-            Assert.AreEqual(2, dyn ? svc.test(1) : ((IJavaService)svc).test(1));
+            Assert.AreEqual(2, dyn ? dynSvc.test(1) : svc.test(1));
             
             // There should be just one certain and one total invocation.
             Assert.AreEqual(1, helperSvc.testNumberOfInvocations(cfg.Name, "test"));
             Assert.AreEqual(1, helperSvc.testNumberOfInvocations(cfg.Name));
             
             // Do 4 more invocations.
-            Assert.AreEqual(3, dyn ? svc.testOverload(1, 2) : ((IJavaService)svc).testOverload(1, 2));
-            Assert.AreEqual(2, dyn ? svc.test(1) : ((IJavaService)svc).test(1));
-            Assert.AreEqual(true, dyn ? svc.test(false) : ((IJavaService)svc).test(false));
-            Assert.AreEqual(null, dyn ? svc.testNull(null) : ((IJavaService)svc).testNull(null));
+            Assert.AreEqual(3, dyn ? dynSvc.testOverload(1, 2) : svc.testOverload(1, 2));
+            Assert.AreEqual(2, dyn ? dynSvc.test(1) : svc.test(1));
+            Assert.AreEqual(true, dyn ? dynSvc.test(false) : svc.test(false));
+            Assert.AreEqual(null, dyn ? dynSvc.testNull(null) : svc.testNull(null));
             
             // We did 3 invocations of method named 'test(...)' in total.
             Assert.AreEqual(3, helperSvc.testNumberOfInvocations(cfg.Name, "test"));
@@ -1500,7 +1498,8 @@ namespace Apache.Ignite.Core.Tests.Services
             Assert.AreEqual(5, helperSvc.testNumberOfInvocations(cfg.Name));
             
             // Check side methods are not measured. We still have only 5 invocations.
-            Assert.AreEqual("Apache.Ignite.Core.Tests.Services.PlatformTestService", svc.ToString());
+            Assert.AreEqual("Apache.Ignite.Core.Tests.Services.PlatformTestService", 
+                dyn ? dynSvc.ToString(): svc.ToString());
             Assert.AreEqual(5, helperSvc.testNumberOfInvocations(cfg.Name));
             // 'ToString' must not be measured. Like Java service metrics, it's not declared as a service interface.
             Assert.AreEqual(0, helperSvc.testNumberOfInvocations(cfg.Name, "ToString"));