diff options
Diffstat (limited to 'csharp/test/Ice/seqMapping/Collocated.cs')
-rw-r--r-- | csharp/test/Ice/seqMapping/Collocated.cs | 54 |
1 files changed, 9 insertions, 45 deletions
diff --git a/csharp/test/Ice/seqMapping/Collocated.cs b/csharp/test/Ice/seqMapping/Collocated.cs index 8c43e10628e..a5ff43fc2f4 100644 --- a/csharp/test/Ice/seqMapping/Collocated.cs +++ b/csharp/test/Ice/seqMapping/Collocated.cs @@ -8,7 +8,6 @@ // ********************************************************************** using System; -using System.Diagnostics; using System.Reflection; [assembly: CLSCompliant(true)] @@ -17,58 +16,23 @@ using System.Reflection; [assembly: AssemblyDescription("Ice test")] [assembly: AssemblyCompany("ZeroC, Inc.")] -public class Collocated +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"); - adapter.add(new MyClassI(), communicator.stringToIdentity("test")); + communicator().getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); + adapter.add(new MyClassI(), Ice.Util.stringToIdentity("test")); //adapter.activate(); // Don't activate OA to ensure collocation is used. - AllTests.allTests(communicator, true); + AllTests.allTests(this, true); return 0; } - public static int Main(String[] args) + 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) - { - Console.Error.WriteLine(ex); - status = 1; - } - - if(communicator != null) - { - try - { - communicator.destroy(); - } - catch(Ice.LocalException ex) - { - Console.Error.WriteLine(ex); - status = 1; - } - } - - return status; + Collocated app = new Collocated(); + return app.runmain(args); } } |