diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-02-04 09:24:23 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-02-09 15:16:29 +0100 |
commit | 5879a094d888e93a7ee4cbe4ed9d4c0ce0c23ac0 (patch) | |
tree | f87417dac02f40dec9261bec3c1b4bfd189ac984 /sonar-core | |
parent | 2e0239d5170db953f631fa4a443b2025f8d3fe5b (diff) | |
download | sonarqube-5879a094d888e93a7ee4cbe4ed9d4c0ce0c23ac0.tar.gz sonarqube-5879a094d888e93a7ee4cbe4ed9d4c0ce0c23ac0.zip |
SONAR-5183 timezones - migrate issues table from timestamp to long
Diffstat (limited to 'sonar-core')
38 files changed, 481 insertions, 429 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/BatchIssueDto.java b/sonar-core/src/main/java/org/sonar/core/issue/db/BatchIssueDto.java index 4bdb30e5e82..85ee2e47bcb 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/db/BatchIssueDto.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/db/BatchIssueDto.java @@ -20,8 +20,14 @@ package org.sonar.core.issue.db; +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; + import java.util.Date; +import static org.sonar.api.utils.DateUtils.dateToLong; +import static org.sonar.api.utils.DateUtils.longToDate; + public class BatchIssueDto { private String kee; @@ -36,7 +42,7 @@ public class BatchIssueDto { private String componentKey; private String ruleKey; private String ruleRepo; - private Date creationDate; + private Long creationDate; public String getAssigneeLogin() { return assigneeLogin; @@ -146,12 +152,22 @@ public class BatchIssueDto { return this; } + @CheckForNull public Date getCreationDate() { + return longToDate(creationDate); + } + + public BatchIssueDto setCreationDate(@Nullable Date creationDate) { + this.creationDate = dateToLong(creationDate); + return this; + } + + public Long getCreationTime() { return creationDate; } - public BatchIssueDto setCreationDate(Date creationDate) { - this.creationDate = creationDate; + public BatchIssueDto setCreationTime(Long time) { + this.creationDate = time; return this; } } diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDao.java b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDao.java index 7363ea8426f..240650e9d21 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDao.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDao.java @@ -30,10 +30,11 @@ import org.sonar.core.rule.RuleDto; import javax.annotation.CheckForNull; import javax.annotation.Nullable; - import java.util.Date; import java.util.List; +import static org.sonar.api.utils.DateUtils.dateToLong; + /** * @since 3.6 */ @@ -67,12 +68,12 @@ public class IssueDao implements BatchComponent, ServerComponent { // TODO replace by aggregation in IssueIndex public List<RuleDto> findRulesByComponent(String componentKey, @Nullable Date createdAtOrAfter, DbSession session) { - return mapper(session).findRulesByComponent(componentKey, createdAtOrAfter); + return mapper(session).findRulesByComponent(componentKey, dateToLong(createdAtOrAfter)); } // TODO replace by aggregation in IssueIndex public List<String> findSeveritiesByComponent(String componentKey, @Nullable Date createdAtOrAfter, DbSession session) { - return mapper(session).findSeveritiesByComponent(componentKey, createdAtOrAfter); + return mapper(session).findSeveritiesByComponent(componentKey, dateToLong(createdAtOrAfter)); } protected IssueMapper mapper(DbSession session) { diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java index d683a64cc11..9b726f4b4e3 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java @@ -37,10 +37,14 @@ import org.sonar.core.rule.RuleDto; import javax.annotation.CheckForNull; import javax.annotation.Nullable; + import java.io.Serializable; import java.util.Collection; import java.util.Date; +import static org.sonar.api.utils.DateUtils.dateToLong; +import static org.sonar.api.utils.DateUtils.longToDate; + /** * @since 3.6 */ @@ -72,10 +76,10 @@ public final class IssueDto implements Serializable { private long createdAt; private long updatedAt; - // functional dates - private Date issueCreationDate; - private Date issueUpdateDate; - private Date issueCloseDate; + // functional dates stored as Long + private Long issueCreationDate; + private Long issueUpdateDate; + private Long issueCloseDate; /** * Temporary date used only during scan @@ -93,6 +97,97 @@ public final class IssueDto implements Serializable { private String filePath; private String tags; + /** + * On batch side, component keys and uuid are useless + */ + public static IssueDto toDtoForComputationInsert(DefaultIssue issue, int ruleId, long now) { + return new IssueDto() + .setKee(issue.key()) + .setLine(issue.line()) + .setMessage(issue.message()) + .setEffortToFix(issue.effortToFix()) + .setDebt(issue.debtInMinutes()) + .setResolution(issue.resolution()) + .setStatus(issue.status()) + .setSeverity(issue.severity()) + .setManualSeverity(issue.manualSeverity()) + .setChecksum(issue.checksum()) + .setReporter(issue.reporter()) + .setAssignee(issue.assignee()) + .setRuleId(ruleId) + .setRuleKey(issue.ruleKey().repository(), issue.ruleKey().rule()) + .setTags(issue.tags()) + .setComponentUuid(issue.componentUuid()) + .setComponentKey(issue.componentKey()) + .setModuleUuid(issue.moduleUuid()) + .setModuleUuidPath(issue.moduleUuidPath()) + .setComponentUuid(issue.componentUuid()) + .setProjectUuid(issue.projectUuid()) + .setProjectKey(issue.projectKey()) + .setActionPlanKey(issue.actionPlanKey()) + .setIssueAttributes(KeyValueFormat.format(issue.attributes())) + .setAuthorLogin(issue.authorLogin()) + .setIssueCreationDate(issue.creationDate()) + .setIssueCloseDate(issue.closeDate()) + .setIssueUpdateDate(issue.updateDate()) + .setSelectedAt(issue.selectedAt()) + + // technical dates + .setCreatedAt(now) + .setUpdatedAt(now); + } + + /** + * On server side, we need component keys and uuid + */ + public static IssueDto toDtoForServerInsert(DefaultIssue issue, ComponentDto component, ComponentDto project, int ruleId, long now) { + return toDtoForComputationInsert(issue, ruleId, now) + .setComponent(component) + .setProject(project); + } + + public static IssueDto toDtoForUpdate(DefaultIssue issue, long now) { + // Invariant fields, like key and rule, can't be updated + return new IssueDto() + .setKee(issue.key()) + .setLine(issue.line()) + .setMessage(issue.message()) + .setEffortToFix(issue.effortToFix()) + .setDebt(issue.debtInMinutes()) + .setResolution(issue.resolution()) + .setStatus(issue.status()) + .setSeverity(issue.severity()) + .setChecksum(issue.checksum()) + .setManualSeverity(issue.manualSeverity()) + .setReporter(issue.reporter()) + .setAssignee(issue.assignee()) + .setActionPlanKey(issue.actionPlanKey()) + .setIssueAttributes(KeyValueFormat.format(issue.attributes())) + .setAuthorLogin(issue.authorLogin()) + .setRuleKey(issue.ruleKey().repository(), issue.ruleKey().rule()) + .setTags(issue.tags()) + .setComponentUuid(issue.componentUuid()) + .setComponentKey(issue.componentKey()) + .setModuleUuid(issue.moduleUuid()) + .setModuleUuidPath(issue.moduleUuidPath()) + .setProjectUuid(issue.projectUuid()) + .setProjectKey(issue.projectKey()) + .setIssueCreationDate(issue.creationDate()) + .setIssueCloseDate(issue.closeDate()) + .setIssueUpdateDate(issue.updateDate()) + .setSelectedAt(issue.selectedAt()) + + // technical date + .setUpdatedAt(now); + } + + public static IssueDto createFor(Project project, RuleDto rule) { + return new IssueDto() + .setProjectUuid(project.getUuid()) + .setRuleId(rule.getId()) + .setKee(Uuids.create()); + } + public String getKey() { return getKee(); } @@ -134,15 +229,6 @@ public final class IssueDto implements Serializable { return ruleId; } - public IssueDto setRule(RuleDto rule) { - Preconditions.checkNotNull(rule.getId(), "Rule must be persisted."); - this.ruleId = rule.getId(); - this.ruleKey = rule.getRuleKey(); - this.ruleRepo = rule.getRepositoryKey(); - this.language = rule.getLanguage(); - return this; - } - /** * please use setRule(RuleDto rule) */ @@ -288,129 +374,107 @@ public final class IssueDto implements Serializable { return this; } + /** + * Technical date + */ public long getCreatedAt() { return createdAt; } - /** - * Technical date - */ public IssueDto setCreatedAt(long createdAt) { this.createdAt = createdAt; return this; } + /** + * Technical date + */ public long getUpdatedAt() { return updatedAt; } - /** - * Technical date - */ public IssueDto setUpdatedAt(long updatedAt) { this.updatedAt = updatedAt; return this; } - public Date getIssueCreationDate() { + public Long getIssueCreationTime() { return issueCreationDate; } - public IssueDto setIssueCreationDate(@Nullable Date d) { - this.issueCreationDate = d; + public IssueDto setIssueCreationTime(Long time) { + this.issueCreationDate = time; return this; } - public Date getIssueUpdateDate() { - return issueUpdateDate; + public Date getIssueCreationDate() { + return longToDate(issueCreationDate); } - public IssueDto setIssueUpdateDate(@Nullable Date d) { - this.issueUpdateDate = d; + public IssueDto setIssueCreationDate(@Nullable Date d) { + this.issueCreationDate = dateToLong(d); return this; } - public Date getIssueCloseDate() { - return issueCloseDate; + public Long getIssueUpdateTime() { + return issueUpdateDate; } - public IssueDto setIssueCloseDate(@Nullable Date d) { - this.issueCloseDate = d; + public IssueDto setIssueUpdateTime(Long time) { + this.issueUpdateDate = time; return this; } - public String getRule() { - return ruleKey; - } - - public String getRuleRepo() { - return ruleRepo; - } - - public RuleKey getRuleKey() { - return RuleKey.of(ruleRepo, ruleKey); + public Date getIssueUpdateDate() { + return longToDate(issueUpdateDate); } - public String getLanguage() { - return language; + public IssueDto setIssueUpdateDate(@Nullable Date d) { + this.issueUpdateDate = dateToLong(d); + return this; } - public String getComponentKey() { - return componentKey; + public Long getIssueCloseTime() { + return issueCloseDate; } - /** - * Can be null on Views or Devs - */ - @CheckForNull - public String getComponentUuid() { - return componentUuid; + public IssueDto setIssueCloseTime(Long time) { + this.issueCloseDate = time; + return this; } - @CheckForNull - public String getModuleUuid() { - return moduleUuid; + public Date getIssueCloseDate() { + return longToDate(issueCloseDate); } - @CheckForNull - public String getModuleUuidPath() { - return moduleUuidPath; + public IssueDto setIssueCloseDate(@Nullable Date d) { + this.issueCloseDate = dateToLong(d); + return this; } - /** - * Used by the issue tracking mechanism, but it should used the component uuid instead - */ - public String getProjectKey() { - return projectKey; + public String getRule() { + return ruleKey; } - /** - * Can be null on Views or Devs - */ - @CheckForNull - public String getProjectUuid() { - return projectUuid; + public IssueDto setRule(RuleDto rule) { + Preconditions.checkNotNull(rule.getId(), "Rule must be persisted."); + this.ruleId = rule.getId(); + this.ruleKey = rule.getRuleKey(); + this.ruleRepo = rule.getRepositoryKey(); + this.language = rule.getLanguage(); + return this; } - @CheckForNull - public Long getSelectedAt() { - return selectedAt; + public String getRuleRepo() { + return ruleRepo; } - public IssueDto setSelectedAt(@Nullable Long d) { - this.selectedAt = d; - return this; + public RuleKey getRuleKey() { + return RuleKey.of(ruleRepo, ruleKey); } - /** - * Should only be used to persist in E/S - * <p/> - * Please use {@link #setRule(org.sonar.core.rule.RuleDto)} instead - */ - public IssueDto setRuleKey(String repo, String rule) { - this.ruleRepo = repo; - this.ruleKey = rule; - return this; + public String getLanguage() { + return language; } /** @@ -423,6 +487,10 @@ public final class IssueDto implements Serializable { return this; } + public String getComponentKey() { + return componentKey; + } + /** * Should only be used to persist in E/S * <p/> @@ -434,6 +502,14 @@ public final class IssueDto implements Serializable { } /** + * Can be null on Views or Devs + */ + @CheckForNull + public String getComponentUuid() { + return componentUuid; + } + + /** * Should only be used to persist in E/S * <p/> * Please use {@link #setComponent(org.sonar.core.component.ComponentDto)} instead @@ -443,6 +519,11 @@ public final class IssueDto implements Serializable { return this; } + @CheckForNull + public String getModuleUuid() { + return moduleUuid; + } + /** * Should only be used to persist in E/S * <p/> @@ -453,6 +534,11 @@ public final class IssueDto implements Serializable { return this; } + @CheckForNull + public String getModuleUuidPath() { + return moduleUuidPath; + } + /** * Should only be used to persist in E/S * <p/> @@ -464,6 +550,13 @@ public final class IssueDto implements Serializable { } /** + * Used by the issue tracking mechanism, but it should used the component uuid instead + */ + public String getProjectKey() { + return projectKey; + } + + /** * Should only be used to persist in E/S * <p/> * Please use {@link #setProject(org.sonar.core.component.ComponentDto)} instead @@ -474,6 +567,14 @@ public final class IssueDto implements Serializable { } /** + * Can be null on Views or Devs + */ + @CheckForNull + public String getProjectUuid() { + return projectUuid; + } + + /** * Should only be used to persist in E/S * <p/> * Please use {@link #setProject(org.sonar.core.component.ComponentDto)} instead @@ -483,6 +584,27 @@ public final class IssueDto implements Serializable { return this; } + @CheckForNull + public Long getSelectedAt() { + return selectedAt; + } + + public IssueDto setSelectedAt(@Nullable Long d) { + this.selectedAt = d; + return this; + } + + /** + * Should only be used to persist in E/S + * <p/> + * Please use {@link #setRule(org.sonar.core.rule.RuleDto)} instead + */ + public IssueDto setRuleKey(String repo, String rule) { + this.ruleRepo = repo; + this.ruleKey = rule; + return this; + } + /** * Should only be used to persist in E/S * <p/> @@ -529,90 +651,6 @@ public final class IssueDto implements Serializable { return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); } - /** - * On batch side, component keys and uuid are useless - */ - public static IssueDto toDtoForComputationInsert(DefaultIssue issue, int ruleId, long now) { - return new IssueDto() - .setKee(issue.key()) - .setLine(issue.line()) - .setMessage(issue.message()) - .setEffortToFix(issue.effortToFix()) - .setDebt(issue.debtInMinutes()) - .setResolution(issue.resolution()) - .setStatus(issue.status()) - .setSeverity(issue.severity()) - .setManualSeverity(issue.manualSeverity()) - .setChecksum(issue.checksum()) - .setReporter(issue.reporter()) - .setAssignee(issue.assignee()) - .setRuleId(ruleId) - .setRuleKey(issue.ruleKey().repository(), issue.ruleKey().rule()) - .setTags(issue.tags()) - .setComponentUuid(issue.componentUuid()) - .setComponentKey(issue.componentKey()) - .setModuleUuid(issue.moduleUuid()) - .setModuleUuidPath(issue.moduleUuidPath()) - .setComponentUuid(issue.componentUuid()) - .setProjectUuid(issue.projectUuid()) - .setProjectKey(issue.projectKey()) - .setActionPlanKey(issue.actionPlanKey()) - .setIssueAttributes(KeyValueFormat.format(issue.attributes())) - .setAuthorLogin(issue.authorLogin()) - .setIssueCreationDate(issue.creationDate()) - .setIssueCloseDate(issue.closeDate()) - .setIssueUpdateDate(issue.updateDate()) - .setSelectedAt(issue.selectedAt()) - - // technical dates - .setCreatedAt(now) - .setUpdatedAt(now); - } - - /** - * On server side, we need component keys and uuid - */ - public static IssueDto toDtoForServerInsert(DefaultIssue issue, ComponentDto component, ComponentDto project, int ruleId, long now) { - return toDtoForComputationInsert(issue, ruleId, now) - .setComponent(component) - .setProject(project); - } - - public static IssueDto toDtoForUpdate(DefaultIssue issue, long now) { - // Invariant fields, like key and rule, can't be updated - return new IssueDto() - .setKee(issue.key()) - .setLine(issue.line()) - .setMessage(issue.message()) - .setEffortToFix(issue.effortToFix()) - .setDebt(issue.debtInMinutes()) - .setResolution(issue.resolution()) - .setStatus(issue.status()) - .setSeverity(issue.severity()) - .setChecksum(issue.checksum()) - .setManualSeverity(issue.manualSeverity()) - .setReporter(issue.reporter()) - .setAssignee(issue.assignee()) - .setActionPlanKey(issue.actionPlanKey()) - .setIssueAttributes(KeyValueFormat.format(issue.attributes())) - .setAuthorLogin(issue.authorLogin()) - .setRuleKey(issue.ruleKey().repository(), issue.ruleKey().rule()) - .setTags(issue.tags()) - .setComponentUuid(issue.componentUuid()) - .setComponentKey(issue.componentKey()) - .setModuleUuid(issue.moduleUuid()) - .setModuleUuidPath(issue.moduleUuidPath()) - .setProjectUuid(issue.projectUuid()) - .setProjectKey(issue.projectKey()) - .setIssueCreationDate(issue.creationDate()) - .setIssueCloseDate(issue.closeDate()) - .setIssueUpdateDate(issue.updateDate()) - .setSelectedAt(issue.selectedAt()) - - // technical date - .setUpdatedAt(now); - } - public DefaultIssue toDefaultIssue() { DefaultIssue issue = new DefaultIssue(); issue.setKey(kee); @@ -639,17 +677,10 @@ public final class IssueDto implements Serializable { issue.setActionPlanKey(actionPlanKey); issue.setAuthorLogin(authorLogin); issue.setNew(false); - issue.setCreationDate(issueCreationDate); - issue.setCloseDate(issueCloseDate); - issue.setUpdateDate(issueUpdateDate); + issue.setCreationDate(longToDate(issueCreationDate)); + issue.setCloseDate(longToDate(issueCloseDate)); + issue.setUpdateDate(longToDate(issueUpdateDate)); issue.setSelectedAt(selectedAt); return issue; } - - public static IssueDto createFor(Project project, RuleDto rule) { - return new IssueDto() - .setProjectUuid(project.getUuid()) - .setRuleId(rule.getId()) - .setKee(Uuids.create()); - } } diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueMapper.java b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueMapper.java index 3d4690c2f0e..2d97a4160d7 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueMapper.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueMapper.java @@ -34,9 +34,9 @@ public interface IssueMapper { List<IssueDto> selectByActionPlan(String actionPlan); - List<RuleDto> findRulesByComponent(@Param("componentKey") String componentKey, @Nullable @Param("createdAt") Date createdAtOrAfter); + List<RuleDto> findRulesByComponent(@Param("componentKey") String componentKey, @Nullable @Param("createdAt") Long createdAtOrAfter); - List<String> findSeveritiesByComponent(@Param("componentKey") String componentKey, @Nullable @Param("createdAt") Date createdAtOrAfter); + List<String> findSeveritiesByComponent(@Param("componentKey") String componentKey, @Nullable @Param("createdAt") Long createdAtOrAfter); void insert(IssueDto issue); diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java index 6b07dd2255e..b2d44f173e4 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java @@ -33,7 +33,7 @@ import java.util.List; */ public class DatabaseVersion implements BatchComponent, ServerComponent { - public static final int LAST_VERSION = 777; + public static final int LAST_VERSION = 780; /** * List of all the tables.n diff --git a/sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java b/sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java index 65685305942..0e507c10dd6 100644 --- a/sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java +++ b/sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java @@ -37,6 +37,8 @@ import java.util.Collections; import java.util.Date; import java.util.List; +import static org.sonar.api.utils.DateUtils.dateToLong; + /** * @since 2.14 */ @@ -82,8 +84,8 @@ public class PurgeDao { private void deleteOldClosedIssues(PurgeConfiguration conf, PurgeMapper mapper) { Date toDate = conf.maxLiveDateOfClosedIssues(); - mapper.deleteOldClosedIssueChanges(conf.rootProjectIdUuid().getUuid(), toDate); - mapper.deleteOldClosedIssues(conf.rootProjectIdUuid().getUuid(), toDate); + mapper.deleteOldClosedIssueChanges(conf.rootProjectIdUuid().getUuid(), dateToLong(toDate)); + mapper.deleteOldClosedIssues(conf.rootProjectIdUuid().getUuid(), dateToLong(toDate)); } private void deleteAbortedBuilds(ResourceDto project, PurgeCommands commands) { @@ -91,7 +93,7 @@ public class PurgeDao { LOG.info("<- Delete aborted builds"); PurgeSnapshotQuery query = PurgeSnapshotQuery.create() .setIslast(false) - .setStatus(new String[]{"U"}) + .setStatus(new String[] {"U"}) .setRootProjectId(project.getId()); commands.deleteSnapshots(query); } @@ -100,7 +102,7 @@ public class PurgeDao { private boolean hasAbortedBuilds(Long projectId, PurgeCommands commands) { PurgeSnapshotQuery query = PurgeSnapshotQuery.create() .setIslast(false) - .setStatus(new String[]{"U"}) + .setStatus(new String[] {"U"}) .setResourceId(projectId); return !commands.selectSnapshotIds(query).isEmpty(); } @@ -111,7 +113,7 @@ public class PurgeDao { .setResourceId(project.getId()) .setIslast(false) .setNotPurged(true) - ); + ); for (final Long projectSnapshotId : projectSnapshotIds) { LOG.info("<- Clean snapshot " + projectSnapshotId); if (!ArrayUtils.isEmpty(scopesWithoutHistoricalData)) { @@ -195,7 +197,7 @@ public class PurgeDao { mapper.setSnapshotIsLastToFalse(componentId); mapper.deleteFileSourcesByUuid(componentIdUuid.getUuid()); mapper.disableResource(componentId); - mapper.resolveResourceIssuesNotAlreadyResolved(componentIdUuid.getUuid(), new Date(system2.now()), system2.now()); + mapper.resolveResourceIssuesNotAlreadyResolved(componentIdUuid.getUuid(), system2.now()); } public PurgeDao deleteSnapshots(PurgeSnapshotQuery query) { diff --git a/sonar-core/src/main/java/org/sonar/core/purge/PurgeMapper.java b/sonar-core/src/main/java/org/sonar/core/purge/PurgeMapper.java index c73cc86dd82..643cb15c4a9 100644 --- a/sonar-core/src/main/java/org/sonar/core/purge/PurgeMapper.java +++ b/sonar-core/src/main/java/org/sonar/core/purge/PurgeMapper.java @@ -22,7 +22,6 @@ package org.sonar.core.purge; import org.apache.ibatis.annotations.Param; import javax.annotation.Nullable; -import java.util.Date; import java.util.List; public interface PurgeMapper { @@ -59,7 +58,7 @@ public interface PurgeMapper { void disableResource(long resourceId); - void resolveResourceIssuesNotAlreadyResolved(@Param("componentUuid") String componentUuid, @Param("date") Date date, @Param("dateAsLong") Long dateAsLong); + void resolveResourceIssuesNotAlreadyResolved(@Param("componentUuid") String componentUuid, @Param("dateAsLong") Long dateAsLong); void deleteResourceIndex(@Param("resourceIds") List<Long> resourceIds); @@ -95,9 +94,9 @@ public interface PurgeMapper { void deleteComponentIssues(@Param("componentUuids") List<String> componentUuids); - void deleteOldClosedIssueChanges(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Date toDate); + void deleteOldClosedIssueChanges(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Long toDate); - void deleteOldClosedIssues(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Date toDate); + void deleteOldClosedIssues(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Long toDate); void deleteFileSourcesByProjectUuid(String rootProjectUuid); diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml index 8217084291c..a59f402fdec 100644 --- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml @@ -23,9 +23,9 @@ i.author_login as authorLogin, i.tags as tagsString, i.issue_attributes as issueAttributes, - i.issue_creation_date as issueCreationDate, - i.issue_update_date as issueUpdateDate, - i.issue_close_date as issueCloseDate, + i.issue_creation_date as issueCreationTime, + i.issue_update_date as issueUpdateTime, + i.issue_close_date as issueCloseTime, i.created_at as createdAt, i.updated_at as updatedAt, r.plugin_rule_key as ruleKey, @@ -53,13 +53,13 @@ i.assignee as assignee </when> <when test="'CREATION_DATE'.equals(query.sort())"> - i.issue_creation_date as issueCreationDate + i.issue_creation_date as issueCreationTime </when> <when test="'UPDATE_DATE'.equals(query.sort())"> - i.issue_update_date as issueUpdateDate + i.issue_update_date as issueUpdateTime </when> <when test="'CLOSE_DATE'.equals(query.sort())"> - i.issue_close_date as issueCloseDate + i.issue_close_date as issueCloseTime </when> </choose> </if> @@ -77,7 +77,7 @@ #{tagsString,jdbcType=VARCHAR}, #{resolution,jdbcType=VARCHAR}, #{checksum,jdbcType=VARCHAR}, #{reporter,jdbcType=VARCHAR}, #{assignee,jdbcType=VARCHAR}, #{authorLogin,jdbcType=VARCHAR}, #{issueAttributes,jdbcType=VARCHAR}, - #{issueCreationDate,jdbcType=TIMESTAMP},#{issueUpdateDate,jdbcType=TIMESTAMP}, #{issueCloseDate,jdbcType=TIMESTAMP}, + #{issueCreationTime,jdbcType=BIGINT},#{issueUpdateTime,jdbcType=BIGINT}, #{issueCloseTime,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{componentUuid,jdbcType=VARCHAR}, #{projectUuid,jdbcType=VARCHAR}) </insert> @@ -87,26 +87,26 @@ --> <update id="update" parameterType="Issue"> update issues set - action_plan_key=#{actionPlanKey}, - severity=#{severity}, - manual_severity=#{manualSeverity}, - message=#{message}, - line=#{line}, - effort_to_fix=#{effortToFix}, - technical_debt=#{debt}, - status=#{status}, - resolution=#{resolution}, - checksum=#{checksum}, - reporter=#{reporter}, - assignee=#{assignee}, - author_login=#{authorLogin}, - tags=#{tagsString}, - project_uuid=#{projectUuid}, - issue_attributes=#{issueAttributes}, - issue_creation_date=#{issueCreationDate}, - issue_update_date=#{issueUpdateDate}, - issue_close_date=#{issueCloseDate}, - updated_at=#{updatedAt} + action_plan_key=#{actionPlanKey,jdbcType=VARCHAR}, + severity=#{severity,jdbcType=VARCHAR}, + manual_severity=#{manualSeverity,jdbcType=BOOLEAN}, + message=#{message,jdbcType=VARCHAR}, + line=#{line,jdbcType=INTEGER}, + effort_to_fix=#{effortToFix,jdbcType=DOUBLE}, + technical_debt=#{debt,jdbcType=INTEGER}, + status=#{status,jdbcType=VARCHAR}, + resolution=#{resolution,jdbcType=VARCHAR}, + checksum=#{checksum,jdbcType=VARCHAR}, + reporter=#{reporter,jdbcType=VARCHAR}, + assignee=#{assignee,jdbcType=VARCHAR}, + author_login=#{authorLogin,jdbcType=VARCHAR}, + tags=#{tagsString,jdbcType=VARCHAR}, + project_uuid=#{projectUuid,jdbcType=VARCHAR}, + issue_attributes=#{issueAttributes,jdbcType=VARCHAR}, + issue_creation_date=#{issueCreationTime,jdbcType=BIGINT}, + issue_update_date=#{issueUpdateTime,jdbcType=BIGINT}, + issue_close_date=#{issueCloseTime,jdbcType=BIGINT}, + updated_at=#{updatedAt,jdbcType=BIGINT} where kee = #{kee} </update> @@ -115,26 +115,26 @@ --> <update id="updateIfBeforeSelectedDate" parameterType="Issue"> update issues set - action_plan_key=#{actionPlanKey}, - severity=#{severity}, - manual_severity=#{manualSeverity}, - message=#{message}, - line=#{line}, - effort_to_fix=#{effortToFix}, - technical_debt=#{debt}, - status=#{status}, - resolution=#{resolution}, - checksum=#{checksum}, - reporter=#{reporter}, - assignee=#{assignee}, - author_login=#{authorLogin}, - tags=#{tagsString}, - project_uuid=#{projectUuid}, - issue_attributes=#{issueAttributes}, - issue_creation_date=#{issueCreationDate}, - issue_update_date=#{issueUpdateDate}, - issue_close_date=#{issueCloseDate}, - updated_at=#{updatedAt} + action_plan_key=#{actionPlanKey,jdbcType=VARCHAR}, + severity=#{severity,jdbcType=VARCHAR}, + manual_severity=#{manualSeverity,jdbcType=BOOLEAN}, + message=#{message,jdbcType=VARCHAR}, + line=#{line,jdbcType=INTEGER}, + effort_to_fix=#{effortToFix,jdbcType=DOUBLE}, + technical_debt=#{debt,jdbcType=INTEGER}, + status=#{status,jdbcType=VARCHAR}, + resolution=#{resolution,jdbcType=VARCHAR}, + checksum=#{checksum,jdbcType=VARCHAR}, + reporter=#{reporter,jdbcType=VARCHAR}, + assignee=#{assignee,jdbcType=VARCHAR}, + author_login=#{authorLogin,jdbcType=VARCHAR}, + tags=#{tagsString,jdbcType=VARCHAR}, + project_uuid=#{projectUuid,jdbcType=VARCHAR}, + issue_attributes=#{issueAttributes,jdbcType=VARCHAR}, + issue_creation_date=#{issueCreationTime,jdbcType=BIGINT}, + issue_update_date=#{issueUpdateTime,jdbcType=BIGINT}, + issue_close_date=#{issueCloseTime,jdbcType=BIGINT}, + updated_at=#{updatedAt,jdbcType=BIGINT} where kee = #{kee} and updated_at <= #{selectedAt} </update> @@ -170,9 +170,9 @@ i.author_login as authorLogin, i.tags as tagsString, i.issue_attributes as issueAttributes, - i.issue_creation_date as issueCreationDate, - i.issue_update_date as issueUpdateDate, - i.issue_close_date as issueCloseDate, + i.issue_creation_date as issueCreationTime, + i.issue_update_date as issueUpdateTime, + i.issue_close_date as issueCloseTime, i.created_at as createdAt, i.updated_at as updatedAt, r.plugin_rule_key as ruleKey, @@ -198,7 +198,7 @@ i.resolution as resolution, i.checksum as checksum, i.assignee as assigneeLogin, - i.issue_creation_date as creationDate, + i.issue_creation_date as creationTime, r.plugin_rule_key as ruleKey, r.plugin_name as ruleRepo, component.kee as componentKey @@ -220,7 +220,7 @@ i.resolution as resolution, i.checksum as checksum, i.assignee as assigneeLogin, - i.issue_creation_date as creationDate, + i.issue_creation_date as creationTime, r.plugin_rule_key as ruleKey, r.plugin_name as ruleRepo, component.kee as componentKey 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 51201ffe081..92e9f0aff0c 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 @@ -305,6 +305,9 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('773'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('775'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('776'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('777'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('778'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('779'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('780'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482', null, null); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; 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 06133faa160..202f896611e 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 @@ -460,9 +460,9 @@ CREATE TABLE "ISSUES" ( "ACTION_PLAN_KEY" VARCHAR(50) NULL, "ISSUE_ATTRIBUTES" VARCHAR(4000), "TAGS" VARCHAR(4000), - "ISSUE_CREATION_DATE" TIMESTAMP, - "ISSUE_CLOSE_DATE" TIMESTAMP, - "ISSUE_UPDATE_DATE" TIMESTAMP, + "ISSUE_CREATION_DATE" BIGINT, + "ISSUE_CLOSE_DATE" BIGINT, + "ISSUE_UPDATE_DATE" BIGINT, "CREATED_AT" BIGINT, "UPDATED_AT" BIGINT ); diff --git a/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml b/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml index 2bd8f7e9aae..38d83162163 100644 --- a/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml @@ -177,8 +177,8 @@ </update> <update id="resolveResourceIssuesNotAlreadyResolved" parameterType="map"> - UPDATE issues SET status='CLOSED',resolution='REMOVED',updated_at=#{dateAsLong},issue_close_date=#{date}, - issue_update_date=#{date} + UPDATE issues SET status='CLOSED',resolution='REMOVED',updated_at=#{dateAsLong},issue_close_date=#{dateAsLong}, + issue_update_date=#{dateAsLong} WHERE component_uuid=#{componentUuid} AND resolution IS NULL </update> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/ActionPlanStatsDaoTest/should_find_by_project.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/ActionPlanStatsDaoTest/should_find_by_project.xml index e945efb6ab0..574573ee9f7 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/ActionPlanStatsDaoTest/should_find_by_project.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/ActionPlanStatsDaoTest/should_find_by_project.xml @@ -21,9 +21,9 @@ author_login="[null]" issue_attributes="JIRA=FOO-1234" action_plan_key="ABC" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> @@ -46,9 +46,9 @@ author_login="[null]" issue_attributes="JIRA=FOO-1234" action_plan_key="ABC" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> @@ -71,9 +71,9 @@ author_login="[null]" issue_attributes="JIRA=FOO-1234" action_plan_key="ABC" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> 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 6b43a944834..fd4ee9c31d0 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 @@ -24,9 +24,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -86,9 +86,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -124,9 +124,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -162,9 +162,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -200,9 +200,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module_are_sorted_by_creation_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 88ce001bcc3..b019869a390 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module_are_sorted_by_creation_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 @@ -21,9 +21,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/find_rules_by_component.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/find_rules_by_component.xml index 3b0a6b64d2b..9d97be65b71 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/find_rules_by_component.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/find_rules_by_component.xml @@ -19,9 +19,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> @@ -44,9 +44,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-17" - issue_update_date="2013-04-17" - issue_close_date="2013-04-17" + issue_creation_date="1366149600000" + issue_update_date="1366149600000" + issue_close_date="1366149600000" created_at="1400000000000" updated_at="1400000000000" /> @@ -71,9 +71,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-18" - issue_update_date="2013-04-18" - issue_close_date="2013-04-18" + issue_creation_date="1366236000000" + issue_update_date="1366236000000" + issue_close_date="1366236000000" created_at="1400000000000" updated_at="1400000000000" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/find_severities_by_component.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/find_severities_by_component.xml index 19d8d5c7105..054f2e5b877 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/find_severities_by_component.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/find_severities_by_component.xml @@ -19,9 +19,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> @@ -44,9 +44,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-17" - issue_update_date="2013-04-17" - issue_close_date="2013-04-17" + issue_creation_date="1366149600000" + issue_update_date="1366149600000" + issue_close_date="1366149600000" created_at="1400000000000" updated_at="1400000000000" /> @@ -71,9 +71,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_by_key.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_by_key.xml index 4faf9b16db0..080269cef46 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_by_key.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_by_key.xml @@ -18,9 +18,9 @@ assignee="perceval" author_login="karadoc" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_issue_and_component_ids.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_issue_and_component_ids.xml index a8a8d8eafa3..014ca75c7d5 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_issue_and_component_ids.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_issue_and_component_ids.xml @@ -19,9 +19,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> @@ -44,9 +44,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> @@ -71,9 +71,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_non_closed_issues_by_module.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_non_closed_issues_by_module.xml index 06824c52449..3a0b7ee023d 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_non_closed_issues_by_module.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_non_closed_issues_by_module.xml @@ -19,9 +19,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -45,9 +45,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -71,9 +71,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -97,9 +97,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -123,9 +123,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_non_closed_issues_by_module_on_removed_project.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_non_closed_issues_by_module_on_removed_project.xml index 53906e7d6e5..b7b17a65dd3 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_non_closed_issues_by_module_on_removed_project.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueDaoTest/should_select_non_closed_issues_by_module_on_removed_project.xml @@ -39,9 +39,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -65,9 +65,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -91,9 +91,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> @@ -117,9 +117,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testInsert-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testInsert-result.xml index 19384f8380a..bbc47e84e7f 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testInsert-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testInsert-result.xml @@ -19,9 +19,9 @@ assignee="karadoc" issue_attributes="JIRA=FOO-1234" tags="[null]" - issue_creation_date="2013-05-18" - issue_update_date="2013-05-19" - issue_close_date="2013-05-20" + issue_creation_date="1368828000000" + issue_update_date="1368914400000" + issue_close_date="1369000800000" created_at="1400000000000" updated_at="1500000000000" action_plan_key="current_sprint" diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testUpdate-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testUpdate-result.xml index 5cf1714d9bb..148d47a907b 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testUpdate-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testUpdate-result.xml @@ -19,9 +19,9 @@ assignee="karadoc" issue_attributes="JIRA=FOO-1234" tags="[null]" - issue_creation_date="2013-05-18" - issue_update_date="2013-05-19" - issue_close_date="2013-05-20" + issue_creation_date="1368828000000" + issue_update_date="1368914400000" + issue_close_date="1369000800000" created_at="1400000000000" updated_at="1500000000000" action_plan_key="current_sprint" diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStatsDaoTest/should_select_assignees.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStatsDaoTest/should_select_assignees.xml index 1fd8a9ec17b..ce76408c323 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStatsDaoTest/should_select_assignees.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStatsDaoTest/should_select_assignees.xml @@ -21,9 +21,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="2013-04-16" updated_at="2013-04-16" /> @@ -46,9 +46,9 @@ assignee="[null]" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="2013-04-16" updated_at="2013-04-16" /> @@ -71,9 +71,9 @@ assignee="perceval" author_login="[null]" issue_attributes="JIRA=FOO-1234" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="2013-04-16" updated_at="2013-04-16" /> 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 e9701caee67..a69e0a72135 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 @@ -16,9 +16,9 @@ issue_attributes="foo=bar" tags="[null]" action_plan_key="[null]" - issue_creation_date="2013-05-18" - issue_update_date="2013-05-18" - issue_close_date="2013-05-18" + issue_creation_date="1368828000000" + issue_update_date="1368828000000" + issue_close_date="1368828000000" /> <issue_changes id="1" kee="FGHIJ" issue_key="ABCDE" change_type="comment" user_login="emmerik" diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_resolve_conflicts_on_updates-result.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_resolve_conflicts_on_updates-result.xml index 9620376c137..30ba1970b6a 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_resolve_conflicts_on_updates-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_resolve_conflicts_on_updates-result.xml @@ -26,8 +26,8 @@ action_plan_key="[null]" created_at="2005-05-12" updated_at="2013-05-18" - issue_creation_date="2005-05-12 00:00:00.0" - issue_update_date="2013-05-18 00:00:00.0" + issue_creation_date="1115848800000" + issue_update_date="1368828000000" issue_close_date="[null]" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_resolve_conflicts_on_updates.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_resolve_conflicts_on_updates.xml index 0346a0a03ea..b026a0da238 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_resolve_conflicts_on_updates.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_resolve_conflicts_on_updates.xml @@ -28,8 +28,8 @@ action_plan_key="[null]" created_at="2005-05-12" updated_at="2013-05-18" - issue_creation_date="2005-05-12 00:00:00.0" - issue_update_date="2013-05-18 00:00:00.0" + issue_creation_date="1115848800000" + issue_update_date="1368828000000" issue_close_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 3cc73d72c7c..ea291ef00bc 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 @@ -21,9 +21,9 @@ issue_attributes="foo=bar" tags="[null]" action_plan_key="[null]" - issue_creation_date="2013-05-18 00:00:00.0" - issue_update_date="2013-05-18 00:00:00.0" - issue_close_date="2013-05-18 00:00:00.0" + issue_creation_date="1368828000000" + issue_update_date="1368828000000" + issue_close_date="1368828000000" /> <issue_changes id="1" kee="FGHIJ" issue_key="ABCDE" change_type="comment" user_login="emmerik" diff --git a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues.xml b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues.xml index cb130ab616c..971c9c75120 100644 --- a/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues.xml +++ b/sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues.xml @@ -21,8 +21,8 @@ issue_attributes="foo=bar" tags="[null]" action_plan_key="[null]" - issue_creation_date="2010-01-01" - issue_update_date="2010-02-02" + issue_creation_date="1262300400000" + issue_update_date="1265065200000" issue_close_date="[null]" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/multi-modules-with-issues.xml b/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/multi-modules-with-issues.xml index f6847e78a1c..82a42cdbba9 100644 --- a/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/multi-modules-with-issues.xml +++ b/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/multi-modules-with-issues.xml @@ -88,9 +88,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="[null]" updated_at="[null]" /> @@ -114,9 +114,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="[null]" updated_at="[null]" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database_with_issues.xml b/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database_with_issues.xml index ea885325961..d66c716e4a3 100644 --- a/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database_with_issues.xml +++ b/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database_with_issues.xml @@ -37,9 +37,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="[null]" updated_at="[null]" /> @@ -62,9 +62,9 @@ assignee="user" author_login="[null]" issue_attributes="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="[null]" updated_at="[null]" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml index 8912afe10d4..e7d8f49a2b4 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml @@ -23,9 +23,9 @@ reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" created_at="[null]" updated_at="[null]" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml index b996557dd58..530dafeedaa 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml @@ -68,12 +68,12 @@ What has been changed : component_uuid="GHIJ" project_uuid="ABCD" status="CLOSED" - issue_close_date="2014-04-09" + issue_close_date="1396994400000" resolution="REMOVED" 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="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" + updated_at="1450000000000" issue_creation_date="1366063200000" issue_update_date="1396994400000" created_at="1450000000000" tags="[null]"/> <!-- Open issue on directory --> @@ -81,12 +81,12 @@ What has been changed : component_uuid="EFGH" project_uuid="ABCD" status="CLOSED" - issue_close_date="2014-04-09" + issue_close_date="1396994400000" resolution="REMOVED" line="[null]" 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="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" + updated_at="1450000000000" issue_creation_date="1366063200000" issue_update_date="1396994400000" created_at="1450000000000" tags="[null]"/> <!-- Open issue on project --> @@ -94,12 +94,12 @@ What has been changed : component_uuid="ABCD" project_uuid="ABCD" status="CLOSED" - issue_close_date="2014-04-09" + issue_close_date="1396994400000" resolution="REMOVED" line="[null]" 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="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" + updated_at="1450000000000" issue_creation_date="1366063200000" issue_update_date="1396994400000" created_at="1450000000000" tags="[null]"/> <!-- Resolved issue on file -> not to be updated --> @@ -107,12 +107,12 @@ What has been changed : component_uuid="GHIJ" project_uuid="ABCD" status="CLOSED" - issue_close_date="2015-12-08" + issue_close_date="1449529200000" 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="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-08" + updated_at="1450000000000" issue_creation_date="1366063200000" issue_update_date="1396908000000" created_at="1450000000000" tags="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml index ef2dd1725ec..46f8dbc543c 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml @@ -54,7 +54,7 @@ issue_close_date="[null]" 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="1450000000000"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1450000000000"/> <!-- Open issue on directory --> <issues id="2" kee="ISSUE-2" @@ -64,7 +64,7 @@ issue_close_date="[null]" resolution="[null]" line="[null]" 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="1450000000000"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1450000000000"/> <!-- Open issue on project --> <issues id="3" kee="ISSUE-3" @@ -74,16 +74,16 @@ issue_close_date="[null]" resolution="[null]" line="[null]" 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="1450000000000"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1450000000000"/> <!-- Resolved issue on file -> not to be updated --> <issues id="4" kee="ISSUE-4" component_uuid="GHIJ" project_uuid="ABCD" status="CLOSED" - issue_close_date="2015-12-08" + issue_close_date="1449529200000" 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="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-08" created_at="1450000000000"/> + updated_at="1450000000000" issue_creation_date="1366063200000" issue_update_date="1396908000000" created_at="1450000000000"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml index 3d6f4e67009..1f164a2692e 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml @@ -29,9 +29,9 @@ action_plan_key="[null]" created_at="[null]" updated_at="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" /> <issues id="2" kee="ABCDF" component_uuid="A" project_uuid="A" status="CLOSED" resolution="[null]" line="200" @@ -42,9 +42,9 @@ action_plan_key="[null]" created_at="[null]" updated_at="[null]" - issue_creation_date="2013-04-16" - issue_update_date="2013-04-16" - issue_close_date="2013-04-16" + issue_creation_date="1366063200000" + issue_update_date="1366063200000" + issue_close_date="1366063200000" /> <issue_changes id="1" kee="[null]" issue_key="ABCDF" created_at="[null]" updated_at="[null]" user_login="admin" 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 5f51cd5e54b..142d23dcfe0 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 @@ -28,20 +28,20 @@ component_uuid="100" project_uuid="1" status="CLOSED" - issue_close_date="2010-01-01" + issue_close_date="1262300400000" 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"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" 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_change_creation_date="[null]"/> <issues id="2" kee="ISSUE-2" component_uuid="1" project_uuid="1" status="CLOSED" - issue_close_date="2010-01-01" + issue_close_date="1262300400000" 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"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" 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_change_creation_date="[null]"/> --> @@ -55,7 +55,7 @@ manual_severity="[false]" tags="[null]" 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -70,7 +70,7 @@ manual_severity="[false]" tags="[null]" 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -80,10 +80,10 @@ component_uuid="100" project_uuid="1" status="CLOSED" - issue_close_date="2025-01-01" + issue_close_date="1735686000000" 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"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" 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_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 38c9c3ec360..9fe05024ebd 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 @@ -22,12 +22,12 @@ component_uuid="100" project_uuid="1" status="CLOSED" - issue_close_date="2010-01-01" + issue_close_date="1262300400000" 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -36,12 +36,12 @@ component_uuid="1" project_uuid="1" status="CLOSED" - issue_close_date="2010-01-01" + issue_close_date="1262300400000" 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -57,7 +57,7 @@ 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -72,7 +72,7 @@ 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -81,12 +81,12 @@ component_uuid="100" project_uuid="1" status="CLOSED" - issue_close_date="2025-01-01" + issue_close_date="1735686000000" 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> 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 1095715f65f..1b0bcc3857b 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 @@ -20,20 +20,20 @@ component_uuid="100" project_uuid="1" status="CLOSED" - issue_close_date="2010-01-01" + issue_close_date="1262300400000" 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"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" 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_change_creation_date="[null]"/> <issues id="2" kee="ISSUE-2" component_uuid="1" project_uuid="1" status="CLOSED" - issue_close_date="2010-01-01" + issue_close_date="1262300400000" 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"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" 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_change_creation_date="[null]"/> --> @@ -45,7 +45,7 @@ issue_close_date="[null]" resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]" 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="1400000000000"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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 --> @@ -56,17 +56,17 @@ issue_close_date="[null]" resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]" 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="1400000000000"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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_uuid="100" project_uuid="1" status="CLOSED" - issue_close_date="2025-01-01" + issue_close_date="1735686000000" resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]" 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="1400000000000"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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 eb9fc8960c5..95d56051843 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 @@ -21,12 +21,12 @@ component_uuid="100" project_uuid="1" status="CLOSED" - issue_close_date="2010-01-01" + issue_close_date="1262300400000" 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -35,12 +35,12 @@ component_uuid="1" project_uuid="1" status="CLOSED" - issue_close_date="2010-01-01" + issue_close_date="1262300400000" 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -56,7 +56,7 @@ 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -71,7 +71,7 @@ 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> @@ -80,12 +80,12 @@ component_uuid="100" project_uuid="1" status="CLOSED" - issue_close_date="2025-01-01" + issue_close_date="1735686000000" 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" + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="1400000000000"/> <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]"/> |