geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ladyva...@apache.org
Subject [geode] branch develop updated: GEODE-3882: ClusterConfiguration to support GatewayReceiver hostnameForSenders
Date Fri, 20 Oct 2017 23:16:17 GMT
This is an automated email from the ASF dual-hosted git repository.

ladyvader pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new caf71d8  GEODE-3882: ClusterConfiguration to support GatewayReceiver hostnameForSenders
caf71d8 is described below

commit caf71d801074761ba7428d620e0d0cf6c63fff90
Author: Lynn Hughes-Godfrey <lhughesgodfrey@pivotal.io>
AuthorDate: Fri Oct 20 11:55:39 2017 -0700

    GEODE-3882: ClusterConfiguration to support GatewayReceiver hostnameForSenders
    
    - Add support for GatewayReceiver hostnameForSenders in CacheXmlGenerator (already there
in CacheXmlParser)
    - improve WANClusterConfigurationDUnitTest to verify specific GatewayReceiver attributes
---
 .../geode/internal/cache/xmlcache/CacheXmlGenerator.java       |  3 +++
 .../configuration/WANClusterConfigurationDUnitTest.java        | 10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java
index 98427ea..5de07ee 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java
@@ -1536,6 +1536,9 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader
{
     for (GatewayReceiver receiver : receiverList) {
       AttributesImpl atts = new AttributesImpl();
       try {
+        // hostnameForSenders
+        if (generateDefaults() || receiver.getHostnameForSenders() != null)
+          atts.addAttribute("", "", HOSTNAME_FOR_SENDERS, "", receiver.getHostnameForSenders());
         // start port
         if (generateDefaults() || receiver.getStartPort() != GatewayReceiver.DEFAULT_START_PORT)
           atts.addAttribute("", "", START_PORT, "", String.valueOf(receiver.getStartPort()));
diff --git a/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/WANClusterConfigurationDUnitTest.java
b/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/WANClusterConfigurationDUnitTest.java
index e3a62e0..ce6cd7e 100644
--- a/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/WANClusterConfigurationDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/WANClusterConfigurationDUnitTest.java
@@ -18,8 +18,8 @@ import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertNotNull;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
 import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
+import static org.assertj.core.api.Assertions.assertThat;
 
-import java.io.Serializable;
 import java.util.Set;
 
 import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
@@ -88,6 +88,7 @@ public class WANClusterConfigurationDUnitTest {
     csb.addOption(CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT, "10000");
     csb.addOption(CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT, "20000");
     csb.addOptionWithValueCheck(CliStrings.CREATE_GATEWAYRECEIVER__MAXTIMEBETWEENPINGS, "20");
+    csb.addOption(CliStrings.CREATE_GATEWAYRECEIVER__HOSTNAMEFORSENDERS, "myLocalHost");
     gfsh.executeAndVerifyCommand(csb.getCommandString());
 
     // create GatewaySender
@@ -125,6 +126,13 @@ public class WANClusterConfigurationDUnitTest {
       assertNotNull(gatewayReceivers);
       assertFalse(gatewayReceivers.isEmpty());
       assertTrue(gatewayReceivers.size() == 1);
+      for (GatewayReceiver gr : gatewayReceivers) {
+        assertThat(gr.isManualStart()).isTrue();
+        assertThat(gr.getStartPort()).isEqualTo(10000);
+        assertThat(gr.getEndPort()).isEqualTo(20000);
+        assertThat(gr.getMaximumTimeBetweenPings()).isEqualTo(20);
+        assertThat(gr.getHostnameForSenders()).isEqualTo("myLocalHost");
+      }
     });
 
     // verify GatewaySender attributes saved in cluster config

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message