]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4767 Display date of snapshot used for comparison when selecting "Delta over...
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 3 Feb 2014 15:31:20 +0000 (16:31 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 3 Feb 2014 15:31:34 +0000 (16:31 +0100)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersisterTest/shared.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersisterTest/shouldSaveConfigurationInSnapshotsTable-result.xml
sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java
sonar-batch/src/test/java/org/sonar/batch/components/PastSnapshotTest.java
sonar-core/src/main/java/org/sonar/core/timemachine/Periods.java
sonar-core/src/test/java/org/sonar/core/timemachine/PeriodsTest.java
sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb

index 06cfab1131a910f857cd7f415087803854269371..3d848fe849f4b727317a56f2e766d8c2afe38b8c 100644 (file)
@@ -71,6 +71,6 @@ public final class TimeMachineConfigurationPersister implements Decorator {
     int periodIndex = pastSnapshot.getIndex();
     snapshot.setPeriodMode(periodIndex, pastSnapshot.getMode());
     snapshot.setPeriodModeParameter(periodIndex, pastSnapshot.getModeParameter());
-    snapshot.setPeriodDate(periodIndex, pastSnapshot.getTargetDate());
+    snapshot.setPeriodDate(periodIndex, pastSnapshot.getDate());
   }
 }
index 284b3618443dd0d4efa94c9b855184ecb98943db..699a4c6bf0d37844009107737bc91cd3675efc64 100644 (file)
@@ -216,7 +216,7 @@ new_window=New window
 no_data=No data
 no_lines_match_your_filter_criteria=No lines match your filter criteria.
 no_results=No results
-over_x_days=over {0} days
+over_x_days=over {0} days ({1})
 over_x_days.short={0} days
 page_size=Page size
 paging_first=First
@@ -243,7 +243,7 @@ since_version_detailed=since version {0} ({1})
 since_version_detailed.short={0} ({1})
 since_previous_version=since previous version
 since_previous_version.short=\u0394 version
-since_previous_version_detailed=since previous version ({0})
+since_previous_version_detailed=since previous version ({0} - {1})
 since_previous_version_detailed.short=\u0394 version ({0})
 time_changes=Time changes
 
index bf1990b46155c4bf5ccf8ce844f9ac909a11e29d..a4286611e65f78bfb8e9cb24f0306222ac195069 100644 (file)
@@ -1,16 +1,42 @@
 <dataset>
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+  <snapshots purge_status="[null]"
+             period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+             period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+             period3_mode="[null]" period3_param="[null]" period3_date="[null]"
+             period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+             period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              id="100" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
              status="P" islast="false" depth="0" />
 
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+  <snapshots purge_status="[null]"
+             period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+             period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+             period3_mode="[null]" period3_param="[null]" period3_date="[null]"
+             period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+             period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              id="200" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-12-15 13:58:00.00" build_date="2008-12-15 13:58:00.00" version="[null]" path=""
              status="P" islast="false" depth="0" />
 
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+  <!-- Snapshot of previous version -->
+  <snapshots purge_status="[null]"
+             period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+             period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+             period3_mode="[null]" period3_param="[null]" period3_date="[null]"
+             period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+             period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+             id="300" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
+             scope="PRJ" qualifier="TRK" created_at="2008-12-13 13:58:00.00" build_date="2008-12-13 13:58:00.00" version="1.2.3" path=""
+             status="P" islast="false" depth="0" />
+
+  <snapshots purge_status="[null]"
+             period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+             period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+             period3_mode="[null]" period3_param="[null]" period3_date="[null]"
+             period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+             period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              id="1000" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2009-02-25 13:58:00.00" build_date="2009-02-25 13:58:00.00" version="[null]" path=""
              status="P" islast="false" depth="0" />
