diff options
Diffstat (limited to 'cpp/test/Ice/operations/Collocated.cpp')
-rw-r--r-- | cpp/test/Ice/operations/Collocated.cpp | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/cpp/test/Ice/operations/Collocated.cpp b/cpp/test/Ice/operations/Collocated.cpp index 2b2020e63fc..c3833fc1729 100644 --- a/cpp/test/Ice/operations/Collocated.cpp +++ b/cpp/test/Ice/operations/Collocated.cpp @@ -8,17 +8,25 @@ // ********************************************************************** #include <Ice/Ice.h> -#include <TestCommon.h> +#include <TestHelper.h> #include <TestI.h> -DEFINE_TEST("collocated") - using namespace std; -int -run(int, char**, const Ice::CommunicatorPtr& communicator) +class Collocated : public Test::TestHelper +{ +public: + + void run(int, char**); +}; + +void +Collocated::run(int argc, char** argv) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); + Ice::PropertiesPtr properties = createTestProperties(argc, argv); + properties->setProperty("Ice.BatchAutoFlushSize", "100"); + Ice::CommunicatorHolder communicator = initialize(argc, argv, properties); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint()); communicator->getProperties()->setProperty("TestAdapter.AdapterId", "test"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPrxPtr prx = adapter->add(ICE_MAKE_SHARED(MyDerivedClassI), Ice::stringToIdentity("test")); @@ -26,31 +34,8 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) test(!prx->ice_getConnection()); - Test::MyClassPrxPtr allTests(const Ice::CommunicatorPtr&); - allTests(communicator); - - return EXIT_SUCCESS; + Test::MyClassPrxPtr allTests(Test::TestHelper*); + allTests(this); } -int -main(int argc, char* argv[]) -{ -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(false); - Ice::registerIceWS(true); -#endif - - try - { - Ice::InitializationData initData = getTestInitData(argc, argv); - 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(Collocated) |