~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to cs/test/Ice/invoke/Client.cs

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// **********************************************************************
 
2
//
 
3
// Copyright (c) 2003-2010 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
// **********************************************************************
 
9
 
 
10
using System;
 
11
using System.Diagnostics;
 
12
using System.Reflection;
 
13
 
 
14
[assembly: CLSCompliant(true)]
 
15
 
 
16
[assembly: AssemblyTitle("IceTest")]
 
17
[assembly: AssemblyDescription("Ice test")]
 
18
[assembly: AssemblyCompany("ZeroC, Inc.")]
 
19
 
 
20
public class Client
 
21
{
 
22
    private static int run(String[] args, Ice.Communicator communicator)
 
23
    {
 
24
        Test.MyClassPrx myClass = AllTests.allTests(communicator);
 
25
        myClass.shutdown();
 
26
        return 0;
 
27
    }
 
28
    
 
29
    public static void Main(string[] args)
 
30
    {
 
31
        int status = 0;
 
32
        Ice.Communicator communicator = null;
 
33
        
 
34
        Debug.Listeners.Add(new ConsoleTraceListener());
 
35
 
 
36
        try
 
37
        {
 
38
            Ice.InitializationData initData = new Ice.InitializationData();
 
39
            initData.properties = Ice.Util.createProperties(ref args);
 
40
            communicator = Ice.Util.initialize(ref args, initData);
 
41
            status = run(args, communicator);
 
42
        }
 
43
        catch(System.Exception ex)
 
44
        {
 
45
            Console.Error.WriteLine(ex);
 
46
            status = 1;
 
47
        }
 
48
        
 
49
        if(communicator != null)
 
50
        {
 
51
            try
 
52
            {
 
53
                communicator.destroy();
 
54
            }
 
55
            catch(Ice.LocalException ex)
 
56
            {
 
57
                Console.Error.WriteLine(ex);
 
58
                status = 1;
 
59
            }
 
60
        }
 
61
        
 
62
        if(status != 0)
 
63
        {
 
64
            System.Environment.Exit(status);
 
65
        }
 
66
    }
 
67
}