]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4301 Add maxResultsReached parameter on Issues WS
authorJulien Lancelot <julien.lancelot@gmail.com>
Wed, 22 May 2013 15:37:47 +0000 (17:37 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Wed, 22 May 2013 15:37:47 +0000 (17:37 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/issues_controller.rb
sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueParser.java
sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issues.java
sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java
sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-comments.json
sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-components.json
sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-projects.json
sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/issue-with-users.json
sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json

index cf6577cce7eec7c06fe4a6702ad8d8d111039fa8..77b9f9ca2f47e72ae3141d4c8dbadb421fab08b3 100644 (file)
@@ -31,6 +31,7 @@ class Api::IssuesController < Api::ApiController
     results = Api.issues.find(params)
     hash = {
       :securityExclusions => results.securityExclusions,
+      :maxResultsReached => results.maxResultsReached,
       :paging => paging_to_hash(results.paging),
       :issues => results.issues.map { |issue| Issue.to_hash(issue) },
       :components => results.components.map { |component| component_to_hash(component) },
index 0f225f03f8e153a03be47266815d26c9ce0be47d..537d1ceeb620c888ee06f8dfff010cb55b2f2bce 100644 (file)
@@ -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;
   }
 
index ab0c8f36ca959cae57abbcec2545ece2bf4482fa..ea06ffdf8f792ea601010efc47ddef6a856a023a 100644 (file)
@@ -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;
+  }
 }
index 6bc95d9fdc372991fd7fcde40b97f5cdcec708a6..82dd222875d306775c808e0f60cb2dc501c043f1 100644 (file)
@@ -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"));
index e5a213f7ba67cb46c9e74b4cf170346fdb93649e..4378189dbbad877b306358eecbea7f59e3980797 100644 (file)
@@ -38,5 +38,6 @@
         "total": 2,
         "pages": 1
     },
-    "securityExclusions": true
+    "securityExclusions": true,
+    "maxResultsReached": false
 }
\ No newline at end of file
index 86655ee14700e716af605feacc1558d89f83131e..3771142234071b479c60bda0f69e15075c68e8c6 100644 (file)
@@ -46,5 +46,6 @@
     "total": 2,
     "pages": 1
   },
-  "securityExclusions": true
+  "securityExclusions": true,
+  "maxResultsReached": false
 }
\ No newline at end of file
index f0542d4f8bdda2b4cd92829e00f5dc4f1f2ea8ab..c999362047b4316300adf5d7dc2f1ac1149f5c12 100644 (file)
@@ -54,5 +54,6 @@
     "total": 2,
     "pages": 1
   },
-  "securityExclusions": true
+  "securityExclusions": true,
+  "maxResultsReached": false
 }
\ No newline at end of file
index f076b290b4d51d4f494429f9e929d8e37bc95e93..32d3a8e323f703c995dbafe85e7229f29d529849 100644 (file)
@@ -52,5 +52,6 @@
         "total": 2,
         "pages": 1
     },
-    "securityExclusions": true
+    "securityExclusions": true,
+    "maxResultsReached": false
 }
\ No newline at end of file
index c88120f2dd9880475ab831d4ba72d2cdedbf9aca..6931c7de92baca6bcad4fba416e817df5d65b83f 100644 (file)
@@ -51,5 +51,6 @@
     "total": 2,
     "pages": 1
   },
-  "securityExclusions": true
+  "securityExclusions": true,
+  "maxResultsReached": true
 }
\ No newline at end of file