diff --git a/clicache/integration-test2/Cluster.cs b/clicache/integration-test2/Cluster.cs index f4deaa2470..6eb6bca9a9 100644 --- a/clicache/integration-test2/Cluster.cs +++ b/clicache/integration-test2/Cluster.cs @@ -33,6 +33,7 @@ public class Cluster : IDisposable private bool started_; private List locators_; private string name_; + private string groups_; internal int jmxManagerPort = Framework.FreeTcpPort(); internal string keyStore_ = Config.SslServerKeyPath + "/server_keystore_chained.jks"; internal string keyStorePassword_ = "apachegeode"; @@ -53,12 +54,13 @@ internal PoolFactory ApplyLocators(PoolFactory poolFactory) return poolFactory; } - public Cluster(ITestOutputHelper output, string name, int locatorCount, int serverCount) + public Cluster(ITestOutputHelper output, string name, int locatorCount, int serverCount, string groups = "") { started_ = false; Gfsh = new GfshExecute(output); UseSSL = false; name_ = name; + groups_ = groups; locatorCount_ = locatorCount; serverCount_ = serverCount; locators_ = new List(); @@ -85,7 +87,7 @@ private bool StartServers() for (var i = 0; i < serverCount_; i++) { var server = new Server(this, locators_, - name_ + "/server/" + i.ToString()); + name_ + "/server/" + i.ToString(), groups_); var localResult = server.Start(); if (localResult != 0) { @@ -126,7 +128,7 @@ public void Dispose() } } - public Cache CreateCache(IDictionary properties) + public Cache CreateCache(IDictionary properties, string serverGroup = "") { var cacheFactory = new CacheFactory(); @@ -141,7 +143,9 @@ public Cache CreateCache(IDictionary properties) var cache = cacheFactory.Create(); - ApplyLocators(cache.GetPoolFactory()).Create("default"); + ApplyLocators(cache.GetPoolFactory()) + .SetServerGroup(serverGroup) + .Create("default"); return cache; } @@ -243,12 +247,14 @@ public class Server private string name_; private List locators_; private bool started_; + private string groups_; - public Server(Cluster cluster, List locators, string name) + public Server(Cluster cluster, List locators, string name, string groups) { cluster_ = cluster; locators_ = locators; name_ = name; + groups_ = groups; var address = new Address(); address.address = "localhost"; address.port = 0; @@ -269,6 +275,7 @@ public int Start() .withName(name_.Replace('/', '_')) .withBindAddress(Address.address) .withPort(Address.port) + .withGroups(groups_) .withMaxHeap("1g"); if (cluster_.UseSSL) { diff --git a/clicache/integration-test2/Gfsh.cs b/clicache/integration-test2/Gfsh.cs index 826c1fda3e..8f993ebaa8 100644 --- a/clicache/integration-test2/Gfsh.cs +++ b/clicache/integration-test2/Gfsh.cs @@ -80,7 +80,13 @@ public Server withDir(string dir) return this; } - public Server withBindAddress(string bindAddress) + public Server withGroups(string groups) + { + command_ += " --group=" + groups; + return this; + } + + public Server withBindAddress(string bindAddress) { command_ += " --bind-address=" + bindAddress; return this; diff --git a/clicache/integration-test2/GfshTest.cs b/clicache/integration-test2/GfshTest.cs index 819bf081f6..53ffa0cf5c 100644 --- a/clicache/integration-test2/GfshTest.cs +++ b/clicache/integration-test2/GfshTest.cs @@ -113,13 +113,15 @@ public void StartServerStringsTest() .withSslKeyStore("some/path/keystore.jks") .withSslKeyStorePassword("password1") .withSslTrustStore("some/path/truststore.jks") - .withSslTrustStorePassword("password2"); + .withSslTrustStorePassword("password2") + .withGroups("GroupA,GroupB"); s = server.ToString(); Assert.Equal("start server --name=server " + "--dir=someDir --bind-address=someAddress --server-port=1234 --locators=someLocator --log-level=debug " + "--max-heap=1.21gigabytes --J=-Dgemfire.ssl-enabled-components=server,locator,jmx " + "--J=-Dgemfire.ssl-keystore=some/path/keystore.jks --J=-Dgemfire.ssl-keystore-password=password1 " + - "--J=-Dgemfire.ssl-truststore=some/path/truststore.jks --J=-Dgemfire.ssl-truststore-password=password2", s); + "--J=-Dgemfire.ssl-truststore=some/path/truststore.jks --J=-Dgemfire.ssl-truststore-password=password2 " + + "--groups=GroupA,GroupB", s); } [Fact]