diff options
author | Bernard Normier <bernard@zeroc.com> | 2021-01-14 12:12:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 12:12:47 -0500 |
commit | 05edde5bcae0e5ee6b31bdb9923a8e5bb80fede1 (patch) | |
tree | fae64c8758ed0226c7bc005ce9372c6a511b643c /csharp/test | |
parent | Moved alias test from Slice to Ice test directory. (diff) | |
download | ice-before_streamline.tar.bz2 ice-before_streamline.tar.xz ice-before_streamline.zip |
Switch to Async skeletons in Ice core (#1240)before_streamline
Diffstat (limited to 'csharp/test')
-rw-r--r-- | csharp/test/Ice/admin/TestI.cs | 2 | ||||
-rw-r--r-- | csharp/test/Ice/alias/Test.ice | 2 | ||||
-rw-r--r-- | csharp/test/Ice/defaultServant/MyObjectI.cs | 4 | ||||
-rw-r--r-- | csharp/test/Ice/metrics/AllTests.cs | 2 | ||||
-rw-r--r-- | csharp/test/Ice/operations/MyDerivedClassAMDI.cs | 18 | ||||
-rw-r--r-- | csharp/test/Ice/operations/MyDerivedClassI.cs | 22 | ||||
-rw-r--r-- | csharp/test/Ice/proxy/MyDerivedClassAMDI.cs | 4 | ||||
-rw-r--r-- | csharp/test/Ice/proxy/MyDerivedClassI.cs | 6 | ||||
-rw-r--r-- | csharp/test/IceBox/admin/TestServiceI.cs | 2 |
9 files changed, 38 insertions, 24 deletions
diff --git a/csharp/test/Ice/admin/TestI.cs b/csharp/test/Ice/admin/TestI.cs index f50f9bae96d..ae7c1fbd5e8 100644 --- a/csharp/test/Ice/admin/TestI.cs +++ b/csharp/test/Ice/admin/TestI.cs @@ -80,7 +80,7 @@ namespace ZeroC.Ice.Test.Admin // The RemoteCommunicator servant also implements PropertiesAdminUpdateCallback. var servant = new RemoteCommunicator(communicator); - if (communicator.FindAdminFacet("Properties") is IPropertiesAdmin admin) + if (communicator.FindAdminFacet("Properties") is IAsyncPropertiesAdmin admin) { admin.Updated += (_, updates) => servant.Updated(updates); } diff --git a/csharp/test/Ice/alias/Test.ice b/csharp/test/Ice/alias/Test.ice index 88cd35e0ab3..64c3e8b6098 100644 --- a/csharp/test/Ice/alias/Test.ice +++ b/csharp/test/Ice/alias/Test.ice @@ -2,6 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +[[suppress-warning(reserved-identifier)]] + module ZeroC::Ice::Test::Alias { struct Struct1 diff --git a/csharp/test/Ice/defaultServant/MyObjectI.cs b/csharp/test/Ice/defaultServant/MyObjectI.cs index a7a0769ab91..40163662120 100644 --- a/csharp/test/Ice/defaultServant/MyObjectI.cs +++ b/csharp/test/Ice/defaultServant/MyObjectI.cs @@ -1,12 +1,13 @@ // Copyright (c) ZeroC, Inc. All rights reserved. using System.Threading; +using System.Threading.Tasks; namespace ZeroC.Ice.Test.DefaultServant { public sealed class MyObject : IMyObject { - public void IcePing(Current current, CancellationToken cancel) + public ValueTask IcePingAsync(Current current, CancellationToken cancel) { string name = current.Identity.Name; @@ -14,6 +15,7 @@ namespace ZeroC.Ice.Test.DefaultServant { throw new ObjectNotExistException(); } + return default; } public string GetName(Current current, CancellationToken cancel) diff --git a/csharp/test/Ice/metrics/AllTests.cs b/csharp/test/Ice/metrics/AllTests.cs index 77f202ae4bb..012b8d793a3 100644 --- a/csharp/test/Ice/metrics/AllTests.cs +++ b/csharp/test/Ice/metrics/AllTests.cs @@ -396,7 +396,7 @@ namespace ZeroC.Ice.Test.Metrics TestHelper.Assert(serverProps != null && serverMetrics != null); var update = new UpdateCallbackI(serverProps); - ((IPropertiesAdmin)communicator.FindAdminFacet("Properties")!).Updated += (_, u) => update.Updated(); + ((IAsyncPropertiesAdmin)communicator.FindAdminFacet("Properties")!).Updated += (_, u) => update.Updated(); var props = new Dictionary<string, string>(); diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs index 97910c0bf44..2f18ccf7be6 100644 --- a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs @@ -43,24 +43,28 @@ namespace ZeroC.Ice.Test.Operations } // Override the Object "pseudo" operations to verify the operation mode. - public bool IceIsA(string id, Current current, CancellationToken cancel) + public ValueTask<bool> IceIsAAsync(string id, Current current, CancellationToken cancel) { TestHelper.Assert(current.IsIdempotent); - return typeof(IMyDerivedClass).GetAllIceTypeIds().Contains(id); + return new(typeof(IMyDerivedClass).GetAllIceTypeIds().Contains(id)); } - public void IcePing(Current current, CancellationToken cancel) => TestHelper.Assert(current.IsIdempotent); + public ValueTask IcePingAsync(Current current, CancellationToken cancel) + { + TestHelper.Assert(current.IsIdempotent); + return default; + } - public IEnumerable<string> IceIds(Current current, CancellationToken cancel) + public ValueTask<IEnumerable<string>> IceIdsAsync(Current current, CancellationToken cancel) { TestHelper.Assert(current.IsIdempotent); - return typeof(IMyDerivedClass).GetAllIceTypeIds(); + return new(typeof(IMyDerivedClass).GetAllIceTypeIds()); } - public string IceId(Current current, CancellationToken cancel) + public ValueTask<string> IceIdAsync(Current current, CancellationToken cancel) { TestHelper.Assert(current.IsIdempotent); - return typeof(IMyDerivedClass).GetIceTypeId()!; + return new(typeof(IMyDerivedClass).GetIceTypeId()!); } public ValueTask ShutdownAsync(Current current, CancellationToken cancel) diff --git a/csharp/test/Ice/operations/MyDerivedClassI.cs b/csharp/test/Ice/operations/MyDerivedClassI.cs index e9335f16ad6..334efc4a722 100644 --- a/csharp/test/Ice/operations/MyDerivedClassI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassI.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; +using System.Threading.Tasks; using ZeroC.Test; namespace ZeroC.Ice.Test.Operations @@ -16,28 +17,31 @@ namespace ZeroC.Ice.Test.Operations private int _opByteSOnewayCallCount; // Override the Object "pseudo" operations to verify the operation mode. - public bool IceIsA(string id, Current current, CancellationToken cancel) + public ValueTask<bool> IceIsAAsync(string id, Current current, CancellationToken cancel) { TestHelper.Assert(current.IsIdempotent); - return typeof(IMyDerivedClass).GetAllIceTypeIds().Contains(id); + return new(typeof(IMyDerivedClass).GetAllIceTypeIds().Contains(id)); } - public void IcePing(Current current, CancellationToken cancel) => TestHelper.Assert(current.IsIdempotent); + public ValueTask IcePingAsync(Current current, CancellationToken cancel) + { + TestHelper.Assert(current.IsIdempotent); + return default; + } - public IEnumerable<string> IceIds(Current current, CancellationToken cancel) + public ValueTask<IEnumerable<string>> IceIdsAsync(Current current, CancellationToken cancel) { TestHelper.Assert(current.IsIdempotent); - return typeof(IMyDerivedClass).GetAllIceTypeIds(); + return new(typeof(IMyDerivedClass).GetAllIceTypeIds()); } - public string IceId(Current current, CancellationToken cancel) + public ValueTask<string> IceIdAsync(Current current, CancellationToken cancel) { TestHelper.Assert(current.IsIdempotent); - return typeof(IMyDerivedClass).GetIceTypeId()!; + return new(typeof(IMyDerivedClass).GetIceTypeId()!); } - public void Shutdown(Current current, CancellationToken cancel) => - current.Communicator.ShutdownAsync(); + public void Shutdown(Current current, CancellationToken cancel) => current.Communicator.ShutdownAsync(); // TODO check if compress is supported. public bool SupportsCompress(Current current, CancellationToken cancel) => false; diff --git a/csharp/test/Ice/proxy/MyDerivedClassAMDI.cs b/csharp/test/Ice/proxy/MyDerivedClassAMDI.cs index fd130e6b6f1..772ed8d4ada 100644 --- a/csharp/test/Ice/proxy/MyDerivedClassAMDI.cs +++ b/csharp/test/Ice/proxy/MyDerivedClassAMDI.cs @@ -29,10 +29,10 @@ namespace ZeroC.Ice.Test.Proxy CancellationToken cancel) => new(_ctx!); - public bool IceIsA(string typeId, Current current, CancellationToken cancel) + public ValueTask<bool> IceIsAAsync(string typeId, Current current, CancellationToken cancel) { _ctx = current.Context; - return typeof(IMyDerivedClass).GetAllIceTypeIds().Contains(typeId); + return new(typeof(IMyDerivedClass).GetAllIceTypeIds().Contains(typeId)); } public async ValueTask<IRelativeTestPrx> OpRelativeAsync( diff --git a/csharp/test/Ice/proxy/MyDerivedClassI.cs b/csharp/test/Ice/proxy/MyDerivedClassI.cs index 11c2fe5d00c..2ba5db5f250 100644 --- a/csharp/test/Ice/proxy/MyDerivedClassI.cs +++ b/csharp/test/Ice/proxy/MyDerivedClassI.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading; +using System.Threading.Tasks; + using ZeroC.Test; namespace ZeroC.Ice.Test.Proxy @@ -20,10 +22,10 @@ namespace ZeroC.Ice.Test.Proxy public IReadOnlyDictionary<string, string> GetContext(Current current, CancellationToken cancel) => _ctx!; - public bool IceIsA(string typeId, Current current, CancellationToken cancel) + public ValueTask<bool> IceIsAAsync(string typeId, Current current, CancellationToken cancel) { _ctx = current.Context; - return typeof(IMyDerivedClass).GetAllIceTypeIds().Contains(typeId); + return new(typeof(IMyDerivedClass).GetAllIceTypeIds().Contains(typeId)); } public IRelativeTestPrx OpRelative(ICallbackPrx callback, Current current, CancellationToken cancel) diff --git a/csharp/test/IceBox/admin/TestServiceI.cs b/csharp/test/IceBox/admin/TestServiceI.cs index a58e9effa2e..fcc87a3a908 100644 --- a/csharp/test/IceBox/admin/TestServiceI.cs +++ b/csharp/test/IceBox/admin/TestServiceI.cs @@ -18,7 +18,7 @@ namespace ZeroC.IceBox.Test.Admin // The TestFacetI servant also implements PropertiesAdminUpdateCallback. Set the callback on the admin facet. IObject? propFacet = serviceManagerCommunicator.FindAdminFacet("IceBox.Service.TestService.Properties"); - if (propFacet is IPropertiesAdmin admin) + if (propFacet is IAsyncPropertiesAdmin admin) { admin.Updated += (_, updates) => facet.Updated(updates); } |