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"); } }
testtypes() { @abstract.@as a = @abstract.@as.@base; test(a == @abstract.@as.@base); @abstract.@break b = new @abstract.@break(); b.@readonly = 0; test(b.@readonly == 0); @abstract.@case c = new caseI(); test(c != null); @abstract.IcasePrx c1 = null; test(c1 == null); int c2 = 0; if (c1 != null) { c2 = c1.@catch(0); } @abstract.@decimal d = new decimalI(); test(d != null); @abstract.IdecimalPrx d1 = null; if (d1 != null) { d1.@default(); } test(d1 == null); @abstract.@delegate e = new @abstract.@delegate(); test(e != null); @abstract.@delegate e1 = null; test(e1 == null); @abstract.IexplicitPrx f1 = null; if (f1 != null) { c2 = f1.@catch(0); f1.@default(); } test(f1 == null); Dictionary <string, @abstract.@break> g2 = new Dictionary <string, @abstract.@break>(); test(g2 != null); @abstract.@fixed h = new @abstract.@fixed(); h.@for = 0; test(h != null); @abstract.@foreach i = new @abstract.@foreach(); i.@for = 0; i.@goto = 1; i.@if = 2; test(i != null); int j = @[email protected]; test(j == 0); }