]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4235 Add creationDate to the Java WS Client
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 25 Jun 2013 15:55:43 +0000 (17:55 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Tue, 25 Jun 2013 15:55:43 +0000 (17:55 +0200)
sonar-ws-client/src/main/java/org/sonar/wsclient/services/Resource.java
sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshaller.java
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshallerTest.java
sonar-ws-client/src/test/resources/resources/many-resources.json
sonar-ws-client/src/test/resources/resources/single-resource-with-measures.json
sonar-ws-client/src/test/resources/resources/single-resource-with-trends.json
sonar-ws-client/src/test/resources/resources/single-resource.json

index 17f0c0c1687227638e25ad1c51d01784776f606e..b5996c64363df0cdebd9569a2d04b50af83159ad 100644 (file)
@@ -57,6 +57,7 @@ public class Resource extends Model {
   private String description;
   private Date date;
   private List<Measure> measures;
+  private Date creationDate;
 
   // periods used for variations and tracking of violations
   private String period1Mode, period2Mode, period3Mode, period4Mode, period5Mode;
@@ -169,6 +170,15 @@ public class Resource extends Model {
     return this;
   }
 
+  public Date getCreationDate() {
+    return creationDate;
+  }
+
+  public Resource setCreationDate(Date d) {
+    this.creationDate = d;
+    return this;
+  }
+
   public List<Measure> getMeasures() {
     if (measures == null) {
       return Collections.emptyList();
index 6bc1c389162dd02178a68a26dc4004a380d3399d..5627035222429733482b0db85208b7cd570e719c 100644 (file)
@@ -48,6 +48,7 @@ public class ResourceUnmarshaller extends AbstractUnmarshaller<Resource> {
         .setLanguage(utils.getString(json, "lang"))
         .setDescription(utils.getString(json, "description"))
         .setDate(utils.getDateTime(json, "date"))
+        .setCreationDate(utils.getDateTime(json, "creationDate"))
         .setVersion(utils.getString(json, "version"))
         .setPeriod1Mode(utils.getString(json, "p1"))
         .setPeriod1Param(utils.getString(json, "p1p"))
index f679b03f512ac46e6943b2e3c0ee38efb5dae7d5..29a04d433032178435ac736f2d25e269631e4266 100644 (file)
@@ -99,5 +99,6 @@ public class ResourceUnmarshallerTest extends UnmarshallerTestCase {
     assertThat(resource.getLanguage(), is("java"));
     assertThat(resource.getDescription(), is("Embrace Quality"));
     assertThat(resource.getDate(), not(nullValue()));
+    assertThat(resource.getCreationDate(), not(nullValue()));
   }
 }
index f8b549c0c6c7bb8b4e7a1bf8365c0ad4ff3443c9..680d413d6fcefb42ba468607ccc9e1da0e7dfaec 100644 (file)
@@ -1 +1 @@
-[{"id":38909,"key":"org.codehaus.sonar:sonar-plugin-api","name":"Sonar API","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":94156,"key":"org.codehaus.sonar:sonar-squid","name":"Sonar Squid","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:29:42+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":182945,"key":"org.codehaus.sonar:sonar-colorizer","name":"Sonar Code Colorizer","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:32+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":222615,"key":"org.codehaus.sonar:sonar-client","name":"Sonar Client","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:50+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":172279,"key":"org.codehaus.sonar.archetypes:sonar-archetypes","name":"Sonar archetypes","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:53+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39023,"key":"org.codehaus.sonar:sonar-core","name":"Sonar core","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:57+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":88480,"key":"org.codehaus.sonar.runtime:sonar-core-maven-plugin","name":"Sonar batch","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:33:57+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Sonar batch"},{"id":39141,"key":"org.codehaus.sonar:sonar-web","name":"Sonar web","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:34:42+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39212,"key":"org.codehaus.sonar:sonar-application","name":"Sonar application","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:35:38+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Package the standalone distribution"},{"id":48696,"key":"org.codehaus.sonar.plugins:sonar-plugin-core","name":"Sonar plugin core","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:35:53+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39200,"key":"org.codehaus.sonar.plugins:sonar-plugin-checkstyle","name":"Sonar Checkstyle plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:05+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39218,"key":"org.codehaus.sonar.plugins:sonar-plugin-pmd","name":"Sonar PMD plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:21+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48767,"key":"org.codehaus.sonar.plugins:sonar-plugin-cobertura","name":"Sonar Cobertura plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:37+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48774,"key":"org.codehaus.sonar.plugins:sonar-plugin-clover","name":"Sonar Clover plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:52+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48796,"key":"org.codehaus.sonar.plugins:sonar-plugin-surefire","name":"Sonar Surefire plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:08+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48806,"key":"org.codehaus.sonar.plugins:sonar-plugin-googleanalytics","name":"Sonar Google analytics plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:21+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48810,"key":"org.codehaus.sonar.plugins:sonar-plugin-findbugs","name":"Sonar Findbugs plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:29+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48790,"key":"org.codehaus.sonar.plugins:sonar-plugin-cpd","name":"Sonar CPD plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:47+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":94200,"key":"org.codehaus.sonar.plugins:sonar-plugin-squid","name":"Sonar Squid plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:59+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"}]
\ No newline at end of file
+[{"id":38909,"key":"org.codehaus.sonar:sonar-plugin-api","name":"Sonar API","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:27:25+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":94156,"key":"org.codehaus.sonar:sonar-squid","name":"Sonar Squid","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:29:42+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":182945,"key":"org.codehaus.sonar:sonar-colorizer","name":"Sonar Code Colorizer","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:32+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":222615,"key":"org.codehaus.sonar:sonar-client","name":"Sonar Client","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:50+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":172279,"key":"org.codehaus.sonar.archetypes:sonar-archetypes","name":"Sonar archetypes","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:53+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39023,"key":"org.codehaus.sonar:sonar-core","name":"Sonar core","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:32:57+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":88480,"key":"org.codehaus.sonar.runtime:sonar-core-maven-plugin","name":"Sonar batch","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:33:57+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Sonar batch"},{"id":39141,"key":"org.codehaus.sonar:sonar-web","name":"Sonar web","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:34:42+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39212,"key":"org.codehaus.sonar:sonar-application","name":"Sonar application","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:35:38+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Package the standalone distribution"},{"id":48696,"key":"org.codehaus.sonar.plugins:sonar-plugin-core","name":"Sonar plugin core","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:35:53+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39200,"key":"org.codehaus.sonar.plugins:sonar-plugin-checkstyle","name":"Sonar Checkstyle plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:05+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":39218,"key":"org.codehaus.sonar.plugins:sonar-plugin-pmd","name":"Sonar PMD plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:21+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48767,"key":"org.codehaus.sonar.plugins:sonar-plugin-cobertura","name":"Sonar Cobertura plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:37+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48774,"key":"org.codehaus.sonar.plugins:sonar-plugin-clover","name":"Sonar Clover plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:39:52+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48796,"key":"org.codehaus.sonar.plugins:sonar-plugin-surefire","name":"Sonar Surefire plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:08+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48806,"key":"org.codehaus.sonar.plugins:sonar-plugin-googleanalytics","name":"Sonar Google analytics plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:21+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48810,"key":"org.codehaus.sonar.plugins:sonar-plugin-findbugs","name":"Sonar Findbugs plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:29+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":48790,"key":"org.codehaus.sonar.plugins:sonar-plugin-cpd","name":"Sonar CPD plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:47+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"},{"id":94200,"key":"org.codehaus.sonar.plugins:sonar-plugin-squid","name":"Sonar Squid plugin","scope":"PRJ","qualifier":"BRC","date":"2010-01-01T22:40:59+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"}]
\ No newline at end of file
index 037796c3ce19f14b776ce5cf45a9577d4ddbb96a..704359e5d4e982e9e099c1e99db0d4df4081fd7a 100644 (file)
@@ -1 +1 @@
-[{"id":48569,"key":"org.codehaus.sonar:sonar","name":"Sonar","scope":"PRJ","qualifier":"TRK","date":"2010-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"lines","val":47798.0,"frmt_val":"47,798"},{"key":"ncloc","val":27066.0,"frmt_val":"27,066"}]}]
\ No newline at end of file
+[{"id":48569,"key":"org.codehaus.sonar:sonar","name":"Sonar","scope":"PRJ","qualifier":"TRK","date":"2010-01-01T22:27:25+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality","msr":[{"key":"lines","val":47798.0,"frmt_val":"47,798"},{"key":"ncloc","val":27066.0,"frmt_val":"27,066"}]}]
\ No newline at end of file
index 6397a5df020f29061d1decbc296a5eb3143d550e..a29048a2fd5cdace085a6480697c7be373250891 100644 (file)
@@ -6,6 +6,7 @@
     "scope":"PRJ",
     "qualifier":"TRK",
     "date":"2010-01-01T22:27:25+0000",
+    "creationDate":"2009-01-01T22:27:25+0000",
     "lang":"java",
     "version":"1.13-SNAPSHOT",
     "description":"Embrace Quality",
index 5732b5938eeaa1373325d2898bbc1b283ca5bb59..3fa95cc60a3c4134fdca75daa875538e0dcd5d4f 100644 (file)
@@ -1 +1 @@
-[{"id":48569,"key":"org.codehaus.sonar:sonar","name":"Sonar","scope":"PRJ","qualifier":"TRK","date":"2010-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"}]
\ No newline at end of file
+[{"id":48569,"key":"org.codehaus.sonar:sonar","name":"Sonar","scope":"PRJ","qualifier":"TRK","date":"2010-01-01T22:27:25+0000","creationDate":"2009-01-01T22:27:25+0000","lang":"java","version":"1.13-SNAPSHOT","description":"Embrace Quality"}]
\ No newline at end of file