Beispiel #1
0
    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");
        }
    }
Beispiel #2
0
    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");
    }
Beispiel #3
0
    public override void Run(string[] args)
    {
        using var communicator = Initialize(ref args);
        communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
        ZeroC.Ice.ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");
        adapter.Add("test", new TestIntf());
        adapter.Activate();

        communicator.WaitForShutdown();
    }
Beispiel #4
0
        public override void Run(string[] args)
        {
            var properties = CreateTestProperties(ref args);

            properties["Ice.Warn.Dispatch"] = "0";
            using var communicator          = Initialize(properties);
            communicator.SetProperty("TestAdapter.Endpoints", $"{GetTestEndpoint(0)} -t 2000");
            ZeroC.Ice.ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");
            adapter.Add("Test", new TestIntfAsync());
            adapter.Activate();
            communicator.WaitForShutdown();
        }
Beispiel #5
0
        public override void Run(string[] args)
        {
            using var communicator = Initialize(ref args);
            if (args.Length < 1)
            {
                throw new ArgumentException("Usage: server testdir");
            }

            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0, "tcp"));
            ZeroC.Ice.ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");
            adapter.Add("factory", new ServerFactory(args[0] + "/../certs"));
            adapter.Activate();

            communicator.WaitForShutdown();
        }