blob: c0021b7591b03e8383effe0b042ce529c4f574b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
#include <Ice/Ice.h>
#include <TestHelper.h>
#include <CallbackI.h>
using namespace std;
using namespace Ice;
using namespace Test;
class CallbackServer final : public Test::TestHelper
{
public:
void run(int, char**) override;
};
void
CallbackServer::run(int argc, char** argv)
{
auto properties = createTestProperties(argc, argv);
properties->setProperty("Ice.Warn.Connections", "0");
properties->setProperty("Ice.Warn.Dispatch", "0");
Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
communicator->getProperties()->setProperty("CallbackAdapter.Endpoints", getTestEndpoint());
auto adapter = communicator->createObjectAdapter("CallbackAdapter");
adapter->add(make_shared<CallbackI>(), Ice::stringToIdentity("c1/callback")); // The test allows "c1" as category.
adapter->add(make_shared<CallbackI>(), Ice::stringToIdentity("c2/callback")); // The test allows "c2" as category.
adapter->add(make_shared<CallbackI>(), Ice::stringToIdentity("c3/callback")); // The test rejects "c3" as category.
adapter->add(make_shared<CallbackI>(), Ice::stringToIdentity("_userid/callback")); // The test allows the prefixed userid.
adapter->activate();
communicator->waitForShutdown();
}
DEFINE_TEST(CallbackServer)
|