diff options
Diffstat (limited to 'csharp/test/Ice/slicing/exceptions')
7 files changed, 31 insertions, 141 deletions
diff --git a/csharp/test/Ice/slicing/exceptions/AllTests.cs b/csharp/test/Ice/slicing/exceptions/AllTests.cs index eaa88d04e6b..bbd1ee04413 100644 --- a/csharp/test/Ice/slicing/exceptions/AllTests.cs +++ b/csharp/test/Ice/slicing/exceptions/AllTests.cs @@ -12,7 +12,7 @@ using System.Diagnostics; using System.Threading; using Test; -public class AllTests : TestCommon.TestApp +public class AllTests : TestCommon.AllTests { private class Callback { @@ -90,11 +90,12 @@ public class AllTests : TestCommon.TestApp } } - public static TestIntfPrx allTests(Ice.Communicator communicator, bool collocated) + public static TestIntfPrx allTests(TestCommon.Application app, bool collocated) { + Ice.Communicator communicator = app.communicator(); Write("testing stringToProxy... "); Flush(); - String @ref = "Test:default -p 12010 -t 2000"; + String @ref = "Test:" + app.getTestEndpoint(0) + " -t 2000"; Ice.ObjectPrx @base = communicator.stringToProxy(@ref); test(@base != null); WriteLine("ok"); diff --git a/csharp/test/Ice/slicing/exceptions/Client.cs b/csharp/test/Ice/slicing/exceptions/Client.cs index a89ce7c02e1..bbbedc65880 100644 --- a/csharp/test/Ice/slicing/exceptions/Client.cs +++ b/csharp/test/Ice/slicing/exceptions/Client.cs @@ -10,45 +10,18 @@ using Test; using System; -public class Client +public class Client : TestCommon.Application { - private static int run(string[] args, Ice.Communicator communicator) + public override int run(string[] args) { - TestIntfPrx test = AllTests.allTests(communicator, false); + TestIntfPrx test = AllTests.allTests(this, false); test.shutdown(); return 0; } public static int Main(string[] args) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - Ice.InitializationData data = new Ice.InitializationData(); - communicator = Ice.Util.initialize(ref args, data); - 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/Ice/slicing/exceptions/Server.cs b/csharp/test/Ice/slicing/exceptions/Server.cs index 56bf9f925fb..6d6ed3e3845 100644 --- a/csharp/test/Ice/slicing/exceptions/Server.cs +++ b/csharp/test/Ice/slicing/exceptions/Server.cs @@ -9,51 +9,24 @@ using System; -public class Server +public class Server : TestCommon.Application { - private static int run(string[] args, Ice.Communicator communicator) + public override int run(string[] args) { - Ice.Properties properties = communicator.getProperties(); + Ice.Properties properties = communicator().getProperties(); properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000"); - Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); + properties.setProperty("TestAdapter.Endpoints", getTestEndpoint(0) + " -t 2000"); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); Ice.Object @object = new TestI(); adapter.add(@object, Ice.Util.stringToIdentity("Test")); adapter.activate(); - communicator.waitForShutdown(); + communicator().waitForShutdown(); return 0; } public static int Main(string[] args) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - Ice.InitializationData data = new Ice.InitializationData(); - communicator = Ice.Util.initialize(ref args, data); - 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/Ice/slicing/exceptions/ServerAMD.cs b/csharp/test/Ice/slicing/exceptions/ServerAMD.cs index 56bf9f925fb..6d6ed3e3845 100644 --- a/csharp/test/Ice/slicing/exceptions/ServerAMD.cs +++ b/csharp/test/Ice/slicing/exceptions/ServerAMD.cs @@ -9,51 +9,24 @@ using System; -public class Server +public class Server : TestCommon.Application { - private static int run(string[] args, Ice.Communicator communicator) + public override int run(string[] args) { - Ice.Properties properties = communicator.getProperties(); + Ice.Properties properties = communicator().getProperties(); properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000"); - Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); + properties.setProperty("TestAdapter.Endpoints", getTestEndpoint(0) + " -t 2000"); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); Ice.Object @object = new TestI(); adapter.add(@object, Ice.Util.stringToIdentity("Test")); adapter.activate(); - communicator.waitForShutdown(); + communicator().waitForShutdown(); return 0; } public static int Main(string[] args) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - Ice.InitializationData data = new Ice.InitializationData(); - communicator = Ice.Util.initialize(ref args, data); - 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/Ice/slicing/exceptions/msbuild/server/server.csproj b/csharp/test/Ice/slicing/exceptions/msbuild/server/server.csproj index 324fac5a6f3..6993e7fc04d 100644 --- a/csharp/test/Ice/slicing/exceptions/msbuild/server/server.csproj +++ b/csharp/test/Ice/slicing/exceptions/msbuild/server/server.csproj @@ -34,6 +34,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/Ice/slicing/exceptions/msbuild/serveramd/serveramd.csproj b/csharp/test/Ice/slicing/exceptions/msbuild/serveramd/serveramd.csproj index 3a457f7ec61..51a973707d4 100644 --- a/csharp/test/Ice/slicing/exceptions/msbuild/serveramd/serveramd.csproj +++ b/csharp/test/Ice/slicing/exceptions/msbuild/serveramd/serveramd.csproj @@ -34,6 +34,9 @@ <Folder Include="Properties\" /> </ItemGroup> <ItemGroup> + <Compile Include="..\..\..\..\..\TestCommon\TestApp.cs"> + <Link>TestApp.cs</Link> + </Compile> <Compile Include="..\..\ServerAMD.cs"> <Link>ServerAMD.cs</Link> </Compile> diff --git a/csharp/test/Ice/slicing/exceptions/run.py b/csharp/test/Ice/slicing/exceptions/run.py deleted file mode 100755 index 47575b29694..00000000000 --- a/csharp/test/Ice/slicing/exceptions/run.py +++ /dev/null @@ -1,36 +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 - -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 - -TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.") - -TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.", - additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") - -TestUtil.queueClientServerTest(configName = "slicedAMD", localOnly = True, - message = "Running test with sliced format and AMD server.", server="serveramd") - -TestUtil.queueClientServerTest(configName = "1.0AMD", localOnly = True, - message = "Running test with 1.0 encoding and AMD server.", server="serveramd", - additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") -TestUtil.runQueuedTests() |