]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5300 id should be a long instead of an integer
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 3 Jul 2014 13:08:07 +0000 (15:08 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 3 Jul 2014 13:08:07 +0000 (15:08 +0200)
sonar-core/src/main/java/org/sonar/core/measure/db/MeasureDto.java
sonar-core/src/test/java/org/sonar/core/measure/db/MeasureDtoTest.java
sonar-server/src/test/java/org/sonar/server/measure/persistence/MeasureDaoTest.java

index 7d45ab6784e568bd7b75e4f7538fad40548c7c58..d51a9009ed550c9aada719c8b75c896cc77e599b 100644 (file)
@@ -30,7 +30,7 @@ public class MeasureDto extends Dto<MeasureKey>{
 
   private static final String INDEX_SHOULD_BE_IN_RANGE_FROM_1_TO_5 = "Index should be in range from 1 to 5";
 
-  private Integer id;
+  private Long id;
 
   private String metricKey;
 
@@ -48,11 +48,11 @@ public class MeasureDto extends Dto<MeasureKey>{
     // Nothing here
   }
 
-  public Integer getId() {
+  public Long getId() {
     return id;
   }
 
-  public MeasureDto setId(Integer id) {
+  public MeasureDto setId(Long id) {
     this.id = id;
     return this;
   }
index 64171ee337a2f6fbd720d3e03307d012d009d567..833efb1911677a3498d58e6c1b2c332895d79a7d 100644 (file)
@@ -30,7 +30,7 @@ public class MeasureDtoTest {
   @Test
   public void test_getter_and_setter() throws Exception {
     MeasureDto measureDto = MeasureDto.createFor(MeasureKey.of("component", "metric"))
-      .setId(10)
+      .setId(10L)
       .setValue(2d)
       .setTextValue("text value")
       .setData(new byte[]{})
index c6c2027e46c580dafff7b588c52da6bac5bcfc47..15afbb3bdadd5e06bdde80bdb6e2489f47aee7f1 100644 (file)
@@ -92,7 +92,7 @@ public class MeasureDaoTest extends AbstractDaoTestCase {
     MeasureDto result = results.get(0);
     assertThat(result.getId()).isEqualTo(22);
     assertThat(result.getValue()).isEqualTo(10d);
-    assertThat(result.getKey()).isNotNull();
+    assertThat(result.getKey()).isEqualTo(MeasureKey.of("org.struts:struts-core:src/org/struts/RequestContext.java", "ncloc"));
     assertThat(result.getVariation(1)).isEqualTo(1d);
     assertThat(result.getVariation(2)).isEqualTo(2d);
     assertThat(result.getVariation(3)).isEqualTo(3d);