Beispiel #1
0
    public override void run(string[] args)
    {
        using (var communicator = initialize(ref args))
        {
            communicator.SetProperty("TestAdapter.Endpoints", "default");
            Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
            adapter.Add(new decimalI(), "test");
            adapter.Add(new Test1I(), "test1");
            adapter.Add(new Test2I(), "test2");
            adapter.Activate();

            Console.Out.Write("testing operation name... ");
            Console.Out.Flush();
            @abstract.IdecimalPrx p = @abstract.IdecimalPrx.UncheckedCast(adapter.CreateProxy("test"));
            p.@default();
            Console.Out.WriteLine("ok");

            Console.Out.Write("testing System as module name... ");
            Console.Out.Flush();
            @abstract.System.ITestPrx t1 = @abstract.System.ITestPrx.UncheckedCast(adapter.CreateProxy("test1"));
            t1.op();

            System.ITestPrx t2 = System.ITestPrx.UncheckedCast(adapter.CreateProxy("test2"));

            t2.op();
            Console.Out.WriteLine("ok");

            Console.Out.Write("testing types... ");
            Console.Out.Flush();
            testtypes();
            Console.Out.WriteLine("ok");
        }
    }