diff options
author | Jose <jose@zeroc.com> | 2013-07-29 17:22:07 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2013-07-29 17:22:07 +0200 |
commit | 2f37792f3f90692b2aa5ec9cc3383c9e02f66c9c (patch) | |
tree | e2968ac4239e7e8182d4cc6fb2f458c95fbb384e /cpp/test/Ice/properties/Client.cpp | |
parent | removing INSTALL files (diff) | |
download | ice-2f37792f3f90692b2aa5ec9cc3383c9e02f66c9c.tar.bz2 ice-2f37792f3f90692b2aa5ec9cc3383c9e02f66c9c.tar.xz ice-2f37792f3f90692b2aa5ec9cc3383c9e02f66c9c.zip |
Fixed ICE-5393 - Java / C# load properties doesn't correctly parse Ice.Config with multiple files
Diffstat (limited to 'cpp/test/Ice/properties/Client.cpp')
-rw-r--r-- | cpp/test/Ice/properties/Client.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/cpp/test/Ice/properties/Client.cpp b/cpp/test/Ice/properties/Client.cpp index 198896e015e..b17403fe9be 100644 --- a/cpp/test/Ice/properties/Client.cpp +++ b/cpp/test/Ice/properties/Client.cpp @@ -10,6 +10,7 @@ #include <Ice/Ice.h> #include <TestCommon.h> #include <IceUtil/FileUtil.h> +#include <IceUtil/ArgVector.h> using namespace std; @@ -52,13 +53,12 @@ main(int argc, char* argv[]) try { cout << "testing load properties from UTF-8 path... " << flush; - Ice::InitializationData id; - id.properties = Ice::createProperties(); - id.properties->load(configPath); - test(id.properties->getProperty("Ice.Trace.Network") == "1"); - test(id.properties->getProperty("Ice.Trace.Protocol") == "1"); - test(id.properties->getProperty("Config.Path") == configPath); - test(id.properties->getProperty("Ice.ProgramName") == "PropertiesClient"); + Ice::PropertiesPtr properties = Ice::createProperties(); + properties->load(configPath); + test(properties->getProperty("Ice.Trace.Network") == "1"); + test(properties->getProperty("Ice.Trace.Protocol") == "1"); + test(properties->getProperty("Config.Path") == configPath); + test(properties->getProperty("Ice.ProgramName") == "PropertiesClient"); cout << "ok" << endl; } catch(const Ice::Exception& ex) @@ -66,9 +66,32 @@ main(int argc, char* argv[]) cerr << ex << endl; return EXIT_FAILURE; } + cout << "testing load properties from UTF-8 path using Ice::Application... " << flush; Client c; c.main(argc, argv, configPath.c_str()); cout << "ok" << endl; + + try + { + // + // Try to load multiple config files. + // + cout << "testing using Ice.Config with multiple config files... " << flush; + Ice::PropertiesPtr properties; + Ice::StringSeq args; + args.push_back("--Ice.Config=config/config.1, config/config.2, config/config.3"); + IceUtilInternal::ArgVector a(args); + properties = Ice::createProperties(a.argc, a.argv); + test(properties->getProperty("Config1") == "Config1"); + test(properties->getProperty("Config2") == "Config2"); + test(properties->getProperty("Config3") == "Config3"); + cout << "ok" << endl; + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + return EXIT_FAILURE; + } return EXIT_SUCCESS; -}
\ No newline at end of file +} |