Update cluster to support propertiesFile, etc.
diff --git a/cppcache/integration/framework/Cluster.cpp b/cppcache/integration/framework/Cluster.cpp
index 78c621f..91ff454 100644
--- a/cppcache/integration/framework/Cluster.cpp
+++ b/cppcache/integration/framework/Cluster.cpp
@@ -89,7 +89,7 @@
if (cluster_.useSsl()) {
locator.withConnect(false)
.withSslEnabledComponents("all")
- .withSslRquireAuthentication(cluster_.requireSslAuthentication())
+ .withSslRequireAuthentication(cluster_.requireSslAuthentication())
.withSslKeystore(cluster_.keystore())
.withSslTruststore(cluster_.truststore())
.withSslKeystorePassword(cluster_.keystorePassword())
@@ -455,6 +455,26 @@
bool Cluster::useSsl() { return useSsl_; }
+void Cluster::usePropertiesFile(const std::string propertiesFile) {
+ usePropertiesFile_ = true;
+ propertiesFile_ = propertiesFile;
+}
+
+void Cluster::useSecurityPropertiesFile(const std::string securityPropertiesFile) {
+ useSecurityPropertiesFile_ = true;
+ securityPropertiesFile_ = securityPropertiesFile;
+}
+
+void Cluster::useHostNameForClients(
+ const std::string hostName) {
+ usePropertiesFile_ = true;
+ hostName_ = hostName;
+}
+
+bool Cluster::usePropertiesFile() { return usePropertiesFile_; }
+bool Cluster::useSecurityPropertiesFile() { return useSecurityPropertiesFile_; }
+bool Cluster::useHostNameForClients() { return useHostNameForClients_; }
+
bool Cluster::requireSslAuthentication() { return requireSslAuthentication_; }
std::string Cluster::keystore() { return keystore_; }
diff --git a/cppcache/integration/framework/Cluster.h b/cppcache/integration/framework/Cluster.h
index ee5ca70..52c0233 100644
--- a/cppcache/integration/framework/Cluster.h
+++ b/cppcache/integration/framework/Cluster.h
@@ -171,60 +171,77 @@
const std::string truststorePassword);
bool useSsl();
- bool requireSslAuthentication();
- std::string keystore();
- std::string truststore();
- std::string keystorePassword();
- std::string truststorePassword();
- Gfsh &getGfsh();
+ void usePropertiesFile(const std::string propertiesFile);
+ void useSecurityPropertiesFile(const std::string securityPropertiesFile);
+ void useHostNameForClients(const std::string hostNameForClients);
+ bool usePropertiesFile();
+ bool useSecurityPropertiesFile();
+ bool useHostNameForClients();
+bool requireSslAuthentication();
- std::vector<Server> &getServers();
+std::string keystore();
+std::string truststore();
+std::string keystorePassword();
+std::string truststorePassword();
- std::vector<Locator> &getLocators();
+Gfsh &getGfsh();
- std::string &getClasspath();
+std::vector<Server> &getServers();
- std::string &getSecurityManager();
+std::vector<Locator> &getLocators();
- std::string &getUser();
+std::string &getClasspath();
- std::string &getPassword();
+std::string &getSecurityManager();
- std::vector<std::string> &getCacheXMLFiles();
+std::string &getUser();
- bool getUseIPv6();
+std::string &getPassword();
- private:
- std::string name_;
- std::string classpath_;
- std::string securityManager_;
- std::string user_;
- std::string password_;
- std::vector<std::string> cacheXMLFiles_;
+std::vector<std::string> &getCacheXMLFiles();
- size_t initialLocators_;
- std::vector<Locator> locators_;
+bool getUseIPv6();
- size_t initialServers_;
- std::vector<Server> servers_;
+private:
+std::string name_;
+std::string classpath_;
+std::string securityManager_;
+std::string user_;
+std::string password_;
+std::vector<std::string> cacheXMLFiles_;
- bool started_ = false;
- uint16_t jmxManagerPort_;
+size_t initialLocators_;
+std::vector<Locator> locators_;
- bool useSsl_ = false;
- bool requireSslAuthentication_ = false;
- std::string keystore_;
- std::string keystorePassword_;
- std::string truststore_;
- std::string truststorePassword_;
+size_t initialServers_;
+std::vector<Server> servers_;
- bool useIPv6_ = false;
+bool started_ = false;
+uint16_t jmxManagerPort_;
- GfshExecute gfsh_;
+bool useSsl_ = false;
+bool requireSslAuthentication_ = false;
+bool usePropertiesFile_ = false;
+bool useSecurityPropertiesFile_ = false;
+bool useHostNameForClients_ = false;
- void startLocators();
- void startServers();
-};
+std::string keystore_;
+std::string keystorePassword_;
+std::string truststore_;
+std::string truststorePassword_;
+
+std::string propertiesFile_;
+std::string securityPropertiesFile_;
+std::string hostName_;
+
+bool useIPv6_ = false;
+
+GfshExecute gfsh_;
+
+void startLocators();
+void startServers();
+}
+;
#endif // INTEGRATION_TEST_FRAMEWORK_CLUSTER_H
diff --git a/cppcache/integration/framework/Gfsh.cpp b/cppcache/integration/framework/Gfsh.cpp
index a29e616..0373dce 100644
--- a/cppcache/integration/framework/Gfsh.cpp
+++ b/cppcache/integration/framework/Gfsh.cpp
@@ -156,13 +156,31 @@
return *this;
}
-Gfsh::Start::Locator &Gfsh::Start::Locator::withSslRquireAuthentication(
+Gfsh::Start::Locator &Gfsh::Start::Locator::withSslRequireAuthentication(
const bool require) {
command_ += " --J=-Dgemfire.ssl-require-authentication=" +
std::string(require ? "true" : "false");
return *this;
}
+Gfsh::Start::Locator &Gfsh::Start::Locator::withPropertiesFile(
+ const std::string file) {
+ command_ += " --properties-file=" + file;
+ return *this;
+}
+
+Gfsh::Start::Locator &Gfsh::Start::Locator::withSecurityPropertiesFile(
+ const std::string file) {
+ command_ += " --security-properties-file=" + file;
+ return *this;
+}
+
+Gfsh::Start::Locator &Gfsh::Start::Locator::withHostNameForClients(
+ const std::string hostName) {
+ command_ += " --hostname-for-clients=" + hostName;
+ return *this;
+}
+
Gfsh::Start::Server::Server(Gfsh &gfsh) : Command(gfsh, "start server") {}
Gfsh::Start::Server &Gfsh::Start::Server::withName(const std::string &name) {
@@ -288,6 +306,24 @@
return *this;
}
+Gfsh::Start::Server &Gfsh::Start::Server::withPropertiesFile(
+ const std::string file) {
+ command_ += " --properties-file=" + file;
+ return *this;
+}
+
+Gfsh::Start::Server &Gfsh::Start::Server::withSecurityPropertiesFile(
+ const std::string file) {
+ command_ += " --security-properties-file=" + file;
+ return *this;
+}
+
+Gfsh::Start::Server &Gfsh::Start::Server::withHostNameForClients(
+ const std::string hostName) {
+ command_ += " --hostname-for-clients=" + hostName;
+ return *this;
+}
+
Gfsh::Stop::Stop(Gfsh &gfsh) : gfsh_(gfsh) {}
Gfsh::Stop::Server Gfsh::Stop::server() { return Server{gfsh_}; }
diff --git a/cppcache/integration/framework/Gfsh.h b/cppcache/integration/framework/Gfsh.h
index b775493..4907137 100644
--- a/cppcache/integration/framework/Gfsh.h
+++ b/cppcache/integration/framework/Gfsh.h
@@ -125,7 +125,13 @@
Locator &withJmxManagerStart(const bool startJmxManager);
- Locator &withSslRquireAuthentication(const bool require);
+ Locator &withSslRequireAuthentication(const bool require);
+
+ Locator &withPropertiesFile(const std::string file);
+
+ Locator &withSecurityPropertiesFile(const std::string file);
+
+ Locator &withHostNameForClients(const std::string hostName);
};
class Server : public Command<void> {
@@ -169,6 +175,12 @@
Server &withSslTruststorePassword(const std::string &truststorePassword);
Server &withSslRquireAuthentication(const bool require);
+
+ Server &withPropertiesFile(const std::string file);
+
+ Server &withSecurityPropertiesFile(const std::string file);
+
+ Server &withHostNameForClients(const std::string hostName);
};
private: