diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-02-12 13:16:05 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-02-12 13:16:19 +0100 |
commit | d31ac1757348fca291a1357421322f721eb72e8d (patch) | |
tree | 92f079716da9b13a5191af9d4a38b1f35d1cf6fc /cpp/test | |
parent | Fixed JS timeout test to prevent sporadic IE failures (diff) | |
download | ice-d31ac1757348fca291a1357421322f721eb72e8d.tar.bz2 ice-d31ac1757348fca291a1357421322f721eb72e8d.tar.xz ice-d31ac1757348fca291a1357421322f721eb72e8d.zip |
Ensure Ice::Connection::setAdapter fails if the adapter is deactivated (ICE-8659)
Diffstat (limited to 'cpp/test')
-rw-r--r-- | cpp/test/Ice/adapterDeactivation/AllTests.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cpp/test/Ice/adapterDeactivation/AllTests.cpp b/cpp/test/Ice/adapterDeactivation/AllTests.cpp index 02729e1ebe7..6ada7a797f1 100644 --- a/cpp/test/Ice/adapterDeactivation/AllTests.cpp +++ b/cpp/test/Ice/adapterDeactivation/AllTests.cpp @@ -85,6 +85,24 @@ allTests(const CommunicatorPtr& communicator) cout << "ok" << endl; } + if(obj->ice_getConnection()) + { + cout << "testing object adapter with bi-dir connection... " << flush; + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(""); + obj->ice_getConnection()->setAdapter(adapter); + obj->ice_getConnection()->setAdapter(ICE_NULLPTR); + adapter->deactivate(); + try + { + obj->ice_getConnection()->setAdapter(adapter); + test(false); + } + catch(const Ice::ObjectAdapterDeactivatedException&) + { + } + cout << "ok" << endl; + } + cout << "deactivating object adapter in the server... " << flush; obj->deactivate(); cout << "ok" << endl; |