ICE 3.4.2
[php5-ice-freebsdport.git] / cpp / test / Ice / dispatcher / Client.cpp
blob46e7c7dbe592ff8fdbbb1631d27a685e40de3a6e
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 #include <Ice/Ice.h>
11 #include <TestCommon.h>
12 #include <Test.h>
13 #include <Dispatcher.h>
15 using namespace std;
17 int
18 run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
20 void allTests(const Ice::CommunicatorPtr&);
21 allTests(communicator);
22 return EXIT_SUCCESS;
25 int
26 main(int argc, char* argv[])
28 int status;
29 Ice::CommunicatorPtr communicator;
31 try
33 Ice::InitializationData initData;
34 initData.properties = Ice::createProperties(argc, argv);
35 initData.dispatcher = new Dispatcher();
36 communicator = Ice::initialize(argc, argv, initData);
37 status = run(argc, argv, communicator);
39 catch(const Ice::Exception& ex)
41 cerr << ex << endl;
42 status = EXIT_FAILURE;
45 if(communicator)
47 try
49 communicator->destroy();
51 catch(const Ice::Exception& ex)
53 cerr << ex << endl;
54 status = EXIT_FAILURE;
57 Dispatcher::terminate();
58 return status;