diff options
Diffstat (limited to 'csharp/test/IceBox/admin/Client.cs')
-rw-r--r-- | csharp/test/IceBox/admin/Client.cs | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/csharp/test/IceBox/admin/Client.cs b/csharp/test/IceBox/admin/Client.cs new file mode 100644 index 00000000000..f6283584eda --- /dev/null +++ b/csharp/test/IceBox/admin/Client.cs @@ -0,0 +1,73 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2015 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. +// +// ********************************************************************** + +using System; +using System.Diagnostics; +using System.Reflection; + +[assembly: CLSCompliant(true)] + +[assembly: AssemblyTitle("IceTest")] +[assembly: AssemblyDescription("Ice test")] +[assembly: AssemblyCompany("ZeroC, Inc.")] + +public class Client +{ + private static int run(string[] args, Ice.Communicator communicator) + { + AllTests.allTests(communicator); + + // + // Shutdown the IceBox server. + // + Ice.ProcessPrxHelper.uncheckedCast( + communicator.stringToProxy("DemoIceBox/admin -f Process:default -p 9996")).shutdown(); + return 0; + } + + public static int Main(string[] args) + { + int status = 0; + Ice.Communicator communicator = null; + +#if !COMPACT + Debug.Listeners.Add(new ConsoleTraceListener()); +#endif + + try + { + Ice.InitializationData initData = new Ice.InitializationData(); + initData.properties = Ice.Util.createProperties(ref args); + initData.properties.setProperty("Ice.Default.Host", "127.0.0.1"); + communicator = Ice.Util.initialize(ref args, initData); + 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; + } + +} |