diff options
Diffstat (limited to 'cpp/test/Ice/operations/Client.cpp')
-rw-r--r-- | cpp/test/Ice/operations/Client.cpp | 64 |
1 files changed, 24 insertions, 40 deletions
diff --git a/cpp/test/Ice/operations/Client.cpp b/cpp/test/Ice/operations/Client.cpp index 29452d3d0c4..a3efb33e179 100644 --- a/cpp/test/Ice/operations/Client.cpp +++ b/cpp/test/Ice/operations/Client.cpp @@ -8,18 +8,34 @@ // ********************************************************************** #include <Ice/Ice.h> -#include <TestCommon.h> +#include <TestHelper.h> #include <Test.h> -DEFINE_TEST("client") - using namespace std; -int -run(int, char**, const Ice::CommunicatorPtr& communicator) +class Client : public Test::TestHelper { - Test::MyClassPrxPtr allTests(const Ice::CommunicatorPtr&); - Test::MyClassPrxPtr myClass = allTests(communicator); +public: + + void run(int, char**); +}; + +void +Client::run(int argc, char** argv) +{ + // + // In this test, we need at least two threads in the + // client side thread pool for nested AMI. + // + Ice::PropertiesPtr properties = createTestProperties(argc, argv); + properties->setProperty("Ice.ThreadPool.Client.Size", "2"); + properties->setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); + properties->setProperty("Ice.BatchAutoFlushSize", "100"); + + Ice::CommunicatorHolder communicator = initialize(argc, argv, properties); + + Test::MyClassPrxPtr allTests(Test::TestHelper*); + Test::MyClassPrxPtr myClass = allTests(this); myClass->shutdown(); cout << "testing server shutdown... " << flush; @@ -35,38 +51,6 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) { cout << "ok" << endl; } - - return EXIT_SUCCESS; } -int -main(int argc, char* argv[]) -{ -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(false); - Ice::registerIceWS(true); -# ifdef ICE_HAS_BT - Ice::registerIceBT(false); -# endif -#endif - - try - { - // - // In this test, we need at least two threads in the - // client side thread pool for nested AMI. - // - Ice::InitializationData initData = getTestInitData(argc, argv); - initData.properties->setProperty("Ice.ThreadPool.Client.Size", "2"); - initData.properties->setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); - initData.properties->setProperty("Ice.BatchAutoFlushSize", "100"); - - Ice::CommunicatorHolder ich(argc, argv, initData); - return run(argc, argv, ich.communicator()); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - return EXIT_FAILURE; - } -} +DEFINE_TEST(Client) |