summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-09-21 08:34:46 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-09-21 08:34:46 +0000
commit336fee8edb4f6ee0ff70e4110711ceef3ba9fa3d (patch)
treeabd982bbb7dbab99d78e8b37c6afbef73ec37ca6 /cpp
parentFixed bug when no load balancing was set, not all the endpoints were (diff)
downloadice-336fee8edb4f6ee0ff70e4110711ceef3ba9fa3d.tar.bz2
ice-336fee8edb4f6ee0ff70e4110711ceef3ba9fa3d.tar.xz
ice-336fee8edb4f6ee0ff70e4110711ceef3ba9fa3d.zip
Fix
Diffstat (limited to 'cpp')
-rw-r--r--cpp/CHANGES6
-rw-r--r--cpp/test/IceGrid/session/AllTests.cpp128
2 files changed, 60 insertions, 74 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index 36e20f4bf78..77b8546e248 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -195,6 +195,12 @@ Changes since version 3.1.1 (HEAD)
Changes since version 3.1.0
---------------------------
+- Fixed a bug where the number of endpoints returned for replica group
+ with no load balancing policy was random.
+
+- It's now possible to invoke on the IceGrid::Query object from an
+ IceGrid admin session created through Glacier2.
+
- Fixed a Glacier2 shutdown bug where active sessions would not be
destroyed properly.
diff --git a/cpp/test/IceGrid/session/AllTests.cpp b/cpp/test/IceGrid/session/AllTests.cpp
index 2722922c2eb..6e5d6c8c00a 100644
--- a/cpp/test/IceGrid/session/AllTests.cpp
+++ b/cpp/test/IceGrid/session/AllTests.cpp
@@ -635,6 +635,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
registry1->createSession("client3", "test1");
+ test(false);
}
catch(const IceGrid::PermissionDeniedException&)
{
@@ -646,6 +647,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session1->ice_connectionId("")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -653,6 +655,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session2->ice_connectionId("")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -661,6 +664,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session1->ice_connectionId("reg2")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -668,6 +672,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session2->ice_connectionId("reg1")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -686,6 +691,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
registry1->createAdminSession("admin3", "test1");
+ test(false);
}
catch(const IceGrid::PermissionDeniedException&)
{
@@ -697,6 +703,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
adminSession1->ice_connectionId("")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -704,6 +711,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
adminSession2->ice_connectionId("")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -715,6 +723,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
adminSession1->getAdmin()->ice_connectionId("reg2")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -722,6 +731,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
adminSession2->getAdmin()->ice_connectionId("reg1")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -748,6 +758,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session1->ice_connectionId("")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -755,6 +766,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session2->ice_connectionId("")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -776,6 +788,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
adminSession1->ice_connectionId("")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -783,6 +796,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
adminSession2->ice_connectionId("")->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -833,6 +847,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
router1->createSession("client3", "test1");
+ test(false);
}
catch(const Glacier2::CannotCreateSessionException&)
{
@@ -844,6 +859,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session1->ice_connectionId("router2")->ice_router(router2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -851,6 +867,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session2->ice_connectionId("router1")->ice_router(router1)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -864,6 +881,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
obj->ice_connectionId("router1")->ice_router(router1)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -871,6 +889,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
obj->ice_connectionId("router2")->ice_router(router2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -879,6 +898,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
router1->destroySession();
+ test(false);
}
catch(const Ice::ConnectionLostException&)
{
@@ -886,6 +906,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
router2->destroySession();
+ test(false);
}
catch(const Ice::ConnectionLostException&)
{
@@ -902,6 +923,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
adminRouter1->createSession("client3", "test1");
+ test(false);
}
catch(const Glacier2::CannotCreateSessionException&)
{
@@ -916,9 +938,14 @@ allTests(const Ice::CommunicatorPtr& communicator)
admin1->ice_ping();
admin2->ice_ping();
+ obj = communicator->stringToProxy("IceGrid/Query");
+ obj->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
+ obj->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
+
try
{
admSession1->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -926,6 +953,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
admSession2->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -934,6 +962,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
admin1->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -941,38 +970,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
admin2->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
-
- obj = communicator->stringToProxy("IceGrid/Query");
- try
- {
- obj->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
- try
- {
- obj->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
-
- obj = communicator->stringToProxy("IceGrid/Admin");
- try
- {
- obj->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
- try
- {
- obj->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -1022,6 +1020,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session1->ice_connectionId("router21")->ice_router(router2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -1029,6 +1028,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
session2->ice_connectionId("router11")->ice_router(router1)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -1042,6 +1042,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
obj->ice_connectionId("router11")->ice_router(router1)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -1049,6 +1050,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
try
{
obj->ice_connectionId("router21")->ice_router(router2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
@@ -1071,82 +1073,60 @@ allTests(const Ice::CommunicatorPtr& communicator)
AdminSessionPrx admSession1, admSession2;
+ //
+ // BUGFIX: We can't re-use the same router proxies because of bug 1034.
+ //
+ adminRouter1 = Glacier2::RouterPrx::uncheckedCast(adminRouter->ice_connectionId("admRouter11"));
+ adminRouter2 = Glacier2::RouterPrx::uncheckedCast(adminRouter->ice_connectionId("admRouter21"));
+
base = adminRouter1->createSessionFromSecureConnection();
- admSession1 = AdminSessionPrx::uncheckedCast(base->ice_connectionId("admRouter1")->ice_router(adminRouter1));
+ admSession1 = AdminSessionPrx::uncheckedCast(base->ice_connectionId("admRouter11")->ice_router(adminRouter1));
base = adminRouter2->createSessionFromSecureConnection();
- admSession2 = AdminSessionPrx::uncheckedCast(base->ice_connectionId("admRouter2")->ice_router(adminRouter2));
+ admSession2 = AdminSessionPrx::uncheckedCast(base->ice_connectionId("admRouter21")->ice_router(adminRouter2));
admSession1->ice_ping();
admSession2->ice_ping();
- Ice::ObjectPrx admin1 = admSession1->getAdmin()->ice_router(adminRouter1)->ice_connectionId("admRouter1");
- Ice::ObjectPrx admin2 = admSession2->getAdmin()->ice_router(adminRouter2)->ice_connectionId("admRouter2");
+ Ice::ObjectPrx admin1 = admSession1->getAdmin()->ice_router(adminRouter1)->ice_connectionId("admRouter11");
+ Ice::ObjectPrx admin2 = admSession2->getAdmin()->ice_router(adminRouter2)->ice_connectionId("admRouter21");
admin1->ice_ping();
admin2->ice_ping();
obj = communicator->stringToProxy("IceGrid/Query");
- obj->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
- obj->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
-
- try
- {
- admSession1->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
- try
- {
- admSession2->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
+ obj->ice_connectionId("admRouter11")->ice_router(adminRouter1)->ice_ping();
+ obj->ice_connectionId("admRouter21")->ice_router(adminRouter2)->ice_ping();
try
{
- admin1->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
+ admSession1->ice_connectionId("admRouter21")->ice_router(adminRouter2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
}
try
{
- admin2->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
+ admSession2->ice_connectionId("admRouter11")->ice_router(adminRouter1)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
}
- obj = communicator->stringToProxy("IceGrid/Query");
try
{
- obj->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
+ admin1->ice_connectionId("admRouter21")->ice_router(adminRouter2)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{
}
try
{
- obj->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
-
- obj = communicator->stringToProxy("IceGrid/Admin");
- try
- {
- obj->ice_connectionId("admRouter1")->ice_router(adminRouter1)->ice_ping();
- }
- catch(const Ice::ObjectNotExistException&)
- {
- }
- try
- {
- obj->ice_connectionId("admRouter2")->ice_router(adminRouter2)->ice_ping();
+ admin2->ice_connectionId("admRouter11")->ice_router(adminRouter1)->ice_ping();
+ test(false);
}
catch(const Ice::ObjectNotExistException&)
{