1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 #include <Ice/Ice.h>
6 #include <TestHelper.h>
7 #include <Test.h>
8 
9 using namespace std;
10 
11 class Client : public Test::TestHelper
12 {
13 public:
14 
15     void run(int, char**);
16 };
17 
18 void
run(int argc,char ** argv)19 Client::run(int argc, char** argv)
20 {
21     //
22     // In this test, we need at least two threads in the
23     // client side thread pool for nested AMI.
24     //
25     Ice::PropertiesPtr properties = createTestProperties(argc, argv);
26     properties->setProperty("Ice.ThreadPool.Client.Size", "2");
27     properties->setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
28     properties->setProperty("Ice.BatchAutoFlushSize", "100");
29 
30     Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
31 
32     Test::MyClassPrxPtr allTests(Test::TestHelper*);
33     Test::MyClassPrxPtr myClass = allTests(this);
34 
35     myClass->shutdown();
36     cout << "testing server shutdown... " << flush;
37     try
38     {
39 #ifdef _WIN32
40         myClass = myClass->ice_timeout(100); // Workaround to speed up testing
41 #endif
42         myClass->opVoid();
43         test(false);
44     }
45     catch(const Ice::LocalException&)
46     {
47         cout << "ok" << endl;
48     }
49 }
50 
51 DEFINE_TEST(Client)
52