From: Julien Lancelot Date: Tue, 3 Jun 2014 12:54:58 +0000 (+0200) Subject: SONAR-5359 Rename template to is_template X-Git-Tag: 4.4-RC1~680 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=37f9cb1d6cd273ccd888370eaada7c8ca1bdd9f8;p=sonarqube.git SONAR-5359 Rename template to is_template --- diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java index cc2c7c324ca..e8abe2e0f81 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java @@ -30,16 +30,13 @@ import org.sonar.api.server.rule.RuleParamType; import org.sonar.core.permission.GlobalPermissions; import org.sonar.core.persistence.DbSession; import org.sonar.core.preview.PreviewCache; -import org.sonar.core.qualityprofile.db.ActiveRuleDto; -import org.sonar.core.qualityprofile.db.ActiveRuleKey; -import org.sonar.core.qualityprofile.db.ActiveRuleParamDto; -import org.sonar.core.qualityprofile.db.QualityProfileDto; -import org.sonar.core.qualityprofile.db.QualityProfileKey; +import org.sonar.core.qualityprofile.db.*; import org.sonar.core.rule.RuleParamDto; import org.sonar.server.db.DbClient; import org.sonar.server.qualityprofile.db.ActiveRuleDao; import org.sonar.server.rule.Rule; import org.sonar.server.rule.index.RuleIndex; +import org.sonar.server.rule.index.RuleNormalizer; import org.sonar.server.rule.index.RuleQuery; import org.sonar.server.rule.index.RuleResult; import org.sonar.server.search.IndexClient; @@ -48,6 +45,7 @@ import org.sonar.server.user.UserSession; import org.sonar.server.util.TypeValidations; import javax.annotation.Nullable; + import java.util.List; import java.util.Map; @@ -295,11 +293,11 @@ public class RuleActivator implements ServerComponent { RuleResult result = ruleIndex.search(ruleQuery, QueryOptions.DEFAULT.setOffset(0) .setLimit(Integer.MAX_VALUE) - .setFieldsToReturn(ImmutableSet.of("template", "severity")) + .setFieldsToReturn(ImmutableSet.of(RuleNormalizer.RuleField.IS_TEMPLATE.field(), RuleNormalizer.RuleField.SEVERITY.field())) ); for (Rule rule : result.getHits()) { - if (!rule.template()) { + if (!rule.isTemplate()) { ActiveRuleKey key = ActiveRuleKey.of(profile, rule.key()); RuleActivation activation = new RuleActivation(key); activation.setSeverity(rule.severity()); @@ -328,7 +326,7 @@ public class RuleActivator implements ServerComponent { QueryOptions.DEFAULT.setOffset(0) // TODO pb because limited to QueryOptions.MAX_LIMIT .setLimit(Integer.MAX_VALUE) - .setFieldsToReturn(ImmutableSet.of("template", "severity")) + .setFieldsToReturn(ImmutableSet.of(RuleNormalizer.RuleField.IS_TEMPLATE.field(), RuleNormalizer.RuleField.SEVERITY.field())) ); for (Rule rule : result.getHits()) { diff --git a/sonar-server/src/main/java/org/sonar/server/rule/Rule.java b/sonar-server/src/main/java/org/sonar/server/rule/Rule.java index 5e1894a82a2..cb3008783d3 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/Rule.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/Rule.java @@ -55,7 +55,7 @@ public interface Rule { */ RuleStatus status(); - boolean template(); + boolean isTemplate(); @CheckForNull RuleKey templateKey(); diff --git a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java index 196eba033f7..0fe251bf8d1 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java @@ -86,8 +86,8 @@ public class RuleDoc extends BaseDoc implements Rule { } @Override - public boolean template() { - return (Boolean) getField(RuleNormalizer.RuleField.TEMPLATE.field()); + public boolean isTemplate() { + return (Boolean) getField(RuleNormalizer.RuleField.IS_TEMPLATE.field()); } @Override diff --git a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java index 5987a94c6d1..9e1e2f21c09 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java @@ -195,10 +195,10 @@ public class RuleIndex extends BaseIndex { Boolean isTemplate = query.isTemplate(); if (isTemplate != null) { - this.addTermFilter(fb, RuleNormalizer.RuleField.TEMPLATE.field(), Boolean.toString(isTemplate)); + this.addTermFilter(fb, RuleNormalizer.RuleField.IS_TEMPLATE.field(), Boolean.toString(isTemplate)); } - String template = query.template(); + String template = query.templateKey(); if (template != null) { this.addTermFilter(fb, RuleNormalizer.RuleField.TEMPLATE_KEY.field(), template); } diff --git a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java index aaf9e57db33..777deb5aa13 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java @@ -79,13 +79,13 @@ public class RuleNormalizer extends BaseNormalizer { public static IndexField TAGS = add(IndexField.Type.STRING, "tags"); public static IndexField SYSTEM_TAGS = add(IndexField.Type.STRING, "sysTags"); public static IndexField INTERNAL_KEY = add(IndexField.Type.STRING, "internalKey"); - public static IndexField TEMPLATE = add(IndexField.Type.BOOLEAN, "template"); + public static IndexField IS_TEMPLATE = add(IndexField.Type.BOOLEAN, "isTemplate"); + public static IndexField TEMPLATE_KEY = add(IndexField.Type.STRING, "templateKey"); public static IndexField DEBT_FUNCTION_TYPE = add(IndexField.Type.STRING, "debtRemFnType"); public static IndexField DEBT_FUNCTION_COEFFICIENT = add(IndexField.Type.STRING, "debtRemFnCoefficient"); public static IndexField DEBT_FUNCTION_OFFSET = add(IndexField.Type.STRING, "debtRemFnOffset"); public static IndexField SUB_CHARACTERISTIC = add(IndexField.Type.STRING, "debtSubChar"); public static IndexField CHARACTERISTIC = add(IndexField.Type.STRING, "debtChar"); - public static IndexField TEMPLATE_KEY = add(IndexField.Type.STRING, "templateKey"); public static IndexField NOTE = add(IndexField.Type.TEXT, "markdownNote"); public static IndexField NOTE_LOGIN = add(IndexField.Type.STRING, "noteLogin"); public static IndexField NOTE_CREATED_AT = add(IndexField.Type.DATE, "noteCreatedAt"); @@ -159,7 +159,7 @@ public class RuleNormalizer extends BaseNormalizer { update.put(RuleField.STATUS.field(), rule.getStatus().name()); update.put(RuleField.LANGUAGE.field(), rule.getLanguage()); update.put(RuleField.INTERNAL_KEY.field(), rule.getConfigKey()); - update.put(RuleField.TEMPLATE.field(), rule.getCardinality() == Cardinality.MULTIPLE); + update.put(RuleField.IS_TEMPLATE.field(), rule.getCardinality() == Cardinality.MULTIPLE); update.put(RuleField.NOTE.field(), rule.getNoteData()); update.put(RuleField.NOTE_LOGIN.field(), rule.getNoteUserLogin()); diff --git a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleQuery.java b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleQuery.java index a993a7ebf74..02481451c02 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleQuery.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleQuery.java @@ -45,7 +45,7 @@ public class RuleQuery { private Boolean activation; private String qProfileKey; private Collection inheritance; - private String template; + private String templateKey; private Boolean isTemplate; private Date availableSince; private IndexField sortField; @@ -209,12 +209,12 @@ public class RuleQuery { } @CheckForNull - public String template() { - return template; + public String templateKey() { + return templateKey; } - public RuleQuery setTemplate(@Nullable String template) { - this.template = template; + public RuleQuery setTemplateKey(@Nullable String templateKey) { + this.templateKey = templateKey; return this; } diff --git a/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java b/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java index 8adcfb1b47c..172dca21ff4 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java @@ -43,7 +43,7 @@ public class RuleMapping extends BaseMapping { addIndexStringField("severity", RuleNormalizer.RuleField.SEVERITY.field()); addIndexStringField("status", RuleNormalizer.RuleField.STATUS.field()); addIndexStringField("internalKey", RuleNormalizer.RuleField.INTERNAL_KEY.field()); - addIndexBooleanField("template", RuleNormalizer.RuleField.TEMPLATE.field()); + addIndexBooleanField("isTemplate", RuleNormalizer.RuleField.IS_TEMPLATE.field()); addIndexStringField("templateKey", RuleNormalizer.RuleField.TEMPLATE_KEY.field()); addIndexArrayField("tags", RuleNormalizer.RuleField.TAGS.field()); addIndexArrayField("sysTags", RuleNormalizer.RuleField.SYSTEM_TAGS.field()); diff --git a/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java b/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java index fd5b6502555..f82ef87be85 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java @@ -60,7 +60,7 @@ public class SearchAction implements RequestHandler { public static final String PARAM_ALL_OF_TAGS = "all_of_tags"; public static final String PARAM_INHERITANCE = "inheritance"; public static final String PARAM_IS_TEMPLATE = "is_template"; - public static final String PARAM_TEMPLATE = "template"; + public static final String PARAM_TEMPLATE_KEY = "template_key"; public static final String PARAM_FACETS = "facets"; public static final String SEARCH_ACTION = "search"; @@ -182,7 +182,7 @@ public class SearchAction implements RequestHandler { .setBooleanPossibleValues(); action - .createParam(PARAM_TEMPLATE) + .createParam(PARAM_TEMPLATE_KEY) .setDescription("Key of template rule to filter on. Available since 4.4") .setExampleValue("java:S001"); @@ -240,7 +240,7 @@ public class SearchAction implements RequestHandler { query.setAllOfTags(request.paramAsStrings(PARAM_ALL_OF_TAGS)); query.setInheritance(request.paramAsStrings(PARAM_INHERITANCE)); query.setIsTemplate(request.paramAsBoolean(PARAM_IS_TEMPLATE)); - query.setTemplate(request.param(PARAM_TEMPLATE)); + query.setTemplateKey(request.param(PARAM_TEMPLATE_KEY)); return query; } diff --git a/sonar-server/src/main/resources/org/sonar/server/rule/ws/example-search.json b/sonar-server/src/main/resources/org/sonar/server/rule/ws/example-search.json index d0e72132529..7b639d78419 100644 --- a/sonar-server/src/main/resources/org/sonar/server/rule/ws/example-search.json +++ b/sonar-server/src/main/resources/org/sonar/server/rule/ws/example-search.json @@ -11,7 +11,7 @@ "severity": "MAJOR", "status": "READY", "internalKey": "S1067", - "template": false, + "isTemplate": false, "tags": [], "sysTags": ["brain-overload"], "lang": "java", @@ -32,7 +32,7 @@ "severity": "MAJOR", "status": "READY", "internalKey": "ClassCyclomaticComplexity", - "template": false, + "isTemplate": false, "tags": [], "sysTags": ["brain-overload"], "lang": "java", @@ -53,7 +53,7 @@ "severity": "MAJOR", "status": "READY", "internalKey": "MethodCyclomaticComplexity", - "template": false, + "isTemplate": false, "tags": [], "sysTags": ["brain-overload"], "lang": "java", @@ -65,6 +65,64 @@ "defaultValue": "10" } ] + }, + { + "key": "squid:XPath", + "repo": "squid", + "name": "XPath rule", + "createdAt": "2013-03-27T08:52:40+0100", + "htmlDesc": "

\nThis rule allows to define some homemade Java rules with help of an XPath expression.\n

\n\n

\nIssues are created depending on the return value of the XPath expression. If the XPath expression returns:\n

\n
    \n
  • a single or list of AST nodes, then a line issue with the given message is created for each node
  • \n
  • a boolean, then a file issue with the given message is created only if the boolean is true
  • \n
  • anything else, no issue is created
  • \n
\n\n

\nHere is an example of an XPath expression to log an issue on each if statement : //ifStatement\n

", + "severity": "MAJOR", + "status": "READY", + "internalKey": "XPath", + "isTemplate": true, + "tags": [ ], + "sysTags": [ ], + "mdNote": "

\nThe tree produced by the firstOf() matcher is hard to work with from checks when alternatives are not named.\n

\n\n

\nConsider the following rule:\n

\n\n
\nb.rule(COMPILATION_UNIT).is(\n b.firstOf( /* Non-Compliant */\n \"FOO\",\n \"BAR\"));\n
\n\n

\nIf, from a check, one wants to forbid the usage of the \"BAR\" alternative,\nthe easiest option will be to verify that the value of the first token is \"BAR\",\ni.e. \"BAR\".equals(compilationUnitNode.getTokenValue()).\n

\n\n

\nThis is not maintainable, for at least two reasons:\n

\n\n
    \n
  • The grammar might evolve to also accept \"bar\" in lowercase, which will break \"BAR\".equals(...)
  • \n
  • The grammar might evolve to optionally accept \"hello\" before the firstOf(), which will break compilationUnitNode.getTokenValue()
  • \n
\n\n

\nInstead, it is much better to rewrite the grammar as:\n

\n\n
\nb.rule(COMPILATION_UNIT).is(\n firstOf( /* Compliant */\n FOO,\n BAR));\nb.rule(FOO).is(\"FOO\");\nb.rule(BAR).is(\"BAR\");\n
\n\n

\nThe same check which forbids \"BAR\" would be written as: compilationUnitNode.hasDirectChildren(BAR).\nThis allows both of the previous grammar evolutions to be made without impacting the check at all.\n

", + "htmlNote": "<p>
The tree produced by the <code>firstOf()</code> matcher is hard to work with from checks when alternatives are not named.
</p>

<p>
Consider the following rule:
</p>

<pre>
b.rule(COMPILATION_UNIT).is(
b.firstOf( /* Non-Compliant */
"FOO",
"BAR"));
</pre>

<p>
If, from a check, one wants to forbid the usage of the "BAR" alternative,
the easiest option will be to verify that the value of the first token is "BAR",
i.e. <code>"BAR".equals(compilationUnitNode.getTokenValue())</code>.
</p>

<p>
This is not maintainable, for at least two reasons:
</p>

<ul>
<li>The grammar might evolve to also accept "bar" in lowercase, which will break <code>"BAR".equals(...)</code></li>
<li>The grammar might evolve to optionally accept "hello" before the <code>firstOf()</code>, which will break <code>compilationUnitNode.getTokenValue()</code></li>
</ul>

<p>
Instead, it is much better to rewrite the grammar as:
</p>

<pre>
b.rule(COMPILATION_UNIT).is(
firstOf( /* Compliant */
FOO,
BAR));
b.rule(FOO).is("FOO");
b.rule(BAR).is("BAR");
</pre>

<p>
The same check which forbids "BAR" would be written as: <code>compilationUnitNode.hasDirectChildren(BAR)</code>.
This allows both of the previous grammar evolutions to be made without impacting the check at all.
</p>", + "noteLogin": "eric.hartmann", + "lang": "java", + "langName": "Java", + "params": [ + { + "key": "xpathQuery", + "desc": "The XPath query", + "defaultValue": "" + }, + { + "key": "message", + "desc": "The violation message", + "defaultValue": "The XPath expression matches this piece of code" + } + ] + }, + { + "key": "squid:XPath_1369910135", + "repo": "squid", + "name": "firstOf() alternatives should be rules or token types", + "createdAt": "2013-05-30T10:35:35+0200", + "htmlDesc": "

\r\nThe tree produced by the firstOf() matcher is hard to work with from checks when alternatives are not named.\r\n

\r\n\r\n

\r\nConsider the following rule:\r\n

\r\n\r\n
\r\nb.rule(COMPILATION_UNIT).is(\r\n b.firstOf( /* Non-Compliant */\r\n \"FOO\",\r\n \"BAR\"));\r\n
\r\n\r\n

\r\nIf, from a check, one wants to forbid the usage of the \"BAR\" alternative,\r\nthe easiest option will be to verify that the value of the first token is \"BAR\",\r\ni.e. \"BAR\".equals(compilationUnitNode.getTokenValue()).\r\n

\r\n\r\n

\r\nThis is not maintainable, for at least two reasons:\r\n

\r\n\r\n
    \r\n
  • The grammar might evolve to also accept \"bar\" in lowercase, which will break \"BAR\".equals(...)
  • \r\n
  • The grammar might evolve to optionally accept \"hello\" before the firstOf(), which will break compilationUnitNode.getTokenValue()
  • \r\n
\r\n\r\n

\r\nInstead, it is much better to rewrite the grammar as:\r\n

\r\n\r\n
\r\nb.rule(COMPILATION_UNIT).is(\r\n firstOf( /* Compliant */\r\n FOO,\r\n BAR));\r\nb.rule(FOO).is(\"FOO\");\r\nb.rule(BAR).is(\"BAR\");\r\n
\r\n\r\n

\r\nThe same check which forbids \"BAR\" would be written as: compilationUnitNode.hasDirectChildren(BAR).\r\nThis allows both of the previous grammar evolutions to be made without impacting the check at all.\r\n

", + "severity": "MAJOR", + "status": "READY", + "internalKey": "XPath", + "isTemplate": false, + "templateKey": "squid:XPath", + "tags": [ ], + "sysTags": [ ], + "lang": "java", + "langName": "Java", + "params": [ + { + "key": "xpathQuery", + "desc": "The XPath query", + "defaultValue": "//expression[primary/qualifiedIdentifier[count(IDENTIFIER) = 2]/IDENTIFIER[2]/@tokenValue = 'firstOf' and primary/identifierSuffix/arguments/expression[not(primary) or primary[not(qualifiedIdentifier) or identifierSuffix]]]" + }, + { + "key": "message", + "desc": "The violation message", + "defaultValue": "Refactor this firstOf() to only use a rule or token type for each alternative." + } + ] } ], "actives": { @@ -156,7 +214,8 @@ { "val": "javadoc", "count": 13 - }] + } + ] }, { "name": "languages", diff --git a/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java b/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java index f470e9e0eac..e146c532c95 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java @@ -102,7 +102,7 @@ public class RuleBackendMediumTest { assertThat(hit.updatedAt()).isNotNull(); assertThat(hit.internalKey()).isEqualTo("InternalKeyS001"); assertThat(hit.severity()).isEqualTo("INFO"); - assertThat(hit.template()).isFalse(); + assertThat(hit.isTemplate()).isFalse(); assertThat(hit.tags()).containsOnly("tag1", "tag2"); assertThat(hit.systemTags()).containsOnly("systag1", "systag2"); } diff --git a/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java b/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java index 05c6fa5985b..3b182fb9147 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java @@ -661,13 +661,13 @@ public class RuleIndexMediumTest { results = index.search(query, new QueryOptions()); assertThat(results.getHits()).hasSize(1); assertThat(Iterables.getFirst(results.getHits(), null).key().rule()).isEqualTo("S002"); - assertThat(Iterables.getFirst(results.getHits(), null).template()).isTrue(); + assertThat(Iterables.getFirst(results.getHits(), null).isTemplate()).isTrue(); // Only not template query = new RuleQuery().setIsTemplate(false); results = index.search(query, new QueryOptions()); assertThat(results.getHits()).hasSize(1); - assertThat(Iterables.getFirst(results.getHits(), null).template()).isFalse(); + assertThat(Iterables.getFirst(results.getHits(), null).isTemplate()).isFalse(); assertThat(Iterables.getFirst(results.getHits(), null).key().rule()).isEqualTo("S001"); // null => no filter @@ -688,14 +688,14 @@ public class RuleIndexMediumTest { assertThat(results.getHits()).hasSize(2); // Only custom rule - query = new RuleQuery().setTemplate("java:S001"); + query = new RuleQuery().setTemplateKey("java:S001"); results = index.search(query, new QueryOptions()); assertThat(results.getHits()).hasSize(1); assertThat(Iterables.getFirst(results.getHits(), null).key().rule()).isEqualTo("S001_MY_CUSTOM"); assertThat(Iterables.getFirst(results.getHits(), null).templateKey()).isEqualTo(RuleKey.of("java", "S001")); // null => no filter - query = new RuleQuery().setTemplate(null); + query = new RuleQuery().setTemplateKey(null); assertThat(index.search(query, new QueryOptions()).getHits()).hasSize(2); } diff --git a/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceTest.java b/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceTest.java index ccbdff36d1f..cd7f36756d6 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceTest.java @@ -175,7 +175,7 @@ public class RulesWebServiceTest { MockUserSession.set(); WsTester.TestRequest request = tester.wsTester().newGetRequest(API_ENDPOINT, API_SEARCH_METHOD); - request.setParam(SearchOptions.PARAM_FIELDS, "template"); + request.setParam(SearchOptions.PARAM_FIELDS, "isTemplate"); request.setParam(SearchAction.PARAM_IS_TEMPLATE, "true"); WsTester.Result result = request.execute(); result.assertJson(this.getClass(), "search_template_rules.json"); @@ -191,7 +191,7 @@ public class RulesWebServiceTest { MockUserSession.set(); WsTester.TestRequest request = tester.wsTester().newGetRequest(API_ENDPOINT, API_SEARCH_METHOD); request.setParam(SearchOptions.PARAM_FIELDS, "templateKey"); - request.setParam(SearchAction.PARAM_TEMPLATE, "java:S001"); + request.setParam(SearchAction.PARAM_TEMPLATE_KEY, "java:S001"); WsTester.Result result = request.execute(); result.assertJson(this.getClass(), "search_rules_from_template_key.json"); } diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/search_2_rules.json b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/search_2_rules.json index ea0909a52d9..6bf26137b79 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/search_2_rules.json +++ b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/search_2_rules.json @@ -7,7 +7,7 @@ "htmlDesc": "Description S002", "status": "READY", "severity": "INFO", - "template": false, + "isTemplate": false, "internalKey": "InternalKeyS002", "tags": [], "sysTags": [], @@ -24,7 +24,7 @@ "htmlDesc": "Description S001", "status": "READY", "severity": "INFO", - "template": false, + "isTemplate": false, "internalKey": "InternalKeyS001", "tags": [], "sysTags": [], diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/search_template_rules.json b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/search_template_rules.json index bb8f626b6c6..e757679aa7d 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/search_template_rules.json +++ b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/search_template_rules.json @@ -1,6 +1,6 @@ {"total": 1, "p": 1, "ps": 10, "rules": [ { "key": "java:S001", - "template": true + "isTemplate": true } ]} diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/show_rule_active.json b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/show_rule_active.json index 97e4c23b920..f10eaae7667 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/show_rule_active.json +++ b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/show_rule_active.json @@ -22,6 +22,6 @@ "status": "READY", "sysTags": [], "tags": [], - "template": false + "isTemplate": false } } diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/show_rule_no_active.json b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/show_rule_no_active.json index c96026422a9..a0921b67973 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/show_rule_no_active.json +++ b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceTest/show_rule_no_active.json @@ -14,6 +14,6 @@ "status": "READY", "sysTags": [], "tags": [], - "template": false + "isTemplate": false } }