summaryrefslogtreecommitdiff
path: root/cpp/test/Glacier2/attack/Server.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2019-11-01 11:24:52 -0400
committerJoe George <joe@zeroc.com>2021-02-02 10:55:08 -0500
commit336c68e6e413f45a7269ca6e83850d9e1ef9f751 (patch)
treed3fc90d53718041c9760cde317b8be194a20807c /cpp/test/Glacier2/attack/Server.cpp
parentRemove Ice::Application & Glacier2::Application deprecated classes (diff)
downloadice-336c68e6e413f45a7269ca6e83850d9e1ef9f751.tar.bz2
ice-336c68e6e413f45a7269ca6e83850d9e1ef9f751.tar.xz
ice-336c68e6e413f45a7269ca6e83850d9e1ef9f751.zip
Update Glacier2 tests to use C++11 mapping
Diffstat (limited to 'cpp/test/Glacier2/attack/Server.cpp')
-rw-r--r--cpp/test/Glacier2/attack/Server.cpp35
1 files changed, 4 insertions, 31 deletions
diff --git a/cpp/test/Glacier2/attack/Server.cpp b/cpp/test/Glacier2/attack/Server.cpp
index 7fa07896709..c70ed62ef4c 100644
--- a/cpp/test/Glacier2/attack/Server.cpp
+++ b/cpp/test/Glacier2/attack/Server.cpp
@@ -10,38 +10,11 @@ using namespace std;
using namespace Ice;
using namespace Test;
-class ServantLocatorI : public virtual ServantLocator
+class BackendServer final : public Test::TestHelper
{
public:
- ServantLocatorI() :
- _backend(new BackendI)
- {
- }
-
- virtual ObjectPtr locate(const Current&, LocalObjectPtr&)
- {
- return _backend;
- }
-
- virtual void finished(const Current&, const ObjectPtr&, const LocalObjectPtr&)
- {
- }
-
- virtual void deactivate(const string&)
- {
- }
-
-private:
-
- BackendPtr _backend;
-};
-
-class BackendServer : public Test::TestHelper
-{
-public:
-
- void run(int, char**);
+ void run(int, char**) override;
};
void
@@ -49,8 +22,8 @@ BackendServer::run(int argc, char** argv)
{
Ice::CommunicatorHolder communicator = initialize(argc, argv);
communicator->getProperties()->setProperty("BackendAdapter.Endpoints", getTestEndpoint());
- ObjectAdapterPtr adapter = communicator->createObjectAdapter("BackendAdapter");
- adapter->addServantLocator(new ServantLocatorI, "");
+ auto adapter = communicator->createObjectAdapter("BackendAdapter");
+ adapter->addDefaultServant(make_shared<BackendI>(), "");
adapter->activate();
communicator->waitForShutdown();
}