diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-01-26 10:49:43 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-01-26 10:49:43 +0000 |
commit | fbe5156ee075662335b42efbdbb14b16ebfaf576 (patch) | |
tree | 4c473db7032d42bcd37e1ea8d24e6ddcce281aeb /cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=529 (diff) | |
download | ice-fbe5156ee075662335b42efbdbb14b16ebfaf576.tar.bz2 ice-fbe5156ee075662335b42efbdbb14b16ebfaf576.tar.xz ice-fbe5156ee075662335b42efbdbb14b16ebfaf576.zip |
Fixed a bug which would prevent to define object identity with a category
using variables.
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/CHANGES | 6 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorHelper.cpp | 14 | ||||
-rw-r--r-- | cpp/test/IceGrid/deployer/AllTests.cpp | 8 | ||||
-rw-r--r-- | cpp/test/IceGrid/deployer/application.xml | 14 |
4 files changed, 38 insertions, 4 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES index 32986828694..6781265a1d8 100644 --- a/cpp/CHANGES +++ b/cpp/CHANGES @@ -1,6 +1,9 @@ Changes since version 3.0.1 --------------------------- +- Fixed a bug in IceGrid deployment mechanism which would prevent + defining with a variable object identities with a category. + - Added Glacier2::Router::getCategoryForClient that should be used to get the category for use in Glacier2 client callback objects. This should be used instead of getServerProxy()->ice_getIdentity().category. @@ -8,6 +11,9 @@ Changes since version 3.0.1 - The Glacier2 router now forwards the context set by the client when calling PermissionsVerifier::checkPermissions and SessionManager::create. +- Fixed a bug in IceBox and IceGrid which would prevent running IceBox + servers from a directory containing white spaces. + - Fixed a bug in the class garbage collector that could result in double deallocation of class instances. diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp index f4c6393c583..d7fda548301 100644 --- a/cpp/src/IceGrid/DescriptorHelper.cpp +++ b/cpp/src/IceGrid/DescriptorHelper.cpp @@ -647,8 +647,11 @@ CommunicatorHelper::instantiateImpl(const CommunicatorDescriptorPtr& instance, c { ObjectDescriptor obj; obj.type = resolve(q->type, "object type"); - obj.id.name = resolve(q->id.name, "object identity name", false); - obj.id.category = resolve(q->id.category, "object identity category"); + obj.id = Ice::stringToIdentity(resolve(Ice::identityToString(q->id), "object identity", false)); + if(obj.id.name.empty()) + { + resolve.exception("invalid object identity `" + Ice::identityToString(q->id) + "': name empty"); + } adapter.objects.push_back(obj); } instance->adapters.push_back(adapter); @@ -1989,8 +1992,11 @@ ApplicationHelper::instantiate(const Resolver& resolve) const for(ObjectDescriptorSeq::iterator q = r->objects.begin(); q != r->objects.end(); ++q) { q->type = resolve(q->type, "object type"); - q->id.name = resolve(q->id.name, "object identity name", false); - q->id.category = resolve(q->id.category, "object identity category"); + q->id = Ice::stringToIdentity(resolve(Ice::identityToString(q->id), "object identity", false)); + if(q->id.name.empty()) + { + resolve.exception("invalid object identity `" + Ice::identityToString(q->id) + "': name empty"); + } } } diff --git a/cpp/test/IceGrid/deployer/AllTests.cpp b/cpp/test/IceGrid/deployer/AllTests.cpp index 65b085c7d53..98dbf4464ce 100644 --- a/cpp/test/IceGrid/deployer/AllTests.cpp +++ b/cpp/test/IceGrid/deployer/AllTests.cpp @@ -76,6 +76,14 @@ allTests(const Ice::CommunicatorPtr& comm) test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(),"ReplicatedObject")) != objs.end()); { + test(Ice::identityToString(query->findObjectByType("::TestId1")->ice_getIdentity()) == "cat/name1"); + test(Ice::identityToString(query->findObjectByType("::TestId2")->ice_getIdentity()) == "cat1/name1"); + test(Ice::identityToString(query->findObjectByType("::TestId3")->ice_getIdentity()) == "cat1/name1-bis"); + test(Ice::identityToString(query->findObjectByType("::TestId4")->ice_getIdentity()) == "c2\\/c2/n2\\/n2"); + test(Ice::identityToString(query->findObjectByType("::TestId5")->ice_getIdentity()) == "n2\\/n2"); + } + + { Ice::ObjectPrx obj = query->findObjectByType("::Test"); string id = Ice::identityToString(obj->ice_getIdentity()); test(id == "Server1" || id == "Server2" || id == "SimpleServer" || diff --git a/cpp/test/IceGrid/deployer/application.xml b/cpp/test/IceGrid/deployer/application.xml index 3babe924415..cdaa2fc3f9a 100644 --- a/cpp/test/IceGrid/deployer/application.xml +++ b/cpp/test/IceGrid/deployer/application.xml @@ -27,6 +27,14 @@ <!-- Variables for parameter test --> <variable name="AppVarOverridedByParam" value="Test"/> + <!-- Variables for object identity test --> + <variable name="ObjectId" value="cat/name1"/> + <variable name="ObjectName1" value="name1"/> + <variable name="ObjectCategory1" value="cat1"/> + <variable name="ObjectIdSlash" value="/"/> + <variable name="ObjectName2" value="n2\/n2"/> + <variable name="ObjectCategory2" value="c2\/c2"/> + <node name="localnode"> <description>NODE ${NodeVar}</description> @@ -57,6 +65,12 @@ <adapter name="Server" endpoints="default"> <description>ADAPTER ${NodeVar}</description> <object identity="${server}" type="::Test"/> + <object identity="cat\/cat/name\/name" type="::Test"/> + <object identity="${ObjectId}" type="::TestId1"/> + <object identity="${ObjectCategory1}/${ObjectName1}" type="::TestId2"/> + <object identity="${ObjectCategory1}${ObjectIdSlash}${ObjectName1}-bis" type="::TestId3"/> + <object identity="${ObjectCategory2}/${ObjectName2}" type="::TestId4"/> + <object identity="${ObjectIdSlash}${ObjectName2}" type="::TestId5"/> </adapter> <dbenv name="DbEnv"> <description>DBENV ${NodeVar}</description> |