public override void Run(string[] args) { using (var communicator = Initialize(ref args)) { communicator.SetProperty("TestAdapter.Endpoints", "default"); ZeroC.Ice.ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter"); adapter.Add("test", new decimalI()); adapter.Add("test1", new Test1I()); adapter.Add("test2", new Test2I()); adapter.Activate(); Console.Out.Write("testing operation name... "); Console.Out.Flush(); var p = adapter.CreateProxy("test", IdecimalPrx.Factory); p.@default(); Console.Out.WriteLine("ok"); Console.Out.Write("testing System as module name... "); Console.Out.Flush(); [email protected] t1 = adapter.CreateProxy("test1", [email protected]); t1.op(); ZeroC.Slice.Test.Escape.System.ITestPrx t2 = adapter.CreateProxy("test2", ZeroC.Slice.Test.Escape.System.ITestPrx.Factory); t2.op(); Console.Out.WriteLine("ok"); Console.Out.Write("testing types... "); Console.Out.Flush(); testtypes(); Console.Out.WriteLine("ok"); } }
public override async Task RunAsync(string[] args) { await using ZeroC.Ice.Communicator communicator = Initialize(ref args); var endpoint = Protocol == ZeroC.Ice.Protocol.Ice1 ? $"{Transport} -h {Host}" : $"ice+{Transport}://{Host}:0"; communicator.SetProperty("TestAdapter.Endpoints", endpoint); ZeroC.Ice.ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter"); adapter.Add("test", new Decimal()); adapter.Add("test1", new Test1I()); adapter.Add("test2", new Test2I()); await adapter.ActivateAsync(); Console.Out.Write("testing operation name... "); Console.Out.Flush(); IdecimalPrx p = adapter.CreateProxy("test", IdecimalPrx.Factory); p.@default(); Console.Out.WriteLine("ok"); Console.Out.Write("testing System as module name... "); Console.Out.Flush(); [email protected] t1 = adapter.CreateProxy("test1", [email protected]); t1.op(); ZeroC.Slice.Test.Escape.System.ITestPrx t2 = adapter.CreateProxy("test2", ZeroC.Slice.Test.Escape.System.ITestPrx.Factory); t2.op(); Console.Out.WriteLine("ok"); Console.Out.Write("testing types... "); Console.Out.Flush(); Testtypes(); Console.Out.WriteLine("ok"); }