aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-05-01 15:20:52 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-05-01 15:20:52 +0200
commitbbfbe368e249720fc4f7f1a507537339dd03e8d0 (patch)
treef294da31bb2cc1d3b3ccfeb4eeadcbb48242283d /sonar-server
parent5d283315c8c750c85e120e3f98f1fd1c19a46c5e (diff)
downloadsonarqube-bbfbe368e249720fc4f7f1a507537339dd03e8d0.tar.gz
sonarqube-bbfbe368e249720fc4f7f1a507537339dd03e8d0.zip
SONAR-5237 - Passing Test for RuleStatus in RuleSearchMediumTest
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/rule2/RuleIndex.java8
-rw-r--r--sonar-server/src/test/java/org/sonar/server/rule2/RuleSearchMediumTest.java1
2 files changed, 8 insertions, 1 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/rule2/RuleIndex.java b/sonar-server/src/main/java/org/sonar/server/rule2/RuleIndex.java
index f43505a867b..856391b4e5e 100644
--- a/sonar-server/src/main/java/org/sonar/server/rule2/RuleIndex.java
+++ b/sonar-server/src/main/java/org/sonar/server/rule2/RuleIndex.java
@@ -130,6 +130,13 @@ public class RuleIndex extends BaseIndex<RuleKey, RuleDto> {
.endObject();
}
+ private void addFindField(XContentBuilder mapping, String field, String type) throws IOException {
+ mapping.startObject(field)
+ .field("type", type)
+ .field("index", "analyzed")
+ .endObject();
+ }
+
@Override
protected XContentBuilder getMapping() throws IOException {
XContentBuilder mapping = jsonBuilder().startObject()
@@ -140,6 +147,7 @@ public class RuleIndex extends BaseIndex<RuleKey, RuleDto> {
addMatchField(mapping, RuleField.KEY.key(), "string");
addMatchField(mapping, RuleField.REPOSITORY.key(), "string");
addMatchField(mapping, RuleField.SEVERITY.key(), "string");
+ addMatchField(mapping, RuleField.STATUS.key(), "string");
mapping.startObject(RuleField.NAME.key())
.field("type", "multi_field")
diff --git a/sonar-server/src/test/java/org/sonar/server/rule2/RuleSearchMediumTest.java b/sonar-server/src/test/java/org/sonar/server/rule2/RuleSearchMediumTest.java
index 0fa8bb86aca..4b06353cd2a 100644
--- a/sonar-server/src/test/java/org/sonar/server/rule2/RuleSearchMediumTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/rule2/RuleSearchMediumTest.java
@@ -213,7 +213,6 @@ public class RuleSearchMediumTest {
}
@Test
- @Ignore
public void search_rules_by_any_of_statuses() throws InterruptedException {
dao.insert(newRuleDto(RuleKey.of("java", "S001")).setStatus(RuleStatus.BETA.name()));
dao.insert(newRuleDto(RuleKey.of("java", "S002")).setStatus(RuleStatus.READY.name()));