diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-11-25 13:13:22 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-11-25 13:13:22 +0100 |
commit | dcdc32af1fced49d80a8ccd93230e15d91ab45d8 (patch) | |
tree | eb69e2555fbd54496fce8a33f4dd610e1473ff51 /csharp/test/Ice/facets/Server.cs | |
parent | C# IceSSL/configuration log expired certificate exceptions. (diff) | |
download | ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.bz2 ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.xz ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.zip |
Refactored test scripts
Diffstat (limited to 'csharp/test/Ice/facets/Server.cs')
-rw-r--r-- | csharp/test/Ice/facets/Server.cs | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/csharp/test/Ice/facets/Server.cs b/csharp/test/Ice/facets/Server.cs index 63d297d9e8b..b1e07674f05 100644 --- a/csharp/test/Ice/facets/Server.cs +++ b/csharp/test/Ice/facets/Server.cs @@ -16,55 +16,29 @@ using System.Reflection; [assembly: AssemblyDescription("Ice test")] [assembly: AssemblyCompany("ZeroC, Inc.")] -public class Server +public class Server : 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"); + communicator().getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); Ice.Object d = new DI(); adapter.add(d, Ice.Util.stringToIdentity("d")); adapter.addFacet(d, Ice.Util.stringToIdentity("d"), "facetABCD"); Ice.Object f = new FI(); adapter.addFacet(f, Ice.Util.stringToIdentity("d"), "facetEF"); - Ice.Object h = new HI(communicator); + Ice.Object h = new HI(communicator()); adapter.addFacet(h, Ice.Util.stringToIdentity("d"), "facetGH"); adapter.activate(); - communicator.waitForShutdown(); + communicator().waitForShutdown(); return 0; } public static int Main(string[] args) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - communicator = Ice.Util.initialize(ref args); - 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; + Server app = new Server(); + return app.runmain(args); } } |