summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/exceptions/Client.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/test/Ice/exceptions/Client.cs')
-rw-r--r--csharp/test/Ice/exceptions/Client.cs58
1 files changed, 14 insertions, 44 deletions
diff --git a/csharp/test/Ice/exceptions/Client.cs b/csharp/test/Ice/exceptions/Client.cs
index a087615969a..70ae0e59daf 100644
--- a/csharp/test/Ice/exceptions/Client.cs
+++ b/csharp/test/Ice/exceptions/Client.cs
@@ -9,7 +9,6 @@
using Test;
using System;
-using System.Diagnostics;
using System.Reflection;
[assembly: CLSCompliant(true)]
@@ -18,56 +17,27 @@ 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)
{
- ThrowerPrx thrower = AllTests.allTests(communicator);
+ ThrowerPrx thrower = AllTests.allTests(this);
thrower.shutdown();
return 0;
}
- public static int Main(string[] args)
+ protected override Ice.InitializationData getInitData(ref string[] args)
{
- int status = 0;
- Ice.Communicator communicator = null;
-
- try
- {
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(ref args);
-#if COMPACT
- //
- // When using Ice for .NET Compact Framework, we need to specify
- // the assembly so that Ice can locate classes and exceptions.
- //
- initData.properties.setProperty("Ice.FactoryAssemblies", "client");
-#endif
- initData.properties.setProperty("Ice.Warn.Connections", "0");
- initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
- initData.properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max
- communicator = Ice.Util.initialize(ref args, initData);
- 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;
- }
- }
+ Ice.InitializationData initData = base.getInitData(ref args);
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
+ initData.properties.setProperty("TestAdapter.Endpoints", getTestEndpoint(initData.properties, 0) + ":udp");
+ initData.properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max
+ return initData;
+ }
- return status;
+ public static int Main(string[] args)
+ {
+ Client app = new Client();
+ return app.runmain(args);
}
}