]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5388 Rename properties
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 10 Jul 2014 11:54:10 +0000 (13:54 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 10 Jul 2014 11:54:15 +0000 (13:54 +0200)
sonar-batch/src/main/java/org/sonar/batch/debt/SqaleRatingSettings.java
sonar-batch/src/test/java/org/sonar/batch/debt/SqaleRatingDecoratorTest.java
sonar-batch/src/test/java/org/sonar/batch/debt/SqaleRatingSettingsTest.java
sonar-core/src/main/java/org/sonar/core/config/DebtProperties.java
sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java

index acba0266e26bd4bce3368103aabc27f825cebda1..47596373f11db099db53f9f39ac282f00b9b97b4 100644 (file)
@@ -54,10 +54,10 @@ public class SqaleRatingSettings implements BatchComponent {
       if (languageSpecificConfig != null && languageSpecificConfig.getManDays() != null) {
         return Long.parseLong(languageSpecificConfig.getManDays());
       }
-      return Long.parseLong(settings.getString(CoreProperties.MAN_DAYS_BY_SIZE_POINT));
+      return Long.parseLong(settings.getString(CoreProperties.DEVELOPMENT_COST));
     } catch (Exception e) {
-      throw new IllegalArgumentException("The value of the SQALE property '" + CoreProperties.MAN_DAYS_BY_SIZE_POINT
-        + "' is incorrect. Expected long but got '" + settings.getString(CoreProperties.MAN_DAYS_BY_SIZE_POINT) + "'", e);
+      throw new IllegalArgumentException("The value of the SQALE property '" + CoreProperties.DEVELOPMENT_COST
+        + "' is incorrect. Expected long but got '" + settings.getString(CoreProperties.DEVELOPMENT_COST) + "'", e);
     }
   }
 
index 1fe1574bffe392c3150207fa7e00727c8913510e..cd3029f6e51d953022b2bfaf300ab10585401caf 100644 (file)
@@ -110,7 +110,7 @@ public class SqaleRatingDecoratorTest {
 
   @Test
   public void save_total_rating_c() {
-    settings.setProperty(CoreProperties.MAN_DAYS_BY_SIZE_POINT, 2 * ONE_DAY_IN_MINUTES);
+    settings.setProperty(CoreProperties.DEVELOPMENT_COST, 2 * ONE_DAY_IN_MINUTES);
     settings.setProperty(CoreProperties.SIZE_METRIC, "ncloc");
     settings.setProperty(CoreProperties.RATING_GRID, "1, 10,20,50");
 
@@ -127,7 +127,7 @@ public class SqaleRatingDecoratorTest {
 
   @Test
   public void save_total_rating_a() {
-    settings.setProperty(CoreProperties.MAN_DAYS_BY_SIZE_POINT, 2 * ONE_DAY_IN_MINUTES);
+    settings.setProperty(CoreProperties.DEVELOPMENT_COST, 2 * ONE_DAY_IN_MINUTES);
     settings.setProperty(CoreProperties.SIZE_METRIC, "ncloc");
     settings.setProperty(CoreProperties.RATING_GRID, "1, 10,20,50");
 
@@ -144,7 +144,7 @@ public class SqaleRatingDecoratorTest {
 
   @Test
   public void save_total_rating_e() {
-    settings.setProperty(CoreProperties.MAN_DAYS_BY_SIZE_POINT, 2 * ONE_DAY_IN_MINUTES);
+    settings.setProperty(CoreProperties.DEVELOPMENT_COST, 2 * ONE_DAY_IN_MINUTES);
     settings.setProperty(CoreProperties.SIZE_METRIC, "ncloc");
     settings.setProperty(CoreProperties.RATING_GRID, "1, 10,20,50");
 
index cd784f135fc12fac66223e7b5da7476f6a00808d..8ab9e5c5f6630b3207b202a2e631d97b22926ba2 100644 (file)
@@ -61,7 +61,7 @@ public class SqaleRatingSettingsTest {
 
   @Test
   public void load_work_units_for_language() throws Exception {
-    settings.setProperty(CoreProperties.MAN_DAYS_BY_SIZE_POINT, "50");
+    settings.setProperty(CoreProperties.DEVELOPMENT_COST, "50");
     SqaleRatingSettings configurationLoader = new SqaleRatingSettings(settings);
 
     assertThat(configurationLoader.getWorkUnitsBySizePoint("defaultLanguage")).isEqualTo(50L);
@@ -110,7 +110,7 @@ public class SqaleRatingSettingsTest {
   @Test
   public void fail_on_invalid_work_unit_value() throws Exception {
     throwable.expect(IllegalArgumentException.class);
-    settings.setProperty(CoreProperties.MAN_DAYS_BY_SIZE_POINT, "a");
+    settings.setProperty(CoreProperties.DEVELOPMENT_COST, "a");
     SqaleRatingSettings configurationLoader = new SqaleRatingSettings(settings);
 
     configurationLoader.getSizeMetric("aLanguage", metrics);
@@ -130,7 +130,7 @@ public class SqaleRatingSettingsTest {
     String aLanguage = "aLanguage";
 
     settings.setProperty(CoreProperties.SIZE_METRIC, "complexity");
-    settings.setProperty(CoreProperties.MAN_DAYS_BY_SIZE_POINT, "30");
+    settings.setProperty(CoreProperties.DEVELOPMENT_COST, "30");
     settings.setProperty(CoreProperties.LANGUAGE_SPECIFIC_PARAMETERS, "0");
     settings.setProperty(CoreProperties.LANGUAGE_SPECIFIC_PARAMETERS + "." + "0" + "." + CoreProperties.LANGUAGE_SPECIFIC_PARAMETERS_LANGUAGE_KEY, aLanguage);
     settings.setProperty(CoreProperties.LANGUAGE_SPECIFIC_PARAMETERS + "." + "0" + "." + CoreProperties.LANGUAGE_SPECIFIC_PARAMETERS_MAN_DAYS_KEY, "40");
index 8979927ddc711cb653d729b8aa4e834147e2da08..035cfcb01e7319c8c358a1edcedef3978c754503 100644 (file)
@@ -55,8 +55,8 @@ class DebtProperties {
         .deprecatedKey("sizeMetric")
         .build(),
 
-      PropertyDefinition.builder(CoreProperties.MAN_DAYS_BY_SIZE_POINT)
-        .defaultValue("" + CoreProperties.MAN_DAYS_BY_SIZE_POINT_DEF_VALUE)
+      PropertyDefinition.builder(CoreProperties.DEVELOPMENT_COST)
+        .defaultValue("" + CoreProperties.DEVELOPMENT_COST_DEF_VALUE)
         .name("Development cost")
         .description("Cost to develop one unit of code. If the unit is a line of code (LOC), and the cost to develop 1 LOC has been estimated at 30 minutes, " +
           "then the value of this property would be 30.")
index ef86086c8be2d4e637b8b69bc3c807b243956b5f..aad1de5ea03b034ae1ed796e752b4b7f7052f3ca 100644 (file)
@@ -576,12 +576,12 @@ public interface CoreProperties {
   /**
    * @since 4.5
    */
-  String MAN_DAYS_BY_SIZE_POINT = "sonar.technicalDebt.workUnitsBySizePoint";
+  String DEVELOPMENT_COST = "sonar.technicalDebt.developmentCost";
 
   /**
    * @since 4.5
    */
-  String MAN_DAYS_BY_SIZE_POINT_DEF_VALUE = "30";
+  String DEVELOPMENT_COST_DEF_VALUE = "30";
 
   /**
    * @since 4.5