]> source.dussan.org Git - sonarqube.git/commitdiff
merge 2.5: SONAR-2024 Improvements to Java WS client
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 12 Jan 2011 17:34:22 +0000 (18:34 +0100)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 12 Jan 2011 17:34:22 +0000 (18:34 +0100)
sonar-ws-client/src/main/java/org/sonar/wsclient/services/Rule.java
sonar-ws-client/src/main/java/org/sonar/wsclient/services/RuleQuery.java
sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/RuleUnmarshaller.java
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/RuleUnmarshallerTest.java

index 8fb2192b299c32691e88846f94bafabf365c5e41..c639d8b331a461a1bd712b6884f224d414786bcb 100644 (file)
@@ -28,7 +28,7 @@ public class Rule extends Model {
 
   private String title = null;
   private String key = null;
-  private String plugin = null;
+  private String repository = null;
   private String description = null;
   private String severity = null;
   private List<RuleParam> params;
@@ -52,12 +52,12 @@ public class Rule extends Model {
     return this;
   }
 
-  public String getPlugin() {
-    return plugin;
+  public String getRepository() {
+    return repository;
   }
 
-  public Rule setPlugin(String plugin) {
-    this.plugin = plugin;
+  public Rule setRepository(String s) {
+    this.repository = s;
     return this;
   }
 
index d5d96f9475fc890b3e77e05c2e480cb419c6dd8c..181ab9810b4be7139e3223607cebbf237211cc3f 100644 (file)
@@ -26,7 +26,7 @@ public class RuleQuery extends Query<Rule> {
   public static final String BASE_URL = "/api/rules";
 
   private String language;
-  private String[] plugins;
+  private String[] repositories;
   private String searchText;
   private String profile;
   private String[] severities;
@@ -45,13 +45,13 @@ public class RuleQuery extends Query<Rule> {
     return language;
   }
 
-  public RuleQuery setPlugin(String... plugins) {
-    this.plugins = plugins;
+  public RuleQuery setRepositories(String... s) {
+    this.repositories = s;
     return this;
   }
 
-  public String[] getPlugins() {
-    return plugins;
+  public String[] getRepositories() {
+    return repositories;
   }
 
   public RuleQuery setSearchText(String searchText) {
@@ -95,7 +95,7 @@ public class RuleQuery extends Query<Rule> {
     StringBuilder url = new StringBuilder(BASE_URL);
     url.append('?');
     appendUrlParameter(url, "language", language);
-    appendUrlParameter(url, "plugins", plugins);
+    appendUrlParameter(url, "plugins", repositories);
     appendUrlParameter(url, "searchtext", searchText);
     appendUrlParameter(url, "profile", profile);
     appendUrlParameter(url, "priorities", severities);
index 001ac3463fc52288bdef782949b04603fef9cc42..041d3afd573014c3859d363df23c0de12a799f37 100644 (file)
@@ -43,7 +43,7 @@ public class RuleUnmarshaller extends AbstractUnmarshaller<Rule> {
   private void parseRuleFields(JSONObject json, Rule rule) {
     rule.setTitle(JsonUtils.getString(json, "title"))
         .setKey(JsonUtils.getString(json, "key"))
-        .setPlugin(JsonUtils.getString(json, "plugin"))
+        .setRepository(JsonUtils.getString(json, "plugin"))
         .setDescription(JsonUtils.getString(json, "description"))
         .setSeverity(JsonUtils.getString(json, "priority"))
         .setActive("ACTIVE".equals(JsonUtils.getString(json, "status")));
index 57c4f43dc26ad1dcfcef6d83d114480a766d017f..71484bbe97e99efcafb21354208daf947191ca7f 100644 (file)
@@ -44,7 +44,7 @@ public class RuleUnmarshallerTest {
     rule = rules.get(0);
     assertThat(rule.getTitle(), is("Indentation"));
     assertThat(rule.getKey(), is("checkstyle:com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck"));
-    assertThat(rule.getPlugin(), is("checkstyle"));
+    assertThat(rule.getRepository(), is("checkstyle"));
     assertThat(rule.getDescription(), is("Checks correct indentation of Java Code."));
     assertThat(rule.getSeverity(), is("MINOR"));
     assertThat(rule.isActive(), is(false));