summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/timeout/AllTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/timeout/AllTests.cpp')
-rw-r--r--cpp/test/Ice/timeout/AllTests.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/cpp/test/Ice/timeout/AllTests.cpp b/cpp/test/Ice/timeout/AllTests.cpp
index 2bc0146470b..b7fd8643344 100644
--- a/cpp/test/Ice/timeout/AllTests.cpp
+++ b/cpp/test/Ice/timeout/AllTests.cpp
@@ -106,20 +106,17 @@ connect(const Ice::ObjectPrxPtr& prx)
}
void
-allTests(Test::TestHelper* helper)
+allTestsWithController(Test::TestHelper* helper, const ControllerPrxPtr& controller)
{
Ice::CommunicatorPtr communicator = helper->communicator();
string sref = "timeout:" + helper->getTestEndpoint();
+
Ice::ObjectPrxPtr obj = communicator->stringToProxy(sref);
test(obj);
TimeoutPrxPtr timeout = ICE_CHECKED_CAST(TimeoutPrx, obj);
test(timeout);
- ControllerPrxPtr controller =
- ICE_CHECKED_CAST(ControllerPrx, communicator->stringToProxy("controller:" + helper->getTestEndpoint(1)));
- test(controller);
-
cout << "testing connect timeout... " << flush;
{
//
@@ -567,3 +564,24 @@ allTests(Test::TestHelper* helper)
controller->shutdown();
}
+
+void
+allTests(Test::TestHelper* helper)
+{
+ ControllerPrxPtr controller =
+ ICE_CHECKED_CAST(ControllerPrx,
+ helper->communicator()->stringToProxy("controller:" + helper->getTestEndpoint(1)));
+ test(controller);
+
+ try
+ {
+ allTestsWithController(helper, controller);
+ }
+ catch(const Ice::Exception&)
+ {
+ // Ensure the adapter is not in the holding state when an unexpected exception occurs to prevent the test
+ // from hanging on exit in case a connection which disables timeouts is still opened.
+ controller->resumeAdapter();
+ throw;
+ }
+}