diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-01-03 16:47:08 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-01-03 16:47:08 +0100 |
commit | 8e2428ab161d64964e65e434ac785222a0163bc9 (patch) | |
tree | 87eb4e1b19aa64d0d437939841119798a1f3381a /sonar-core/src | |
parent | a8764f00653fbbf72dfe83db3f310c06bfc5829f (diff) | |
download | sonarqube-8e2428ab161d64964e65e434ac785222a0163bc9.tar.gz sonarqube-8e2428ab161d64964e65e434ac785222a0163bc9.zip |
SONAR-4776 Fix new technical debt calculation by using project analysis date in changelog instead of technical date
Diffstat (limited to 'sonar-core/src')
24 files changed, 89 insertions, 37 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/IssueUpdater.java b/sonar-core/src/main/java/org/sonar/core/issue/IssueUpdater.java index 6ed33ddc704..9cbd6c92045 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/IssueUpdater.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/IssueUpdater.java @@ -204,7 +204,7 @@ public class IssueUpdater implements BatchComponent, ServerComponent { WorkDayDuration oldValue = issue.technicalDebt(); if (!Objects.equal(value, oldValue)) { issue.setTechnicalDebt(value); - issue.setFieldChange(context, TECHNICAL_DEBT, oldValue != null ? oldValue.toLong() : oldValue, value != null ? value.toLong() : null); + issue.setFieldChange(context, TECHNICAL_DEBT, oldValue != null ? oldValue.toLong() : null, value != null ? value.toLong() : null); issue.setUpdateDate(context.date()); issue.setChanged(true); return true; diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueChangeDto.java b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueChangeDto.java index 646fb02b330..d57efd142fc 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueChangeDto.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueChangeDto.java @@ -44,9 +44,14 @@ public final class IssueChangeDto implements Serializable { private String userLogin; private String changeType; private String changeData; + + // technical dates private Date createdAt; private Date updatedAt; + // functional date + private Date issueChangeCreationDate; + public Long getId() { return id; } @@ -120,6 +125,15 @@ public final class IssueChangeDto implements Serializable { return this; } + public Date getIssueChangeCreationDate() { + return issueChangeCreationDate; + } + + public IssueChangeDto setIssueChangeCreationDate(Date issueChangeCreationDate) { + this.issueChangeCreationDate = issueChangeCreationDate; + return this; + } + @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); @@ -131,6 +145,7 @@ public final class IssueChangeDto implements Serializable { dto.setChangeType(IssueChangeDto.TYPE_COMMENT); dto.setChangeData(comment.markdownText()); dto.setUserLogin(comment.userLogin()); + dto.setIssueChangeCreationDate(comment.createdAt()); return dto; } @@ -139,6 +154,7 @@ public final class IssueChangeDto implements Serializable { dto.setChangeType(IssueChangeDto.TYPE_FIELD_CHANGE); dto.setChangeData(diffs.toString()); dto.setUserLogin(diffs.userLogin()); + dto.setIssueChangeCreationDate(diffs.creationDate()); return dto; } @@ -167,8 +183,7 @@ public final class IssueChangeDto implements Serializable { public FieldDiffs toFieldDiffs() { return FieldDiffs.parse(changeData) .setUserLogin(userLogin) - .setCreatedAt(createdAt) - .setUpdatedAt(updatedAt) + .setCreationDate(issueChangeCreationDate) .setIssueKey(issueKey); } } diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueChangeMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueChangeMapper.xml index ce9cb26ce66..c17d5f04f4b 100644 --- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueChangeMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueChangeMapper.xml @@ -12,12 +12,13 @@ c.change_type as changeType, c.change_data as changeData, c.created_at as createdAt, - c.updated_at as updatedAt + c.updated_at as updatedAt, + c.issue_change_creation_date as issueChangeCreationDate </sql> <insert id="insert" parameterType="IssueChange" useGeneratedKeys="false" keyProperty="id"> - INSERT INTO issue_changes (kee, issue_key, user_login, change_type, change_data, created_at, updated_at) - VALUES (#{kee}, #{issueKey}, #{userLogin}, #{changeType}, #{changeData}, #{createdAt}, #{updatedAt}) + INSERT INTO issue_changes (kee, issue_key, user_login, change_type, change_data, created_at, updated_at, issue_change_creation_date) + VALUES (#{kee}, #{issueKey}, #{userLogin}, #{changeType}, #{changeData}, #{createdAt}, #{updatedAt}, #{issueChangeCreationDate}) </insert> <delete id="delete" parameterType="string"> @@ -49,7 +50,7 @@ and c.change_type=#{changeType} and i.status <> 'CLOSED' </where> - order by c.created_at asc + order by c.issue_change_creation_date asc </select> <select id="selectByKeyAndType" parameterType="map" resultType="IssueChange"> diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql index e0ce7afbee1..9736e8a4bfd 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql @@ -190,6 +190,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('463'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('464'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('465'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('466'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('467'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('480'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('481'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('482'); diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl index 1ef71efa658..cef8abb9bf6 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl @@ -499,6 +499,7 @@ CREATE TABLE "ISSUE_CHANGES" ( "CHANGE_DATA" VARCHAR(16777215), "CREATED_AT" TIMESTAMP, "UPDATED_AT" TIMESTAMP, + "ISSUE_CHANGE_CREATION_DATE" TIMESTAMP, ); CREATE TABLE "ISSUE_FILTERS" ( diff --git a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDaoTest.java b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDaoTest.java index 7ab6b396071..31ed53f11bf 100644 --- a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDaoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDaoTest.java @@ -137,8 +137,8 @@ public class IssueChangeDaoTest extends AbstractDaoTestCase { } @Test - public void select_issue_changelog_by_module_should_be_sorted_by_created_date() { - setupData("select_issue_changelog_by_module_are_sorted_by_created_date"); + public void select_issue_changelog_by_module_should_be_sorted_by_creation_date() { + setupData("select_issue_changelog_by_module_are_sorted_by_creation_date"); DefaultResultHandler handler = new DefaultResultHandler(); dao.selectChangelogOnNonClosedIssuesByModuleAndType(399, handler); diff --git a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDtoTest.java b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDtoTest.java index 036db2a7cfe..5b9ba0c15cb 100644 --- a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDtoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDtoTest.java @@ -22,6 +22,7 @@ package org.sonar.core.issue.db; import org.junit.Test; import org.sonar.api.issue.internal.DefaultIssueComment; import org.sonar.api.issue.internal.FieldDiffs; +import org.sonar.api.utils.DateUtils; import static org.fest.assertions.Assertions.assertThat; @@ -45,6 +46,7 @@ public class IssueChangeDtoTest { FieldDiffs diffs = new FieldDiffs(); diffs.setDiff("severity", "INFO", "BLOCKER"); diffs.setUserLogin("emmerik"); + diffs.setCreationDate(DateUtils.parseDate("2014-01-03")); IssueChangeDto dto = IssueChangeDto.of("ABCDE", diffs); @@ -52,6 +54,7 @@ public class IssueChangeDtoTest { assertThat(dto.getChangeType()).isEqualTo("diff"); assertThat(dto.getCreatedAt()).isNotNull(); assertThat(dto.getUpdatedAt()).isNotNull(); + assertThat(dto.getIssueChangeCreationDate()).isEqualTo(DateUtils.parseDate("2014-01-03")); assertThat(dto.getIssueKey()).isEqualTo("ABCDE"); assertThat(dto.getUserLogin()).isEqualTo("emmerik"); } diff --git a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeMapperTest.java b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeMapperTest.java index 5a38ae37236..609fe26719f 100644 --- a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeMapperTest.java +++ b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeMapperTest.java @@ -55,6 +55,7 @@ public class IssueChangeMapperTest extends AbstractDaoTestCase { Date d = DateUtils.parseDate("2013-05-18"); dto.setCreatedAt(d); dto.setUpdatedAt(d); + dto.setIssueChangeCreationDate(d); mapper.insert(dto); session.commit(); diff --git a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueStorageTest.java b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueStorageTest.java index d79500de476..1c6281c837a 100644 --- a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueStorageTest.java +++ b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueStorageTest.java @@ -67,7 +67,7 @@ public class IssueStorageTest extends AbstractDaoTestCase { saver.save(issue); - checkTables("should_insert_new_issues", new String[]{"id", "created_at", "updated_at"}, "issues", "issue_changes"); + checkTables("should_insert_new_issues", new String[]{"id", "created_at", "updated_at", "issue_change_creation_date"}, "issues", "issue_changes"); } @Test @@ -109,7 +109,7 @@ public class IssueStorageTest extends AbstractDaoTestCase { saver.save(issue); - checkTables("should_update_issues", new String[]{"id", "created_at", "updated_at"}, "issues", "issue_changes"); + checkTables("should_update_issues", new String[]{"id", "created_at", "updated_at", "issue_change_creation_date"}, "issues", "issue_changes"); } @Test @@ -144,7 +144,7 @@ public class IssueStorageTest extends AbstractDaoTestCase { saver.save(issue); - checkTables("should_resolve_conflicts_on_updates", new String[]{"id", "created_at", "updated_at"}, "issues"); + checkTables("should_resolve_conflicts_on_updates", new String[]{"id", "created_at", "updated_at", "issue_change_creation_date"}, "issues"); } static class FakeSaver extends IssueStorage { diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete-result.xml index 38915608de0..43980b2e35e 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete-result.xml @@ -9,6 +9,7 @@ change_data="old comment" created_at="2013-01-01" updated_at="2013-01-01" + issue_change_creation_date="[null]" /> <issue_changes @@ -20,6 +21,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-02-02" updated_at="2013-02-02" + issue_change_creation_date="2013-02-02" /> <!-- @@ -34,6 +36,7 @@ change_data="recent comment" created_at="2013-05-05" updated_at="2013-05-05" + issue_change_creation_date="2013-05-05" /> --> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete.xml index 91b53b495ee..ffc07f03686 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete.xml @@ -9,6 +9,7 @@ change_data="old comment" created_at="2013-01-01" updated_at="2013-01-01" + issue_change_creation_date="[null]" /> <issue_changes @@ -20,6 +21,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-02-02" updated_at="2013-02-02" + issue_change_creation_date="2013-02-02" /> <issue_changes @@ -31,5 +33,6 @@ change_data="recent comment" created_at="2013-05-05" updated_at="2013-05-05" + issue_change_creation_date="2013-05-05" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module.xml index 85d5f5b37db..205133a30f7 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module.xml @@ -40,6 +40,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-04-16" updated_at="2013-04-16" + issue_change_creation_date="2013-04-16" /> <issue_changes @@ -51,6 +52,7 @@ change_data="actionPlan=1.0|1.1" created_at="2013-04-16" updated_at="2013-04-16" + issue_change_creation_date="2013-04-16" /> <issue_changes @@ -62,6 +64,7 @@ change_data="recent comment" created_at="2013-04-16" updated_at="2013-04-16" + issue_change_creation_date="[null]" /> <!-- Open Issue on a file --> @@ -99,6 +102,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-04-16" updated_at="2013-04-16" + issue_change_creation_date="2013-04-16" /> <!-- Closed Issue on a file --> @@ -136,6 +140,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-04-16" updated_at="2013-04-16" + issue_change_creation_date="2013-04-16" /> <!-- Open Issue on a sub module --> @@ -173,6 +178,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-04-16" updated_at="2013-04-16" + issue_change_creation_date="2013-04-16" /> <!-- Open Issue on a root module --> @@ -210,6 +216,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-04-16" updated_at="2013-04-16" + issue_change_creation_date="2013-04-16" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module_are_sorted_by_created_date.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module_are_sorted_by_creation_date.xml index 11ad40bcd2f..330555cd7fd 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module_are_sorted_by_created_date.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module_are_sorted_by_creation_date.xml @@ -37,6 +37,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-04-18" updated_at="2013-04-18" + issue_change_creation_date="2013-04-18" /> <issue_changes @@ -48,6 +49,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-04-16" updated_at="2013-04-16" + issue_change_creation_date="2013-04-16" /> <issue_changes @@ -59,6 +61,7 @@ change_data="actionPlan=1.0|1.1" created_at="2013-04-17" updated_at="2013-04-17" + issue_change_creation_date="2013-04-17" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/shared.xml index 6f960b43d3c..48f09145b63 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/shared.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/shared.xml @@ -9,6 +9,7 @@ change_data="old comment" created_at="2013-01-01" updated_at="2013-01-01" + issue_change_creation_date="[null]" /> <issue_changes @@ -20,6 +21,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-02-02" updated_at="2013-02-02" + issue_change_creation_date="2013-02-02" /> <issue_changes @@ -31,6 +33,7 @@ change_data="recent comment" created_at="2013-05-05" updated_at="2013-05-05" + issue_change_creation_date="[null]" /> <issue_changes @@ -42,6 +45,7 @@ change_data="actionPlan=1.0|1.1" created_at="2013-02-02" updated_at="2013-02-02" + issue_change_creation_date="2013-02-02" /> <issue_changes @@ -53,6 +57,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-02-01" updated_at="2013-02-01" + issue_change_creation_date="2013-02-01" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update-result.xml index 02577e213df..31a5056c859 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update-result.xml @@ -9,6 +9,7 @@ change_data="old comment" created_at="2013-01-01" updated_at="2013-01-01" + issue_change_creation_date="[null]" /> <issue_changes @@ -20,6 +21,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-02-02" updated_at="2013-02-02" + issue_change_creation_date="2013-02-02" /> <issue_changes @@ -31,5 +33,6 @@ change_data="new comment" created_at="2013-05-05" updated_at="2013-06-30" + issue_change_creation_date="[null]" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update.xml index f7dfdc84832..94e2ec53877 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update.xml @@ -9,6 +9,7 @@ change_data="old comment" created_at="2013-01-01" updated_at="2013-01-01" + issue_change_creation_date="[null]" /> <issue_changes @@ -20,6 +21,7 @@ change_data="severity=MAJOR|BLOCKER" created_at="2013-02-02" updated_at="2013-02-02" + issue_change_creation_date="2013-02-02" /> <issue_changes @@ -31,5 +33,6 @@ change_data="old value" created_at="2013-05-05" updated_at="2013-05-05" + issue_change_creation_date="[null]" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_comment-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_comment-result.xml index c1f10296b62..67122e49373 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_comment-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_comment-result.xml @@ -8,5 +8,6 @@ change_data="the comment" created_at="2013-05-18" updated_at="2013-05-18" + issue_change_creation_date="[null]" /> -</dataset>
\ No newline at end of file +</dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_diff-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_diff-result.xml index 4d7045179e9..164a9d22dd4 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_diff-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_diff-result.xml @@ -8,5 +8,6 @@ change_data="severity=INFO|BLOCKER" created_at="2013-05-18" updated_at="2013-05-18" + issue_change_creation_date="2013-05-18" /> -</dataset>
\ No newline at end of file +</dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_insert_new_issues-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_insert_new_issues-result.xml index 7d211f38c01..59d288be419 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_insert_new_issues-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_insert_new_issues-result.xml @@ -20,6 +20,7 @@ issue_close_date="2013-05-18" /> - <issue_changes id="1" kee="FGHIJ" issue_key="ABCDE" change_type="comment" user_login="emmerik" change_data="the comment" created_at="[null]" updated_at="[null]" /> + <issue_changes id="1" kee="FGHIJ" issue_key="ABCDE" change_type="comment" user_login="emmerik" change_data="the comment" + created_at="[null]" updated_at="[null]" issue_change_creation_date="[null]" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues-result.xml index d3b9baa9d07..82db8eecb31 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues-result.xml @@ -26,7 +26,7 @@ /> <issue_changes id="1" kee="FGHIJ" issue_key="ABCDE" change_type="comment" user_login="emmerik" - change_data="the comment" created_at="[null]" updated_at="[null]"/> + change_data="the comment" created_at="[null]" updated_at="[null]" issue_change_creation_date="[null]"/> <issue_changes id="2" kee="[null]" issue_key="ABCDE" change_type="diff" user_login="emmerik" - change_data="severity=INFO|BLOCKER" created_at="[null]" updated_at="[null]"/> + change_data="severity=INFO|BLOCKER" created_at="[null]" updated_at="[null]" issue_change_creation_date="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml index 43ff5c4d598..9eb87fb10c9 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml @@ -20,7 +20,7 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <issues id="2" kee="ISSUE-2" component_id="1" @@ -30,7 +30,7 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> --> <!-- old open issues --> @@ -42,7 +42,7 @@ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <!-- recent open and closed issues --> <issues id="4" kee="ISSUE-4" @@ -53,7 +53,7 @@ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <!-- <issues id="5" kee="ISSUE-5" @@ -64,6 +64,6 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> --> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues.xml index 2bb55c7d6c4..c725ed53d9c 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues.xml @@ -14,7 +14,7 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <issues id="2" kee="ISSUE-2" component_id="1" @@ -24,7 +24,7 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <!-- old open issues --> @@ -36,7 +36,7 @@ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <!-- recent open and closed issues --> <issues id="4" kee="ISSUE-4" @@ -47,7 +47,7 @@ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <issues id="5" kee="ISSUE-5" component_id="100" @@ -57,6 +57,6 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml index 65bd0a71c55..775d6c17fe6 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml @@ -15,7 +15,7 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <issues id="2" kee="ISSUE-2" component_id="1" @@ -25,7 +25,7 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> --> <!-- old open issues -> do not purge --> @@ -37,7 +37,7 @@ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <!-- recent open and closed issues -> do not purge --> <issues id="4" kee="ISSUE-4" @@ -48,7 +48,7 @@ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <issues id="5" kee="ISSUE-5" component_id="100" @@ -58,6 +58,6 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues.xml index 127261b47f3..083dd7af08f 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues.xml @@ -14,7 +14,7 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <issues id="2" kee="ISSUE-2" component_id="1" @@ -24,7 +24,7 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <!-- old open issues -> do not purge --> @@ -36,7 +36,7 @@ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <!-- recent open and closed issues -> do not purge --> <issues id="4" kee="ISSUE-4" @@ -47,7 +47,7 @@ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> <issues id="5" kee="ISSUE-5" component_id="100" @@ -57,6 +57,6 @@ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="2013-04-16"/> - <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc"/> + <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/> </dataset> |