aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-05-22 17:37:47 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-05-22 17:37:47 +0200
commit2dcb4bac6217bcbbaceb6af2101533ee74eb5db3 (patch)
treed0d030e427962a719c761d0bc6f9e1dce053d09d /sonar-ws-client
parentc9c8fa20425f48628e05e1588c3b2549846721d3 (diff)
downloadsonarqube-2dcb4bac6217bcbbaceb6af2101533ee74eb5db3.tar.gz
sonarqube-2dcb4bac6217bcbbaceb6af2101533ee74eb5db3.zip
SONAR-4301 Add maxResultsReached parameter on Issues WS
Diffstat (limited to 'sonar-ws-client')
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueParser.java1
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java10
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java2
-rw-r--r--sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-comments.json3
-rw-r--r--sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-components.json3
-rw-r--r--sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-projects.json3
-rw-r--r--sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-users.json3
-rw-r--r--sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json3
8 files changed, 22 insertions, 6 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueParser.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueParser.java
index 0f225f03f8e..537d1ceeb62 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueParser.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueParser.java
@@ -75,6 +75,7 @@ class IssueParser {
Map paging = (Map) jsonRoot.get("paging");
result.setPaging(new Paging(paging));
result.setSecurityExclusions(JsonUtils.getBoolean(jsonRoot, "securityExclusions"));
+ result.setMaxResultsReached(JsonUtils.getBoolean(jsonRoot, "maxResultsReached"));
return result;
}
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java
index ab0c8f36ca9..ea06ffdf8f7 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java
@@ -39,6 +39,7 @@ public class Issues {
private final Map<String, Component> projectsByKey = new HashMap<String, Component>();
private Paging paging;
private Boolean securityExclusions;
+ private Boolean maxResultsReached;
public List<Issue> list() {
return list;
@@ -91,6 +92,10 @@ public class Issues {
return securityExclusions;
}
+ public Boolean maxResultsReached() {
+ return maxResultsReached;
+ }
+
Issues add(Issue issue) {
list.add(issue);
return this;
@@ -125,4 +130,9 @@ public class Issues {
this.securityExclusions = securityExclusions;
return this;
}
+
+ Issues setMaxResultsReached(Boolean maxResultsReached) {
+ this.maxResultsReached = maxResultsReached;
+ return this;
+ }
}
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java
index 6bc95d9fdc3..82dd222875d 100644
--- a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java
+++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java
@@ -79,6 +79,7 @@ public class IssueParserTest {
assertThat(paging.total()).isEqualTo(2);
assertThat(issues.securityExclusions()).isTrue();
+ assertThat(issues.maxResultsReached()).isTrue();
}
@Test
@@ -90,7 +91,6 @@ public class IssueParserTest {
assertThat(issues.rules()).isEmpty();
}
-
@Test
public void test_GET_transitions() throws Exception {
String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/IssueParserTest/getTransitions.json"));
diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-comments.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-comments.json
index e5a213f7ba6..4378189dbba 100644
--- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-comments.json
+++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-comments.json
@@ -38,5 +38,6 @@
"total": 2,
"pages": 1
},
- "securityExclusions": true
+ "securityExclusions": true,
+ "maxResultsReached": false
} \ No newline at end of file
diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-components.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-components.json
index 86655ee1470..37711422340 100644
--- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-components.json
+++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-components.json
@@ -46,5 +46,6 @@
"total": 2,
"pages": 1
},
- "securityExclusions": true
+ "securityExclusions": true,
+ "maxResultsReached": false
} \ No newline at end of file
diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-projects.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-projects.json
index f0542d4f8bd..c999362047b 100644
--- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-projects.json
+++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-projects.json
@@ -54,5 +54,6 @@
"total": 2,
"pages": 1
},
- "securityExclusions": true
+ "securityExclusions": true,
+ "maxResultsReached": false
} \ No newline at end of file
diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-users.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-users.json
index f076b290b4d..32d3a8e323f 100644
--- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-users.json
+++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-users.json
@@ -52,5 +52,6 @@
"total": 2,
"pages": 1
},
- "securityExclusions": true
+ "securityExclusions": true,
+ "maxResultsReached": false
} \ No newline at end of file
diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json
index c88120f2dd9..6931c7de92b 100644
--- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json
+++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json
@@ -51,5 +51,6 @@
"total": 2,
"pages": 1
},
- "securityExclusions": true
+ "securityExclusions": true,
+ "maxResultsReached": true
} \ No newline at end of file