From: simonbrandhof Date: Wed, 12 Jan 2011 17:34:22 +0000 (+0100) Subject: merge 2.5: SONAR-2024 Improvements to Java WS client X-Git-Tag: 2.6~167 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a0aec0767a37cdafdf70b2f90fe438d53da43a26;p=sonarqube.git merge 2.5: SONAR-2024 Improvements to Java WS client --- diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Rule.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Rule.java index 8fb2192b299..c639d8b331a 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Rule.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Rule.java @@ -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 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; } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/RuleQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/RuleQuery.java index d5d96f9475f..181ab9810b4 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/RuleQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/RuleQuery.java @@ -26,7 +26,7 @@ public class RuleQuery extends Query { 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 { 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 { 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); diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/RuleUnmarshaller.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/RuleUnmarshaller.java index 001ac3463fc..041d3afd573 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/RuleUnmarshaller.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/RuleUnmarshaller.java @@ -43,7 +43,7 @@ public class RuleUnmarshaller extends AbstractUnmarshaller { 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"))); diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/RuleUnmarshallerTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/RuleUnmarshallerTest.java index 57c4f43dc26..71484bbe97e 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/RuleUnmarshallerTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/RuleUnmarshallerTest.java @@ -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));