diff options
Diffstat (limited to 'csharp/test/Ice/objects/Collocated.cs')
-rw-r--r-- | csharp/test/Ice/objects/Collocated.cs | 57 |
1 files changed, 10 insertions, 47 deletions
diff --git a/csharp/test/Ice/objects/Collocated.cs b/csharp/test/Ice/objects/Collocated.cs index 94eb3ccef0c..637b8a01b77 100644 --- a/csharp/test/Ice/objects/Collocated.cs +++ b/csharp/test/Ice/objects/Collocated.cs @@ -9,7 +9,6 @@ using Test; using System; -using System.Diagnostics; using System.Reflection; [assembly: CLSCompliant(true)] @@ -18,17 +17,17 @@ using System.Reflection; [assembly: AssemblyDescription("Ice test")] [assembly: AssemblyCompany("ZeroC, Inc.")] -public class Client +public class Collocated : TestCommon.Application { - private static int run(string[] args, Ice.Communicator communicator) + public override int run(string[] args) { - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010"); - Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); - Initial initial = new InitialI(adapter); - adapter.add(initial, communicator.stringToIdentity("initial")); + communicator().getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); + var initial = new InitialI(adapter); + adapter.add(initial, Ice.Util.stringToIdentity("initial")); UnexpectedObjectExceptionTestI uet = new UnexpectedObjectExceptionTestI(); - adapter.add(uet, communicator.stringToIdentity("uoet")); - AllTests.allTests(communicator); + adapter.add(uet, Ice.Util.stringToIdentity("uoet")); + AllTests.allTests(this); // We must call shutdown even in the collocated case for cyclic dependency cleanup initial.shutdown(); return 0; @@ -36,43 +35,7 @@ public class Client public static int Main(string[] args) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - Ice.InitializationData data = new Ice.InitializationData(); -#if COMPACT - // - // When using Ice for .NET Compact Framework, we need to specify - // the assembly so that Ice can locate classes and exceptions. - // - data.properties = Ice.Util.createProperties(); - data.properties.setProperty("Ice.FactoryAssemblies", "collocated"); -#endif - - communicator = Ice.Util.initialize(ref args, data); - status = run(args, communicator); - } - catch(System.Exception ex) - { - System.Console.WriteLine(ex); - status = 1; - } - - if(communicator != null) - { - try - { - communicator.destroy(); - } - catch(Ice.LocalException ex) - { - System.Console.WriteLine(ex); - status = 1; - } - } - - return status; + Collocated app = new Collocated(); + return app.runmain(args); } } |