summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2016-09-23 11:28:10 +0200
committerBenoit Foucher <benoit@zeroc.com>2016-09-23 11:28:10 +0200
commit93144c8b87e620892fd6f5c0edeb0f3bb819f788 (patch)
tree3ec787c05f9c790d8b485aec7cdd8a0b80c2bebd /cpp
parentFixed potential IceStorm/stress test failures (diff)
downloadice-93144c8b87e620892fd6f5c0edeb0f3bb819f788.tar.bz2
ice-93144c8b87e620892fd6f5c0edeb0f3bb819f788.tar.xz
ice-93144c8b87e620892fd6f5c0edeb0f3bb819f788.zip
Fixed ICE-7230 - Issue with adpater IDs with spaces
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/IceGrid/Util.cpp22
-rw-r--r--cpp/test/IceGrid/deployer/AllTests.cpp31
-rw-r--r--cpp/test/IceGrid/deployer/application.xml10
3 files changed, 32 insertions, 31 deletions
diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp
index 1553c8be228..c56e30717c0 100644
--- a/cpp/src/IceGrid/Util.cpp
+++ b/cpp/src/IceGrid/Util.cpp
@@ -16,7 +16,7 @@ using namespace std;
using namespace Ice;
using namespace IceGrid;
-string
+string
IceGrid::toString(const vector<string>& v, const string& sep)
{
ostringstream os;
@@ -61,7 +61,7 @@ IceGrid::toString(const Ice::Exception& exception)
string
IceGrid::getProperty(const PropertyDescriptorSeq& properties, const string& name, const string& def)
-{
+{
string result;
for(PropertyDescriptorSeq::const_iterator q = properties.begin(); q != properties.end(); ++q)
{
@@ -79,7 +79,7 @@ IceGrid::getProperty(const PropertyDescriptorSeq& properties, const string& name
int
IceGrid::getPropertyAsInt(const PropertyDescriptorSeq& properties, const string& name, int def)
-{
+{
string strVal;
for(PropertyDescriptorSeq::const_iterator q = properties.begin(); q != properties.end(); ++q)
{
@@ -88,7 +88,7 @@ IceGrid::getPropertyAsInt(const PropertyDescriptorSeq& properties, const string&
strVal = q->value;
}
}
-
+
int result = def;
if(!strVal.empty())
@@ -104,7 +104,7 @@ IceGrid::getPropertyAsInt(const PropertyDescriptorSeq& properties, const string&
bool
IceGrid::hasProperty(const PropertyDescriptorSeq& properties, const string& name)
-{
+{
for(PropertyDescriptorSeq::const_iterator q = properties.begin(); q != properties.end(); ++q)
{
if(q->name == name)
@@ -156,7 +156,7 @@ IceGrid::escapeProperty(const string& s, bool escapeEqual)
previousCharIsEscape = false;
break;
}
-
+
case '\\':
case '#':
case '=':
@@ -212,7 +212,7 @@ IceGrid::toObjectInfo(const Ice::CommunicatorPtr& communicator, const ObjectDesc
{
proxyStr << ' ' << obj.proxyOptions;
}
- proxyStr << " @ " << adapterId;
+ proxyStr << " @ \"" << adapterId << "\"";
try
{
info.proxy = communicator->stringToProxy(proxyStr.str());
@@ -220,7 +220,7 @@ IceGrid::toObjectInfo(const Ice::CommunicatorPtr& communicator, const ObjectDesc
catch(const Ice::ProxyParseException&)
{
ostringstream fallbackProxyStr;
- fallbackProxyStr << "\"" << communicator->identityToString(obj.id) << "\"" << " @ " << adapterId;
+ fallbackProxyStr << "\"" << communicator->identityToString(obj.id) << "\"" << " @ \"" << adapterId << "\"";
info.proxy = communicator->stringToProxy(fallbackProxyStr.str());
}
return info;
@@ -246,7 +246,7 @@ IceGrid::setupThreadPool(const PropertiesPtr& properties, const string& name, in
{
sizeMax = size * 10;
}
-
+
ostringstream os;
os << sizeMax;
properties->setProperty(name + ".SizeMax", os.str());
@@ -277,7 +277,7 @@ IceGrid::getMMVersion(const string& o)
}
if(patchPos != string::npos)
- {
+ {
if((minorPos == 1 && patchPos != 3 && patchPos != 4) || (minorPos == 2 && patchPos != 4 && patchPos != 5))
{
return -1;
@@ -326,6 +326,6 @@ IceGrid::getMMVersion(const string& o)
// }
// ver += v;
// }
-
+
return ver;
}
diff --git a/cpp/test/IceGrid/deployer/AllTests.cpp b/cpp/test/IceGrid/deployer/AllTests.cpp
index 8c10a87d5df..e4dda4f4f8a 100644
--- a/cpp/test/IceGrid/deployer/AllTests.cpp
+++ b/cpp/test/IceGrid/deployer/AllTests.cpp
@@ -19,7 +19,7 @@ using namespace std;
using namespace Test;
using namespace IceGrid;
-namespace
+namespace
{
void
@@ -65,7 +65,7 @@ public:
{
}
- bool
+ bool
operator()(const Ice::ObjectPrx& p1, const string& id) const
{
return p1->ice_getIdentity() == _communicator->stringToIdentity(id);
@@ -171,7 +171,7 @@ logTests(const Ice::CommunicatorPtr& comm, const AdminSessionPrx& session)
test(it->read(1024, lines) && lines.empty());
test(it->read(1024, lines) && lines.empty());
it->destroy();
-
+
it = session->openServerLog("LogServer", testDir + "/log2.txt", 1);
test(it->read(1024, lines) && lines.size() == 1);
test(lines[0] == "one line file with no EOL on last line");
@@ -194,7 +194,7 @@ logTests(const Ice::CommunicatorPtr& comm, const AdminSessionPrx& session)
{
//
// Test with log file with one line with EOL on last line.
- //
+ //
string path = testDir + "/log3.txt";
ofstream os(path.c_str());
os << "one line file with EOL on last line" << endl;
@@ -211,7 +211,7 @@ logTests(const Ice::CommunicatorPtr& comm, const AdminSessionPrx& session)
test(it->read(1024, lines) && lines.empty());
test(it->read(1024, lines) && lines.empty());
it->destroy();
-
+
it = session->openServerLog("LogServer", testDir + "/log3.txt", 1);
test(it->read(1024, lines) && lines.size() == 2);
test(lines[0] == "one line file with EOL on last line");
@@ -262,7 +262,7 @@ logTests(const Ice::CommunicatorPtr& comm, const AdminSessionPrx& session)
test(it->read(1024, lines) && lines.empty());
test(it->read(1024, lines) && lines.empty());
it->destroy();
-
+
it = session->openServerLog("LogServer", testDir + "/log4.txt", 1);
test(it->read(1024, lines) && lines.size() == 2);
test(lines[0] == "line 3");
@@ -325,7 +325,7 @@ logTests(const Ice::CommunicatorPtr& comm, const AdminSessionPrx& session)
test(it->read(1024, lines) && lines.empty());
os << endl;
test(it->read(1024, lines) && lines.size() == 2 && lines[0].empty() && lines[1].empty());
-
+
os << "starting multiple long line now, " << flush;
test(it->read(1024, lines) && lines.size() == 1 && lines[0] == "starting multiple long line now, ");
writeLongLine(os);
@@ -357,7 +357,7 @@ logTests(const Ice::CommunicatorPtr& comm, const AdminSessionPrx& session)
test(it->read(1024, lines) && lines.size() == 2 && isLongLineEnd(lines[0]) && lines[1].empty());
test(it->read(1024, lines) && lines.empty());
it->destroy();
-
+
it = session->openServerLog("LogServer", testDir + "/log1.txt", 2);
test(!it->read(1024, lines) && lines.size() == 1 && isLongLineStart(lines[0]));
test(!it->read(1024, lines) && lines.size() == 1 && isLongLineContent(lines[0]));
@@ -414,6 +414,7 @@ allTests(const Ice::CommunicatorPtr& comm)
test(find(adapterIds.begin(), adapterIds.end(), "IceBox2Service2Adapter") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "SimpleIceBox.SimpleService.SimpleService") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "ReplicatedAdapter") != adapterIds.end());
+ test(find(adapterIds.begin(), adapterIds.end(), "ReplicatedAdapter 2") != adapterIds.end());
cout << "ok" << endl;
cout << "testing object registration... " << flush;
@@ -532,7 +533,7 @@ allTests(const Ice::CommunicatorPtr& comm)
test(obj->getProperty("NameEscaped") == "${name}");
test(obj->getProperty("NameEscapeEscaped") == "$Server1");
test(obj->getProperty("NameEscapedEscapeEscaped") == "$${name}");
- test(obj->getProperty("ManyEscape") == "$$$${name}");
+ test(obj->getProperty("ManyEscape") == "$$$${name}");
test(obj->getProperty("TestServer1Identity") == "Server1");
test(obj->getProperty("LogFilePath") == "test-Server1.log");
test(obj->getProperty("LogFilePath-Server1") == "test.log");
@@ -588,7 +589,7 @@ allTests(const Ice::CommunicatorPtr& comm)
obj = TestIntfPrx::checkedCast(
comm->stringToProxy("SimpleIceBox-SimpleService@SimpleIceBox.SimpleService.SimpleService"));
proxies.push_back(obj);
-
+
for(vector<TestIntfPrx>::const_iterator p = proxies.begin(); p != proxies.end(); ++p)
{
test((*p)->getProperty("AppVarProp") == "AppVar");
@@ -635,7 +636,7 @@ allTests(const Ice::CommunicatorPtr& comm)
obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox2-Service2@IceBox2Service2Adapter"));
test(obj->getProperty("AppVarOverridedByParamProp") == "Test");
test(obj->getProperty("NodeVarOverridedByParamProp") == "Test");
-
+
cout << "ok" << endl;
cout << "testing descriptions... " << flush;
@@ -656,7 +657,7 @@ allTests(const Ice::CommunicatorPtr& comm)
test(info.descriptor->adapters[0].description == "ADAPTER NodeVar");
test(info.descriptor->dbEnvs[0].description == "DBENV NodeVar");
cout << "ok" << endl;
-
+
cout << "testing property sets..." << flush;
obj = TestIntfPrx::checkedCast(comm->stringToProxy("Server1@Server1.Server"));
test(obj->getProperty("AppProperty") == "AppVar");
@@ -684,7 +685,7 @@ allTests(const Ice::CommunicatorPtr& comm)
test(obj->getProperty("NodeProperty") == "NodeVar");
test(obj->getProperty("IceBoxInstanceProperty") == "IceBox2");
- obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox2-Service2@IceBox2Service2Adapter"));
+ obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox2-Service2@IceBox2Service2Adapter"));
test(obj->getProperty("AppProperty") == "AppVar");
test(obj->getProperty("AppProperty2") == "OverrideMe");
test(obj->getProperty("AppProperty21") == "Override");
@@ -697,7 +698,7 @@ allTests(const Ice::CommunicatorPtr& comm)
test(obj->getProperty("AppProperty2") == "OverrideMe");
test(obj->getProperty("AppProperty21") == "Override");
test(obj->getProperty("NodeProperty") == "NodeVar");
-
+
obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox1-Service1@IceBox1.Service1.Service1"));
test(obj->getProperty("ServerInstanceServiceProperty") == "service1");
obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox1-Service4@IceBox1.Service4.Service4"));
@@ -757,7 +758,7 @@ allTestsWithTarget(const Ice::CommunicatorPtr& comm)
test(admin);
cout << "testing targets... " << flush;
-
+
TestIntfPrx obj = TestIntfPrx::checkedCast(comm->stringToProxy("Server3@Server3.Server"));
obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox3-Service1@IceBox3.Service1.Service1"));
obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox3-Service3@IceBox3.Service3.Service3"));
diff --git a/cpp/test/IceGrid/deployer/application.xml b/cpp/test/IceGrid/deployer/application.xml
index 56c47a90a24..27a5a44b201 100644
--- a/cpp/test/IceGrid/deployer/application.xml
+++ b/cpp/test/IceGrid/deployer/application.xml
@@ -16,14 +16,14 @@
<!-- Include server templates -->
<include file="icebox.xml"/>
- <include file="server.xml"/>
+ <include file="server.xml"/>
<replica-group id="ReplicatedAdapter">
<description>REPLICA GROUP ${AppVar}</description>
<object identity="ReplicatedObject" type="::Test"/>
</replica-group>
- <replica-group id="ReplicatedAdapter2" proxy-options="-e 1.4">
+ <replica-group id="ReplicatedAdapter 2" proxy-options="-e 1.4">
<description>REPLICA GROUP ${AppVar}</description>
<object identity="ReplicatedObject15" type="::Test" proxy-options="-e 1.5"/>
<object identity="ReplicatedObject14" type="::Test"/>
@@ -38,7 +38,7 @@
<variable name="EscapedAppVar" value="$${escaped}"/>
<variable name="RecursiveEscapedAppVar" value="${EscapedAppVar}"/>
<variable name="Recursive2EscapedAppVar" value="${RecursiveEscapedAppVar}"/>
- <variable name="test.dir" value="NotThisValue"/>
+ <variable name="test.dir" value="NotThisValue"/>
<variable name="encoding10" value="1.0"/>
<variable name="encoding12" value="1.2"/>
@@ -63,7 +63,7 @@
<property name="NodeProperty" value="${NodeVar}"/>
<property name="AppProperty21" value="Override"/>
</properties>
-
+
<!-- Variables for variable test -->
<variable name="NodeVar" value="NodeVar"/>
<variable name="AppVarOverrided" value="OverridedInNode"/>
@@ -77,7 +77,7 @@
<server-instance template="IceBoxTemplate" name="IceBox1" AppVarOverridedByParam="Overrided">
<properties service="Service1">
- <property name="ServerInstanceServiceProperty" value="service1"/>
+ <property name="ServerInstanceServiceProperty" value="service1"/>
</properties>
<properties service="Service4">
<property name="ServerInstanceServiceProperty" value="service4"/>