summaryrefslogtreecommitdiff
path: root/cpp/test/IceStorm/single/Subscriber.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/IceStorm/single/Subscriber.cpp')
-rw-r--r--cpp/test/IceStorm/single/Subscriber.cpp50
1 files changed, 38 insertions, 12 deletions
diff --git a/cpp/test/IceStorm/single/Subscriber.cpp b/cpp/test/IceStorm/single/Subscriber.cpp
index 4ed30d79915..07068a99852 100644
--- a/cpp/test/IceStorm/single/Subscriber.cpp
+++ b/cpp/test/IceStorm/single/Subscriber.cpp
@@ -123,6 +123,21 @@ run(int, char* argv[], const CommunicatorPtr& communicator)
ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("SingleAdapter", "default:udp");
+ //
+ // Test topic name that is too long
+ //
+ if(string(argv[1]) != "transient")
+ {
+ try
+ {
+ manager->create(string(512, 'A'));
+ test(false);
+ }
+ catch(const Ice::UnknownException&)
+ {
+ }
+ }
+
TopicPrx topic;
try
{
@@ -135,6 +150,22 @@ run(int, char* argv[], const CommunicatorPtr& communicator)
}
//
+ // Test subscriber identity that is too long
+ //
+ if(string(argv[1]) != "transient")
+ {
+ try
+ {
+ Ice::ObjectPrx object = communicator->stringToProxy(string(512, 'A') + ":default -p 10000");
+ topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
+ test(false);
+ }
+ catch(const Ice::UnknownException&)
+ {
+ }
+ }
+
+ //
// Create subscribers with different QoS.
//
vector<SingleIPtr> subscribers;
@@ -176,23 +207,25 @@ run(int, char* argv[], const CommunicatorPtr& communicator)
// Use a separate adapter to ensure a separate connection is used for the subscriber
// (otherwise, if multiple UDP subscribers use the same connection we might get high
// packet loss, see bug 1784).
+ communicator->getProperties()->setProperty("UdpAdapter3.ThreadPool.Size", "1");
ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("UdpAdapter3", "udp");
subscribers.push_back(new SingleI(communicator, "datagram"));
Ice::ObjectPrx object = adpt->addWithUUID(subscribers.back())->ice_datagram();
subscriberIdentities.push_back(object->ice_getIdentity());
- topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
adpt->activate();
+ topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
}
{
// Use a separate adapter to ensure a separate connection is used for the subscriber
// (otherwise, if multiple UDP subscribers use the same connection we might get high
// packet loss, see bug 1784).
+ communicator->getProperties()->setProperty("UdpAdapter4.ThreadPool.Size", "1");
ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("UdpAdapter4", "udp");
subscribers.push_back(new SingleI(communicator, "batch datagram"));
Ice::ObjectPrx object = adpt->addWithUUID(subscribers.back())->ice_batchDatagram();
subscriberIdentities.push_back(object->ice_getIdentity());
- topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
adpt->activate();
+ topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
}
adapter->activate();
@@ -220,7 +253,8 @@ main(int argc, char* argv[])
try
{
- communicator = initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Exception& ex)
@@ -231,15 +265,7 @@ main(int argc, char* argv[])
if(communicator)
{
- try
- {
- communicator->destroy();
- }
- catch(const Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
+ communicator->destroy();
}
return status;