aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-search
diff options
context:
space:
mode:
authorEric Hartmann <hartmann.eric@gmail.Com>2017-03-17 17:54:14 +0100
committerGitHub <noreply@github.com>2017-03-17 17:54:14 +0100
commitb35205ac59d363548b245b3ec8ed742a68fbf22a (patch)
tree9c2e878e37396071a0b7013e5c028c8ec1bd456b /server/sonar-search
parent8759b3933d8bc4a147b7242e1838a39b82bcc719 (diff)
downloadsonarqube-b35205ac59d363548b245b3ec8ed742a68fbf22a.tar.gz
sonarqube-b35205ac59d363548b245b3ec8ed742a68fbf22a.zip
SONAR-8938 Remove sonar.search.clusterName in favor of sonar.cluster.name (#1795)
Diffstat (limited to 'server/sonar-search')
-rw-r--r--server/sonar-search/src/main/java/org/sonar/search/EsSettings.java3
-rw-r--r--server/sonar-search/src/test/java/org/sonar/search/EsSettingsTest.java2
-rw-r--r--server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java4
3 files changed, 4 insertions, 5 deletions
diff --git a/server/sonar-search/src/main/java/org/sonar/search/EsSettings.java b/server/sonar-search/src/main/java/org/sonar/search/EsSettings.java
index 36369295ac7..9abb06eb258 100644
--- a/server/sonar-search/src/main/java/org/sonar/search/EsSettings.java
+++ b/server/sonar-search/src/main/java/org/sonar/search/EsSettings.java
@@ -49,9 +49,8 @@ public class EsSettings implements EsSettingsMBean {
EsSettings(Props props) {
this.props = props;
- // name of ES cluster must always be set, even if clustering of SQ is disabled
- this.clusterName = props.nonNullValue(ProcessProperties.SEARCH_CLUSTER_NAME);
+ this.clusterName = props.nonNullValue(ProcessProperties.CLUSTER_NAME);
this.clusterEnabled = props.valueAsBoolean(ProcessProperties.CLUSTER_ENABLED);
if (this.clusterEnabled) {
this.nodeName = props.value(CLUSTER_SEARCH_NODE_NAME, "sonarqube-" + UUID.randomUUID().toString());
diff --git a/server/sonar-search/src/test/java/org/sonar/search/EsSettingsTest.java b/server/sonar-search/src/test/java/org/sonar/search/EsSettingsTest.java
index e088c1190b1..595b2a670e7 100644
--- a/server/sonar-search/src/test/java/org/sonar/search/EsSettingsTest.java
+++ b/server/sonar-search/src/test/java/org/sonar/search/EsSettingsTest.java
@@ -43,7 +43,7 @@ public class EsSettingsTest {
props.set(ProcessProperties.SEARCH_PORT, "1234");
props.set(ProcessProperties.SEARCH_HOST, "127.0.0.1");
props.set(ProcessProperties.PATH_HOME, homeDir.getAbsolutePath());
- props.set(ProcessProperties.SEARCH_CLUSTER_NAME, "sonarqube");
+ props.set(ProcessProperties.CLUSTER_NAME, "sonarqube");
EsSettings esSettings = new EsSettings(props);
diff --git a/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java b/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java
index ddfcd68fbc5..00c3c0fd02a 100644
--- a/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java
+++ b/server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java
@@ -73,10 +73,10 @@ public class SearchServerTest {
public void start_stop_server() throws Exception {
Props props = new Props(new Properties());
// the following properties have always default values (see ProcessProperties)
- InetAddress host = InetAddress.getLocalHost();
+ InetAddress host = InetAddress.getLoopbackAddress();
props.set(ProcessProperties.SEARCH_HOST, host.getHostAddress());
props.set(ProcessProperties.SEARCH_PORT, String.valueOf(port));
- props.set(ProcessProperties.SEARCH_CLUSTER_NAME, A_CLUSTER_NAME);
+ props.set(ProcessProperties.CLUSTER_NAME, A_CLUSTER_NAME);
props.set(EsSettings.CLUSTER_SEARCH_NODE_NAME, A_NODE_NAME);
props.set(ProcessProperties.PATH_HOME, temp.newFolder().getAbsolutePath());
props.set(ProcessEntryPoint.PROPERTY_SHARED_PATH, temp.newFolder().getAbsolutePath());