summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/background/Client.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-06-01 17:41:03 +0200
committerJose <jose@zeroc.com>2018-06-01 17:41:03 +0200
commitcbe92e540a7f02f0bdf93192424bd119189365b7 (patch)
tree411c50dc0ae9c669d31a940b1b4903b5deac4f12 /cpp/test/Ice/background/Client.cpp
parentFixed Util.py check for binary installation directory on Windows (diff)
downloadice-cbe92e540a7f02f0bdf93192424bd119189365b7.tar.bz2
ice-cbe92e540a7f02f0bdf93192424bd119189365b7.tar.xz
ice-cbe92e540a7f02f0bdf93192424bd119189365b7.zip
Do not use Ice::Application for Ice testsuite
Diffstat (limited to 'cpp/test/Ice/background/Client.cpp')
-rw-r--r--cpp/test/Ice/background/Client.cpp93
1 files changed, 39 insertions, 54 deletions
diff --git a/cpp/test/Ice/background/Client.cpp b/cpp/test/Ice/background/Client.cpp
index b7488777d25..be276a3393f 100644
--- a/cpp/test/Ice/background/Client.cpp
+++ b/cpp/test/Ice/background/Client.cpp
@@ -8,7 +8,7 @@
// **********************************************************************
#include <Ice/Ice.h>
-#include <TestCommon.h>
+#include <TestHelper.h>
#include <Test.h>
#include <Configuration.h>
@@ -26,64 +26,49 @@ Ice::Plugin* createTestTransport(const Ice::CommunicatorPtr&, const std::string&
};
-int
-run(int, char**, const Ice::CommunicatorPtr& communicator)
+class Client : public Test::TestHelper
{
- BackgroundPrxPtr allTests(const Ice::CommunicatorPtr&);
- BackgroundPrxPtr background = allTests(communicator);
- background->shutdown();
- return EXIT_SUCCESS;
-}
+public:
+
+ void run(int, char**);
+};
-int
-main(int argc, char* argv[])
+void
+Client::run(int argc, char** argv)
{
#ifdef ICE_STATIC_LIBS
- Ice::registerIceSSL(false);
- Ice::registerIceWS(true);
Ice::registerPluginFactory("Test", createTestTransport, false);
#endif
- int status;
- Ice::CommunicatorPtr communicator;
- try
- {
- Ice::InitializationData initData = getTestInitData(argc, argv);
-
- //
- // For this test, we want to disable retries.
- //
- initData.properties->setProperty("Ice.RetryIntervals", "-1");
-
- //
- // This test kills connections, so we don't want warnings.
- //
- initData.properties->setProperty("Ice.Warn.Connections", "0");
-
- // This test relies on filling the TCP send/recv buffer, so
- // we rely on a fixed value for these buffers.
- initData.properties->setProperty("Ice.TCP.SndSize", "50000");
-
- //
- // Setup the test transport plug-in.
- //
- initData.properties->setProperty("Ice.Plugin.Test", "TestTransport:createTestTransport");
- string defaultProtocol = initData.properties->getPropertyWithDefault("Ice.Default.Protocol", "tcp");
- initData.properties->setProperty("Ice.Default.Protocol", "test-" + defaultProtocol);
-
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
- }
- catch(const Ice::Exception& ex)
- {
- cerr << ex << " " << ex.ice_stackTrace() << endl;
- status = EXIT_FAILURE;
- }
-
- if(communicator)
- {
- communicator->destroy();
- }
-
- return status;
+ Ice::PropertiesPtr properties = createTestProperties(argc, argv);
+
+ //
+ // For this test, we want to disable retries.
+ //
+ properties->setProperty("Ice.RetryIntervals", "-1");
+
+ //
+ // This test kills connections, so we don't want warnings.
+ //
+ properties->setProperty("Ice.Warn.Connections", "0");
+
+ //
+ // This test relies on filling the TCP send/recv buffer, so
+ // we rely on a fixed value for these buffers.
+ //
+ properties->setProperty("Ice.TCP.SndSize", "50000");
+
+ //
+ // Setup the test transport plug-in.
+ //
+ properties->setProperty("Ice.Plugin.Test", "TestTransport:createTestTransport");
+ string defaultProtocol = properties->getPropertyWithDefault("Ice.Default.Protocol", "tcp");
+ properties->setProperty("Ice.Default.Protocol", "test-" + defaultProtocol);
+
+ Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
+ BackgroundPrxPtr allTests(Test::TestHelper*);
+ BackgroundPrxPtr background = allTests(this);
+ background->shutdown();
}
+
+DEFINE_TEST(Client)