summaryrefslogtreecommitdiff
path: root/csharp/test/IceSSL/configuration/Server.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/test/IceSSL/configuration/Server.cs')
-rw-r--r--csharp/test/IceSSL/configuration/Server.cs53
1 files changed, 16 insertions, 37 deletions
diff --git a/csharp/test/IceSSL/configuration/Server.cs b/csharp/test/IceSSL/configuration/Server.cs
index a6f5d4b5905..abcc5b0d65b 100644
--- a/csharp/test/IceSSL/configuration/Server.cs
+++ b/csharp/test/IceSSL/configuration/Server.cs
@@ -8,7 +8,6 @@
// **********************************************************************
using System;
-using System.Diagnostics;
using System.Reflection;
[assembly: CLSCompliant(true)]
@@ -17,49 +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", "tcp -p 12010");
- Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
- Ice.Identity id = communicator.stringToIdentity("factory");
- adapter.add(new ServerFactoryI(), id);
+ if(args.Length < 1)
+ {
+ Console.Error.WriteLine("Usage: server testdir");
+ return 1;
+ }
+
+ communicator().getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0, "tcp"));
+ Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter");
+ Ice.Identity id = Ice.Util.stringToIdentity("factory");
+ adapter.add(new ServerFactoryI(args[0] + "/../certs"), id);
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)
- {
- Console.Error.WriteLine(ex);
- status = 1;
- }
-
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Ice.LocalException ex)
- {
- Console.Error.WriteLine(ex);
- status = 1;
- }
- }
-
- return status;
+ Server app = new Server();
+ return app.runmain(args);
}
}