aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-search
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-08-13 17:52:11 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-08-13 17:52:11 +0200
commite649bc9398f66fd43677c69f8a1439ceb93ce869 (patch)
tree0581c2c010dfa312c50409dd1532cb47425d08bd /server/sonar-search
parent4056a9ca7e06c148aef69b2768fc703ea2555921 (diff)
downloadsonarqube-e649bc9398f66fd43677c69f8a1439ceb93ce869.tar.gz
sonarqube-e649bc9398f66fd43677c69f8a1439ceb93ce869.zip
fix quality flaws
Diffstat (limited to 'server/sonar-search')
-rw-r--r--server/sonar-search/src/main/java/org/sonar/search/SearchServer.java6
-rw-r--r--server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java3
2 files changed, 7 insertions, 2 deletions
diff --git a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java
index 486e8e612ef..8edce3858fd 100644
--- a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java
+++ b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java
@@ -144,6 +144,12 @@ public class SearchServer extends MonitoredProcess {
.settings(esSettings)
.build().start();
+ node.client().admin().indices()
+ .preparePutTemplate("default")
+ .setTemplate("*")
+ .addMapping("_default_", "{\"dynamic\": \"strict\"}")
+ .get();
+
if (this.isBlocking) {
while (node != null && !node.isClosed()) {
try {
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 4b65bcf0dff..aebc0c85984 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
@@ -46,7 +46,6 @@ import java.util.Properties;
import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.fail;
-@Ignore
public class SearchServerTest {
@Rule
@@ -82,6 +81,7 @@ public class SearchServerTest {
}
@Test
+ @Ignore
public void server_fail_to_start() throws Exception {
Properties properties = new Properties();
properties.setProperty(MonitoredProcess.NAME_PROPERTY, "ES");
@@ -106,7 +106,6 @@ public class SearchServerTest {
count++;
}
assertThat(count).isEqualTo(100);
-
}
@Test