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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
// **********************************************************************
//
// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#include <Ice/Ice.h>
#include <TestHelper.h>
#include <TestAMDI.h>
using namespace std;
class ServerAMD : public Test::TestHelper
{
public:
void run(int, char**);
};
void
ServerAMD::run(int argc, char** argv)
{
Ice::PropertiesPtr properties = createTestProperties(argc, argv);
properties->setProperty("Ice.Warn.Dispatch", "0");
properties->setProperty("Ice.Warn.Connections", "0");
properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(0));
communicator->getProperties()->setProperty("TestAdapter2.Endpoints", getTestEndpoint(1));
communicator->getProperties()->setProperty("TestAdapter2.MessageSizeMax", "0");
communicator->getProperties()->setProperty("TestAdapter3.Endpoints", getTestEndpoint(2));
communicator->getProperties()->setProperty("TestAdapter3.MessageSizeMax", "1");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
Ice::ObjectAdapterPtr adapter2 = communicator->createObjectAdapter("TestAdapter2");
Ice::ObjectAdapterPtr adapter3 = communicator->createObjectAdapter("TestAdapter3");
Ice::ObjectPtr object = ICE_MAKE_SHARED(ThrowerI);
adapter->add(object, Ice::stringToIdentity("thrower"));
adapter2->add(object, Ice::stringToIdentity("thrower"));
adapter3->add(object, Ice::stringToIdentity("thrower"));
adapter->activate();
adapter2->activate();
adapter3->activate();
serverReady();
communicator->waitForShutdown();
}
DEFINE_TEST(ServerAMD)
|