diff options
Diffstat (limited to 'csharp/test/IceSSL')
-rw-r--r-- | csharp/test/IceSSL/configuration/AllTests.cs | 5 | ||||
-rw-r--r-- | csharp/test/IceSSL/configuration/Client.cs | 40 | ||||
-rw-r--r-- | csharp/test/IceSSL/configuration/Server.cs | 42 | ||||
-rw-r--r-- | csharp/test/IceSSL/configuration/msbuild/client/client.csproj | 3 | ||||
-rw-r--r-- | csharp/test/IceSSL/configuration/msbuild/server/server.csproj | 3 | ||||
-rwxr-xr-x | csharp/test/IceSSL/configuration/run.py | 30 |
6 files changed, 24 insertions, 99 deletions
diff --git a/csharp/test/IceSSL/configuration/AllTests.cs b/csharp/test/IceSSL/configuration/AllTests.cs index f9b3522a211..17356526a63 100644 --- a/csharp/test/IceSSL/configuration/AllTests.cs +++ b/csharp/test/IceSSL/configuration/AllTests.cs @@ -103,9 +103,10 @@ public class AllTests return initData; } - public static Test.ServerFactoryPrx allTests(Ice.Communicator communicator, string testDir) + public static Test.ServerFactoryPrx allTests(TestCommon.Application app, string testDir) { - string factoryRef = "factory:tcp -p 12010"; + Ice.Communicator communicator = app.communicator(); + string factoryRef = "factory:" + app.getTestEndpoint(0); Ice.ObjectPrx b = communicator.stringToProxy(factoryRef); test(b != null); Test.ServerFactoryPrx factory = Test.ServerFactoryPrxHelper.checkedCast(b); diff --git a/csharp/test/IceSSL/configuration/Client.cs b/csharp/test/IceSSL/configuration/Client.cs index 6154fd3dc5d..3d64e6c7b1b 100644 --- a/csharp/test/IceSSL/configuration/Client.cs +++ b/csharp/test/IceSSL/configuration/Client.cs @@ -16,9 +16,9 @@ using System.Reflection; [assembly: AssemblyDescription("Ice test")] [assembly: AssemblyCompany("ZeroC, Inc.")] -public class Client +public class Client : TestCommon.Application { - private static int run(String[] args, Ice.Communicator communicator) + public override int run(string[] args) { if(args.Length < 1) { @@ -27,41 +27,15 @@ public class Client } Test.ServerFactoryPrx factory; - factory = AllTests.allTests(communicator, args[0]); + factory = AllTests.allTests(this, args[0]); factory.shutdown(); - + 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(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; + Client app = new Client(); + return app.runmain(args); } } diff --git a/csharp/test/IceSSL/configuration/Server.cs b/csharp/test/IceSSL/configuration/Server.cs index 636c41a8188..908a2aa5b12 100644 --- a/csharp/test/IceSSL/configuration/Server.cs +++ b/csharp/test/IceSSL/configuration/Server.cs @@ -16,49 +16,23 @@ 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"); + communicator().getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); Ice.Identity id = Ice.Util.stringToIdentity("factory"); adapter.add(new ServerFactoryI(), 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(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); } } diff --git a/csharp/test/IceSSL/configuration/msbuild/client/client.csproj b/csharp/test/IceSSL/configuration/msbuild/client/client.csproj index bfbf2e8ead2..3c3f882b2d1 100644 --- a/csharp/test/IceSSL/configuration/msbuild/client/client.csproj +++ b/csharp/test/IceSSL/configuration/msbuild/client/client.csproj @@ -39,6 +39,9 @@ <Folder Include="Properties\" /> </ItemGroup> <ItemGroup> + <Compile Include="..\..\..\..\TestCommon\TestApp.cs"> + <Link>TestApp.cs</Link> + </Compile> <Compile Include="..\..\AllTests.cs"> <Link>AllTests.cs</Link> </Compile> diff --git a/csharp/test/IceSSL/configuration/msbuild/server/server.csproj b/csharp/test/IceSSL/configuration/msbuild/server/server.csproj index f7dad3bce7b..626838dac24 100644 --- a/csharp/test/IceSSL/configuration/msbuild/server/server.csproj +++ b/csharp/test/IceSSL/configuration/msbuild/server/server.csproj @@ -39,6 +39,9 @@ <Folder Include="Properties\" /> </ItemGroup> <ItemGroup> + <Compile Include="..\..\..\..\TestCommon\TestApp.cs"> + <Link>TestApp.cs</Link> + </Compile> <Compile Include="..\..\Server.cs"> <Link>Server.cs</Link> </Compile> diff --git a/csharp/test/IceSSL/configuration/run.py b/csharp/test/IceSSL/configuration/run.py deleted file mode 100755 index ad1e1601ec1..00000000000 --- a/csharp/test/IceSSL/configuration/run.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -# ********************************************************************** -# -# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. -# -# This copy of Ice is licensed to you under the terms described in the -# ICE_LICENSE file included in this distribution. -# -# ********************************************************************** - -import os, sys, getopt, re - -path = [ ".", "..", "../..", "../../..", "../../../.." ] -head = os.path.dirname(sys.argv[0]) -if len(head) > 0: - path = [os.path.join(head, p) for p in path] -path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] -if len(path) == 0: - raise RuntimeError("can't find toplevel directory!") -sys.path.append(os.path.join(path[0], "scripts")) -import TestUtil - -# Filter-out the deprecated property warnings -TestUtil.clientTraceFilters = [ lambda x: re.sub("-! .* warning: deprecated property: IceSSL.FindCert.*\n", "", x) ] -TestUtil.serverTraceFilters = [ lambda x: re.sub("-! .* warning: deprecated property: IceSSL.FindCert.*\n", "", x) ] -# -# The drive letter needs to be removed on Windows or loading the SSL -# plug-in will not work. -# -TestUtil.clientServerTest(additionalClientOptions = '"%s"' % os.path.splitdrive(os.getcwd())[1]) |