-</dataset>
\ No newline at end of file
+</dataset>
index 784bfad7eee69f4e9c5064ee0198408921d800cc..63545d72ec0e12cc30c21f9b8d9d2e3306996671 100644 (file)
@@ -1,16 +1,42 @@
 <dataset>
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+  <snapshots purge_status="[null]"
+             period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+             period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+             period3_mode="[null]" period3_param="[null]" period3_date="[null]"
+             period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+             period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              id="100" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
              status="P" islast="false" depth="0" />
 
-  <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+  <snapshots purge_status="[null]"
+             period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+             period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+             period3_mode="[null]" period3_param="[null]" period3_date="[null]"
+             period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+             period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              id="200" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-12-15 13:58:00.00" build_date="2008-12-15 13:58:00.00" version="[null]" path=""
              status="P" islast="false" depth="0" />
 
-  <snapshots purge_status="[null]" period1_mode="days" period1_param="30" period1_date="2009-01-25" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="version" period3_param="1.2.3" period3_date="2008-12-13" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+  <!-- Snapshot of previous version -->
+  <snapshots purge_status="[null]"
+             period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+             period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+             period3_mode="[null]" period3_param="[null]" period3_date="[null]"
+             period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+             period5_mode="[null]" period5_param="[null]" period5_date="[null]"
+             id="300" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
+             scope="PRJ" qualifier="TRK" created_at="2008-12-13 13:58:00.00" build_date="2008-12-13 13:58:00.00" version="1.2.3" path=""
+             status="P" islast="false" depth="0" />
+
+  <snapshots purge_status="[null]"
+             period1_mode="days" period1_param="30" period1_date="2008-11-01 13:58:00.00"
+             period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+             period3_mode="version" period3_param="1.2.3" period3_date="2008-12-13 13:58:00.0"
+             period4_mode="[null]" period4_param="[null]" period4_date="[null]"
+             period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              id="1000" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2009-02-25 13:58:00.00" build_date="2009-02-25 13:58:00.00" version="[null]" path=""
              status="P" islast="false" depth="0" />
