diff options
Diffstat (limited to 'csharp/test/Ice/serialize')
-rw-r--r-- | csharp/test/Ice/serialize/AllTests.cs | 8 | ||||
-rw-r--r-- | csharp/test/Ice/serialize/Client.cs | 38 | ||||
-rwxr-xr-x | csharp/test/Ice/serialize/run.py | 25 |
3 files changed, 13 insertions, 58 deletions
diff --git a/csharp/test/Ice/serialize/AllTests.cs b/csharp/test/Ice/serialize/AllTests.cs index bd9c24dcb3a..1274715e03e 100644 --- a/csharp/test/Ice/serialize/AllTests.cs +++ b/csharp/test/Ice/serialize/AllTests.cs @@ -15,7 +15,7 @@ using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; using Test; -public class AllTests : TestCommon.TestApp +public class AllTests : TestCommon.AllTests { // // There does not appear to be any way to compare collections @@ -63,8 +63,10 @@ public class AllTests : TestCommon.TestApp return true; } - static public int run(Ice.Communicator communicator) + static public int run(TestCommon.Application app) { + Ice.Communicator communicator = app.communicator(); + Write("testing serialization... "); Flush(); @@ -164,7 +166,7 @@ public class AllTests : TestCommon.TestApp private static T inOut<T>(T o, Ice.Communicator communicator) { - BinaryFormatter bin = new BinaryFormatter(null, + BinaryFormatter bin = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, communicator)); using (MemoryStream mem = new MemoryStream()) { diff --git a/csharp/test/Ice/serialize/Client.cs b/csharp/test/Ice/serialize/Client.cs index 0fb56692d3e..3aed5564fe6 100644 --- a/csharp/test/Ice/serialize/Client.cs +++ b/csharp/test/Ice/serialize/Client.cs @@ -16,38 +16,16 @@ using System.Reflection; [assembly: AssemblyDescription("Ice test")] [assembly: AssemblyCompany("ZeroC, Inc.")] -public class Client +public class Client : TestCommon.Application { - public static int Main(string[] args) + public override int run(string[] args) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - Ice.InitializationData data = new Ice.InitializationData(); - communicator = Ice.Util.initialize(ref args, data); - status = AllTests.run(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 AllTests.run(this); + } - return status; + public static int Main(string[] args) + { + Client app = new Client(); + return app.runmain(args); } } diff --git a/csharp/test/Ice/serialize/run.py b/csharp/test/Ice/serialize/run.py deleted file mode 100755 index 5238b99164b..00000000000 --- a/csharp/test/Ice/serialize/run.py +++ /dev/null @@ -1,25 +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 - -client = os.path.join(os.getcwd(), "client") - -TestUtil.simpleTest(client) |