ICE 3.4.2
[php5-ice-freebsdport.git] / cs / test / IceGrid / simple / Client.cs
blobe4de1dbf0130a9c8d6d309e13dd8d268aefaff65
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
10 using Test;
11 using System;
12 using System.Diagnostics;
13 using System.Reflection;
15 [assembly: CLSCompliant(true)]
17 [assembly: AssemblyTitle("IceTest")]
18 [assembly: AssemblyDescription("Ice test")]
19 [assembly: AssemblyCompany("ZeroC, Inc.")]
21 public class Client
23 private static int run(string[] args, Ice.Communicator communicator)
25 bool withDeploy = false;
26 for(int i = 0; i < args.Length; i++)
28 if(args[i].Equals("--with-deploy"))
30 withDeploy = true;
31 break;
35 if(!withDeploy)
37 AllTests.allTests(communicator);
39 else
41 AllTests.allTestsWithDeploy(communicator);
44 return 0;
47 public static int Main(string[] args)
49 int status = 0;
50 Ice.Communicator communicator = null;
52 #if !COMPACT
53 Debug.Listeners.Add(new ConsoleTraceListener());
54 #endif
56 try
58 communicator = Ice.Util.initialize(ref args);
59 status = run(args, communicator);
61 catch (System.Exception ex)
63 System.Console.Error.WriteLine(ex);
64 status = 1;
67 if (communicator != null)
69 try
71 communicator.destroy();
73 catch (Ice.LocalException ex)
75 System.Console.Error.WriteLine(ex);
76 status = 1;
80 return status;