-</dataset>
\ No newline at end of file
+</dataset>
index eb70abbbc0ecea1211c060c6bd8ba7b81355457b..51bd4d2f50f3aa27c9c35382baecacc743fa7376 100644 (file)
@@ -112,7 +112,7 @@ public class PastSnapshot {
     if (StringUtils.equals(mode, CoreProperties.TIMEMACHINE_MODE_VERSION)) {
       String label = String.format("Compare to version %s", modeParameter);
       if (getTargetDate() != null) {
-        label += String.format(" (%s)", DateUtils.formatDate(getTargetDate()));
+        label += String.format(" (%s)", DateUtils.formatDate(getDate()));
       }
       return label;
     }
index 8591a47ab8de2ce13a5dccac5ef027ab2fafd5f4..1972cdc01886ef6c3d610882633fa607e12ae4e1 100644 (file)
@@ -57,7 +57,7 @@ public class PastSnapshotTest {
 
   @Test
   public void testToStringForVersion() {
-    PastSnapshot pastSnapshot = new PastSnapshot(CoreProperties.TIMEMACHINE_MODE_VERSION, new Date()).setModeParameter("2.3");
+    PastSnapshot pastSnapshot = new PastSnapshot(CoreProperties.TIMEMACHINE_MODE_VERSION, new Date(), new Snapshot().setCreatedAt(new Date())).setModeParameter("2.3");
     assertThat(pastSnapshot.toString()).startsWith("Compare to version 2.3");
   }
 
index a41d3c55797ca1fa434cfc22df40f44807ea6444..f4f8be6d18a9ba3de41c82b97c86e95fe57c3e36 100644 (file)
@@ -22,6 +22,7 @@ package org.sonar.core.timemachine;
 import org.apache.commons.lang.StringUtils;
 import org.sonar.api.BatchExtension;
 import org.sonar.api.CoreProperties;
+import org.sonar.api.ServerComponent;
 import org.sonar.api.config.Settings;
 import org.sonar.api.database.model.Snapshot;
 import org.sonar.api.i18n.I18n;
@@ -31,7 +32,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Locale;
 
-public class Periods implements BatchExtension {
+public class Periods implements BatchExtension, ServerComponent {
 
   private final Settings settings;
   private final I18n i18n;
@@ -76,7 +77,7 @@ public class Periods implements BatchExtension {
   private String label(String mode, String param, String date, boolean shortLabel) {
     String label;
     if (CoreProperties.TIMEMACHINE_MODE_DAYS.equals(mode)) {
-      label = label("over_x_days", shortLabel, param);
+      label = label("over_x_days", shortLabel, param, date);
     } else if (CoreProperties.TIMEMACHINE_MODE_VERSION.equals(mode)) {
       label = label("since_version", shortLabel, param);
       if (date != null) {
@@ -91,6 +92,9 @@ public class Periods implements BatchExtension {
       label = label("since_previous_version", shortLabel);
       if (param != null) {
         label = label("since_previous_version_detailed", shortLabel, param);
+        if (date != null) {
+          label = label("since_previous_version_detailed", shortLabel, param, date);
+        }
       }
     } else if (CoreProperties.TIMEMACHINE_MODE_DATE.equals(mode)) {
       label = label("since_x", shortLabel, date);
index bcc23aa83aefd82305e84746bfb4752ffccb7d8d..b70b56f2719ea660d746d7ee3435a6352663ac9e 100644 (file)
@@ -21,7 +21,6 @@ package org.sonar.core.timemachine;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.mockito.Mockito;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.config.Settings;
 import org.sonar.api.database.model.Snapshot;
@@ -30,9 +29,11 @@ import org.sonar.api.i18n.I18n;
 import java.util.Date;
 import java.util.Locale;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.isNull;
+import static org.mockito.Mockito.*;
 
 public class PeriodsTest {
 
@@ -61,12 +62,13 @@ public class PeriodsTest {
 
   @Test
   public void label_of_duration_in_days() {
+    Date date = new Date();
     when(snapshot.getPeriodMode(periodIndex)).thenReturn(CoreProperties.TIMEMACHINE_MODE_DAYS);
-    when(snapshot.getPeriodDate(periodIndex)).thenReturn(new Date());
+    when(snapshot.getPeriodDate(periodIndex)).thenReturn(date);
     when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(param);
 
     periods.label(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("over_x_days"), Mockito.isNull(String.class), Mockito.eq(param));
+    verify(i18n).message(any(Locale.class), eq("over_x_days"), isNull(String.class), eq(param), anyString());
   }
 
   @Test
@@ -76,7 +78,7 @@ public class PeriodsTest {
     when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(param);
 
     periods.abbreviation(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("over_x_days.short"), Mockito.isNull(String.class), Mockito.eq(param));
+    verify(i18n).message(any(Locale.class), eq("over_x_days.short"), isNull(String.class), eq(param), anyString());
   }
 
   @Test
@@ -86,7 +88,7 @@ public class PeriodsTest {
     when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(param);
 
     periods.label(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_version_detailed"), Mockito.isNull(String.class), Mockito.eq(param), Mockito.anyString());
+    verify(i18n).message(any(Locale.class), eq("since_version_detailed"), isNull(String.class), eq(param), anyString());
   }
 
   @Test
@@ -96,7 +98,7 @@ public class PeriodsTest {
     when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(param);
 
     periods.abbreviation(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_version_detailed.short"), Mockito.isNull(String.class), Mockito.eq(param), Mockito.anyString());
+    verify(i18n).message(any(Locale.class), eq("since_version_detailed.short"), isNull(String.class), eq(param), anyString());
   }
 
   @Test
@@ -105,7 +107,7 @@ public class PeriodsTest {
     when(snapshot.getPeriodDate(periodIndex)).thenReturn(new Date());
 
     periods.label(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_analysis_detailed"), Mockito.isNull(String.class), Mockito.anyString());
+    verify(i18n).message(any(Locale.class), eq("since_previous_analysis_detailed"), isNull(String.class), anyString());
   }
 
   @Test
@@ -115,7 +117,7 @@ public class PeriodsTest {
     when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(param);
 
     periods.label(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_analysis"), Mockito.isNull(String.class));
+    verify(i18n).message(any(Locale.class), eq("since_previous_analysis"), isNull(String.class));
   }
 
   @Test
@@ -124,7 +126,7 @@ public class PeriodsTest {
     when(snapshot.getPeriodDate(periodIndex)).thenReturn(new Date());
 
     periods.abbreviation(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_analysis_detailed.short"), Mockito.isNull(String.class), Mockito.anyString());
+    verify(i18n).message(any(Locale.class), eq("since_previous_analysis_detailed.short"), isNull(String.class), anyString());
   }
 
   @Test
@@ -134,7 +136,7 @@ public class PeriodsTest {
     when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(param);
 
     periods.abbreviation(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_analysis.short"), Mockito.isNull(String.class));
+    verify(i18n).message(any(Locale.class), eq("since_previous_analysis.short"), isNull(String.class));
   }
 
   @Test
@@ -143,7 +145,17 @@ public class PeriodsTest {
     when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(param);
 
     periods.label(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_version_detailed"), Mockito.isNull(String.class), Mockito.eq(param));
+    verify(i18n).message(any(Locale.class), eq("since_previous_version_detailed"), isNull(String.class), eq(param));
+  }
+
+  @Test
+  public void label_of_previous_version_with_param_and_date() {
+    when(snapshot.getPeriodMode(periodIndex)).thenReturn(CoreProperties.TIMEMACHINE_MODE_PREVIOUS_VERSION);
+    when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(param);
+    when(snapshot.getPeriodDate(periodIndex)).thenReturn(new Date());
+
+    periods.label(snapshot, periodIndex);
+    verify(i18n).message(any(Locale.class), eq("since_previous_version_detailed"), isNull(String.class), eq(param), anyString());
   }
 
   @Test
@@ -152,7 +164,7 @@ public class PeriodsTest {
     when(snapshot.getPeriodModeParameter(periodIndex)).thenReturn(null);
 
     periods.label(snapshot, periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_version"), Mockito.isNull(String.class));
+    verify(i18n).message(any(Locale.class), eq("since_previous_version"), isNull(String.class));
   }
 
   @Test
@@ -162,7 +174,7 @@ public class PeriodsTest {
 
     periods.label(snapshot, periodIndex);
 
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_x"), Mockito.isNull(String.class), Mockito.anyString());
+    verify(i18n).message(any(Locale.class), eq("since_x"), isNull(String.class), anyString());
   }
 
   @Test(expected = IllegalArgumentException.class)
@@ -179,7 +191,7 @@ public class PeriodsTest {
     settings.setProperty(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + periodIndex, days);
 
     periods.label(periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("over_x_days"), Mockito.isNull(String.class), Mockito.eq(days));
+    verify(i18n).message(any(Locale.class), eq("over_x_days"), isNull(String.class), eq(days), anyString());
   }
 
   @Test
@@ -189,7 +201,7 @@ public class PeriodsTest {
     settings.setProperty(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + periodIndex, version);
 
     periods.label(periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_version"), Mockito.isNull(String.class), Mockito.eq(version));
+    verify(i18n).message(any(Locale.class), eq("since_version"), isNull(String.class), eq(version));
   }
 
   @Test
@@ -198,7 +210,7 @@ public class PeriodsTest {
     settings.setProperty(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + periodIndex, CoreProperties.TIMEMACHINE_MODE_PREVIOUS_ANALYSIS);
 
     periods.label(periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_analysis"), Mockito.isNull(String.class));
+    verify(i18n).message(any(Locale.class), eq("since_previous_analysis"), isNull(String.class));
   }
 
   @Test
@@ -207,7 +219,7 @@ public class PeriodsTest {
     settings.setProperty(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + periodIndex, CoreProperties.TIMEMACHINE_MODE_PREVIOUS_VERSION);
 
     periods.label(periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_version"), Mockito.isNull(String.class));
+    verify(i18n).message(any(Locale.class), eq("since_previous_version"), isNull(String.class));
   }
 
   @Test
@@ -216,7 +228,7 @@ public class PeriodsTest {
     settings.setProperty(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + periodIndex, CoreProperties.TIMEMACHINE_MODE_PREVIOUS_VERSION);
 
     periods.abbreviation(periodIndex);
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_previous_version.short"), Mockito.isNull(String.class));
+    verify(i18n).message(any(Locale.class), eq("since_previous_version.short"), isNull(String.class));
   }
 
   @Test
@@ -226,7 +238,7 @@ public class PeriodsTest {
 
     periods.label(periodIndex);
 
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_x"), Mockito.isNull(String.class), Mockito.anyString());
+    verify(i18n).message(any(Locale.class), eq("since_x"), isNull(String.class), anyString());
   }
 
   @Test
@@ -236,7 +248,7 @@ public class PeriodsTest {
 
     periods.abbreviation(periodIndex);
 
-    verify(i18n).message(Mockito.any(Locale.class), Mockito.eq("since_x.short"), Mockito.isNull(String.class), Mockito.anyString());
+    verify(i18n).message(any(Locale.class), eq("since_x.short"), isNull(String.class), anyString());
   }
 
   @Test(expected = IllegalArgumentException.class)
index 63003db912a5f2db3fd41aa58623b78338aca425..69f2810a84613af822e2cf737ef7e37baa5032d7 100644 (file)
@@ -91,7 +91,7 @@ module DashboardHelper
         label = message('added_since_version', :params => mode_param.to_s)
       elsif mode=='previous_analysis'
         if !date.nil?
-          label = message('added_since_previous_analysis_detailed', :params => date.strftime("%Y %b. %d").to_s)
+          label = message('added_since_previous_analysis_detailed', :params => date.strftime('%Y %b. %d').to_s)
         else
           label = message('added_since_previous_analysis')
         end
@@ -102,7 +102,7 @@ module DashboardHelper
           label = message('added_since_previous_version')
         end
       elsif mode=='date'
-        label = message('added_since', :params => date.strftime("%Y %b %d").to_s)
+        label = message('added_since', :params => date.strftime('%Y %b %d').to_s)
       end
       if label
         selected=(params[:period]==index.to_s ? 'selected' : '')
index e8191011adeda54f0df0df35db08c8ad83e4245d..727399245ebc34ef448a3f5ecb6ed26109db1468 100644 (file)
@@ -22,7 +22,7 @@
           <% if period_options %>
             <form method="GET" action="<%= url_for :controller => :dashboard, :action => :index, :id => @resource.id -%>" style="display: inline" class="spacer-left">
               <input type="hidden" name="did" value="<%= @dashboard.id -%>"/>
-              <%= dropdown_tag "period", period_options, {:width => '230px'}, {:id => 'select-comparison', :onchange => 'submit()'} -%>
+              <%= dropdown_tag 'period', period_options, {:width => '250px'}, {:id => 'select-comparison', :onchange => 'submit()'} -%>
             </form>
           <% end %>
         <% end %>
index fdedba0dbc62259a0b13de9a8a9326fdaa9baa68..91a40199c46294ad9edee487de624f8e6de1df32 100644 (file)
@@ -12,7 +12,7 @@
         <% period_options = period_select_option_tags(@snapshot, 'small') %>
         <% if period_options %>
           <form method="GET" action="<%= url_for :only_path=>true, :overwrite_params => {:period => nil} -%>" style="display: inline" class="spacer-left">
-            <%= dropdown_tag 'period', period_options, {:width => '230px'}, {:id => 'select-comparison', :onchange => 'submit()'} -%>
+            <%= dropdown_tag 'period', period_options, {:width => '250px'}, {:id => 'select-comparison', :onchange => 'submit()'} -%>
           </form>
       <% end %>
       <% end %>