diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-10-25 12:17:39 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-10-25 12:20:00 +0200 |
commit | 053e6b05a29382c8256d9ac22f09a7edc53c3307 (patch) | |
tree | 22d61aaace4284b276de565a51c8401e71f1f15d /sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java | |
parent | ba361714c6dbc63d1cf78976cae41b43aa21c368 (diff) | |
download | sonarqube-053e6b05a29382c8256d9ac22f09a7edc53c3307.tar.gz sonarqube-053e6b05a29382c8256d9ac22f09a7edc53c3307.zip |
SONAR-801 Events on Dashboard confused for same project dates
It is now possible to specify 'sonar.projectDate' as a standard
ISO time. (ex. "2011-10-25T10:45:42+0100")
Diffstat (limited to 'sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java b/sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java index 4d2903e1e0a..3d556413ee8 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java @@ -111,6 +111,16 @@ public class ProjectConfiguratorTest extends AbstractDbUnitTestCase { assertEquals("30012005", new SimpleDateFormat("ddMMyyyy").format(project.getAnalysisDate())); } + @Test + public void analysisTimestampCouldBeExplicitlySet() { + Settings settings = new Settings(); + settings.setProperty(CoreProperties.PROJECT_DATE_PROPERTY, "2005-01-30T08:45:10+0000"); + Project project = new Project("key"); + new ProjectConfigurator(getSession(), settings).configure(project); + + assertEquals("30012005-4510", new SimpleDateFormat("ddMMyyyy-mmss").format(project.getAnalysisDate())); + } + @Test(expected = RuntimeException.class) public void failIfAnalyisDateIsNotValid() { Settings configuration = new Settings(); |