]> source.dussan.org Git - sonarqube.git/commitdiff
change issue_changes timestamp columns to bigint/long
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 12 Jan 2015 13:19:54 +0000 (14:19 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 12 Jan 2015 15:13:53 +0000 (16:13 +0100)
28 files changed:
plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/IssueTrackingDecoratorTest.java
server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java
server/sonar-server/src/main/java/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDates.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest.java [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java
server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest/before.xml [new file with mode: 0644]
server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest/schema.sql [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/760_add_issue_changes_long_dates.rb [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/761_feed_issue_changes_long_dates.rb [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/762_rename_issue_changes_long_dates.rb [new file with mode: 0644]
sonar-core/src/main/java/org/sonar/core/issue/db/IssueChangeDto.java
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDaoTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDtoTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeMapperTest.java
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/delete.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/insert-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/select_issue_changelog_by_module_are_sorted_by_creation_date.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/shared.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeDaoTest/update.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_comment-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueChangeMapperTest/insert_diff-result.xml

index 45cc268f96e988b3fe35eaf2cd77b3d6364626c8..337f16b94fe3d0db664598dfa61c8597b2931b7c 100644 (file)
@@ -38,6 +38,7 @@ import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rules.Rule;
 import org.sonar.api.rules.RuleFinder;
 import org.sonar.api.utils.Duration;
+import org.sonar.api.utils.System2;
 import org.sonar.batch.issue.IssueCache;
 import org.sonar.batch.scan.LastLineHashes;
 import org.sonar.batch.scan.filesystem.InputPathCache;
@@ -538,10 +539,10 @@ public class IssueTrackingDecoratorTest {
 
   @Test
   public void merge_issue_changelog_with_previous_changelog() throws Exception {
-    when(initialOpenIssues.selectChangelog("ABCDE")).thenReturn(newArrayList(new IssueChangeDto().setIssueKey("ABCD")));
+    when(initialOpenIssues.selectChangelog("ABCDE")).thenReturn(newArrayList(new IssueChangeDto().setIssueKey("ABCD").setCreatedAt(System2.INSTANCE.now())));
 
     IssueDto previousIssue = new IssueDto().setKee("ABCDE").setResolution(null).setStatus("OPEN").setRuleKey("squid", "AvoidCycle")
-      .setLine(10).setMessage("Message").setEffortToFix(1.5).setDebt(1L);
+      .setLine(10).setMessage("Message").setEffortToFix(1.5).setDebt(1L).setCreatedAt(System2.INSTANCE.now());
     DefaultIssue issue = new DefaultIssue();
 
     IssueTrackingResult trackingResult = mock(IssueTrackingResult.class);
index 87c8c509a2082f6e264b4ef563e5e407d8e1930b..c825fe86383460cc1583644bdf9b0b4d55bf42e0 100644 (file)
@@ -30,10 +30,7 @@ import org.sonar.server.db.migrations.v45.DeleteMeasuresOnDeletedProfilesMigrati
 import org.sonar.server.db.migrations.v451.AddMissingCustomRuleParametersMigration;
 import org.sonar.server.db.migrations.v451.DeleteUnescapedActivities;
 import org.sonar.server.db.migrations.v50.*;
-import org.sonar.server.db.migrations.v51.CopyScmAccountsFromAuthorsToUsers;
-import org.sonar.server.db.migrations.v51.FeedIssueTags;
-import org.sonar.server.db.migrations.v51.FeedUsersLongDates;
-import org.sonar.server.db.migrations.v51.RenameComponentRelatedParamsInIssueFilters;
+import org.sonar.server.db.migrations.v51.*;
 
 import java.util.List;
 
@@ -83,6 +80,7 @@ public interface DatabaseMigrations {
     FeedIssueTags.class,
     FeedUsersLongDates.class,
     RenameComponentRelatedParamsInIssueFilters.class,
-    CopyScmAccountsFromAuthorsToUsers.class
-  );
+    CopyScmAccountsFromAuthorsToUsers.class,
+    FeedIssueChangesLongDates.class
+    );
 }
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDates.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDates.java
new file mode 100644 (file)
index 0000000..2db5dc0
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+package org.sonar.server.db.migrations.v51;
+
+import org.sonar.api.utils.System2;
+import org.sonar.core.persistence.Database;
+import org.sonar.server.db.migrations.BaseDataChange;
+import org.sonar.server.db.migrations.MassUpdate;
+import org.sonar.server.db.migrations.Select;
+import org.sonar.server.db.migrations.SqlStatement;
+
+import java.sql.SQLException;
+import java.util.Date;
+
+public class FeedIssueChangesLongDates extends BaseDataChange {
+
+  private final System2 system;
+
+  public FeedIssueChangesLongDates(Database db, System2 system) {
+    super(db);
+    this.system = system;
+  }
+
+  @Override
+  public void execute(Context context) throws SQLException {
+    final long now = system.now();
+
+    MassUpdate massUpdate = context.prepareMassUpdate();
+    massUpdate.select("SELECT i.created_at, i.updated_at, i.issue_change_creation_date_ms, i.id FROM issue_changes i WHERE created_at_ms IS NULL");
+    massUpdate.update("UPDATE issue_changes SET created_at_ms=?, updated_at_ms=?, issue_change_creation_date_ms=? WHERE id=?");
+    massUpdate.rowPluralName("issue_changes");
+    massUpdate.execute(new MassUpdate.Handler() {
+      @Override
+      public boolean handle(Select.Row row, SqlStatement update) throws SQLException {
+        Date createdAt = row.getDate(1);
+        Date updatedAt = row.getDate(2);
+        Date functionalCreatedAt = row.getDate(3);
+        Long id = row.getLong(4);
+
+        updateColumn(update, 1, createdAt);
+        updateColumn(update, 2, updatedAt);
+        if (functionalCreatedAt == null) {
+          update.setLong(3, null);
+        } else {
+          update.setLong(3, functionalCreatedAt.getTime());
+        }
+        update.setLong(4, id);
+        return true;
+      }
+
+      private void updateColumn(SqlStatement update, int position, Date time) throws SQLException {
+        if (time == null) {
+          update.setLong(position, now);
+        } else {
+          update.setLong(position, Math.min(now, time.getTime()));
+        }
+      }
+    });
+  }
+
+}
index 2db001c45984ba239510d8c4cf193f07657889ab..d889d8f600ea82125405fc394bfcbaafca93cee4 100644 (file)
@@ -27,6 +27,7 @@ import org.sonar.api.issue.IssueComment;
 import org.sonar.api.issue.internal.DefaultIssue;
 import org.sonar.api.issue.internal.DefaultIssueComment;
 import org.sonar.api.issue.internal.IssueChangeContext;
+import org.sonar.api.utils.System2;
 import org.sonar.core.issue.IssueUpdater;
 import org.sonar.core.issue.db.IssueChangeDao;
 import org.sonar.core.issue.db.IssueChangeDto;
@@ -143,7 +144,7 @@ public class IssueCommentService implements ServerComponent {
     issueService.getByKey(comment.issueKey());
 
     IssueChangeDto dto = IssueChangeDto.of(comment);
-    dto.setUpdatedAt(new Date());
+    dto.setUpdatedAt(System2.INSTANCE.now());
     dto.setChangeData(text);
     changeDao.update(dto);
 
diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest.java
new file mode 100644 (file)
index 0000000..5cd281b
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+package org.sonar.server.db.migrations.v51;
+
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.sonar.api.utils.System2;
+import org.sonar.core.persistence.DbTester;
+import org.sonar.server.db.migrations.DatabaseMigration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public class FeedIssueChangesLongDatesTest {
+  @ClassRule
+  public static DbTester db = new DbTester().schema(FeedIssueChangesLongDatesTest.class, "schema.sql");
+
+  @Test
+  public void execute() throws Exception {
+    db.prepareDbUnit(getClass(), "before.xml");
+
+    System2 system = mock(System2.class);
+    when(system.now()).thenReturn(1500000000000L);
+    DatabaseMigration migration = new FeedIssueChangesLongDates(db.database(), system);
+    migration.execute();
+
+    int count = db.countSql("select count(*) from issue_changes where created_at_ms is not null and updated_at_ms is not null");
+    assertThat(count).isEqualTo(3);
+
+    int countWithAllDateFieldsNull = db
+      .countSql("select count(*) from issue_changes where created_at_ms is not null and updated_at_ms is not null and issue_change_creation_date_ms is not null");
+    assertThat(countWithAllDateFieldsNull).isEqualTo(1);
+  }
+}
index 4c2efa43f027163ddbb2202649ba9117bf8554c2..5f52d466439b9474289e5018a80643da20fe2b58 100644 (file)
@@ -221,14 +221,14 @@ public class SearchActionMediumTest {
         .setChangeData("*My comment*")
         .setChangeType(IssueChangeDto.TYPE_COMMENT)
         .setUserLogin("john")
-        .setCreatedAt(DateUtils.parseDate("2014-09-09")));
+        .setCreatedAt(DateUtils.parseDate("2014-09-09").getTime()));
     tester.get(IssueChangeDao.class).insert(session,
       new IssueChangeDto().setIssueKey(issue.getKey())
         .setKey("COMMENT-ABCE")
         .setChangeData("Another comment")
         .setChangeType(IssueChangeDto.TYPE_COMMENT)
         .setUserLogin("fabrice")
-        .setCreatedAt(DateUtils.parseDate("2014-09-10")));
+        .setCreatedAt(DateUtils.parseDate("2014-09-10").getTime()));
     session.commit();
     tester.get(IssueIndexer.class).indexAll();
 
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest/before.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest/before.xml
new file mode 100644 (file)
index 0000000..e8e59f0
--- /dev/null
@@ -0,0 +1,31 @@
+<dataset>
+
+  <!-- new migration -->
+  <issue_changes id="1" kee="ABC-DEF" issue_key="ABC" user_login="[null]" change_type="[null]" change_data="[null]"
+                 created_at="2013-05-18"
+                 updated_at="2013-05-18"
+                 issue_change_creation_date="2013-05-18"
+                 created_at_ms="[null]"
+                 updated_at_ms="[null]"
+                 issue_change_creation_date_ms="[null]"/>
+  />
+
+  <!-- re-entrant migration - ignore the issues that are already fed with new dates -->
+  <issue_changes id="2" kee="FGH-DEF" issue_key="FGH" user_login="[null]" change_type="[null]" change_data="[null]"
+                 created_at="2013-05-18"
+                 updated_at="2013-05-18"
+                 issue_change_creation_date="2013-05-18"
+                 created_at_ms="1500000000000"
+                 updated_at_ms="1500000000000"
+                 issue_change_creation_date_ms="1500000000000"/>
+
+  <!-- NULL dates -->
+  <issue_changes id="3" kee="MISSING-DEF" issue_key="MISSING" user_login="[null]" change_type="[null]"
+                 change_data="[null]"
+                 created_at="[null]"
+                 updated_at="[null]"
+                 issue_change_creation_date="[null]"
+                 created_at_ms="[null]"
+                 updated_at_ms="[null]"
+                 issue_change_creation_date_ms="[null]"/>
+</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest/schema.sql b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/FeedIssueChangesLongDatesTest/schema.sql
new file mode 100644 (file)
index 0000000..240e5ce
--- /dev/null
@@ -0,0 +1,14 @@
+CREATE TABLE "ISSUE_CHANGES" (
+  "ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "KEE" VARCHAR(50),
+  "ISSUE_KEY" VARCHAR(50) NOT NULL,
+  "USER_LOGIN" VARCHAR(255),
+  "CHANGE_TYPE" VARCHAR(40),
+  "CHANGE_DATA"  VARCHAR(16777215),
+  "CREATED_AT" TIMESTAMP,
+  "UPDATED_AT" TIMESTAMP,
+  "ISSUE_CHANGE_CREATION_DATE" TIMESTAMP,
+  "CREATED_AT_MS" BIGINT,
+  "UPDATED_AT_MS" BIGINT,
+  "ISSUE_CHANGE_CREATION_DATE_MS" BIGINT
+);
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/760_add_issue_changes_long_dates.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/760_add_issue_changes_long_dates.rb
new file mode 100644 (file)
index 0000000..6b95448
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# SonarQube is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#
+
+#
+# SonarQube 5.1
+#
+class AddIssueChangesLongDates < ActiveRecord::Migration
+
+  def self.up
+    add_column 'issue_changes', :created_at_ms, :big_integer, :null => true
+    add_column 'issue_changes', :updated_at_ms, :big_integer, :null => true
+    add_column 'issue_changes', :issue_change_creation_date_ms, :big_integer, :null => true
+  end
+end
+
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/761_feed_issue_changes_long_dates.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/761_feed_issue_changes_long_dates.rb
new file mode 100644 (file)
index 0000000..2d6d339
--- /dev/null
@@ -0,0 +1,31 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# SonarQube is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#
+
+#
+# SonarQube 5.1
+#
+class FeedIssueChangesLongDates < ActiveRecord::Migration
+
+  def self.up
+    execute_java_migration('org.sonar.server.db.migrations.v51.FeedIssueChangesLongDates')
+  end
+
+end
+
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/762_rename_issue_changes_long_dates.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/762_rename_issue_changes_long_dates.rb
new file mode 100644 (file)
index 0000000..921f3c4
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# SonarQube is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#
+
+#
+# SonarQube 5.1
+#
+class RenameIssueChangesLongDates < ActiveRecord::Migration
+
+  def self.up
+    remove_column 'issue_changes', 'created_at'
+    remove_column 'issue_changes', 'updated_at'
+    remove_column 'issue_changes', 'issue_change_creation_date'
+    rename_column 'issue_changes', 'created_at_ms', 'created_at'
+    rename_column 'issue_changes', 'updated_at_ms', 'updated_at'
+    rename_column 'issue_changes', 'issue_change_creation_date_ms', 'issue_change_creation_date'
+  end
+end
+
index d3f8d59239ae5dbf01aa181808d5804eb4d7105c..18b731018f1d92579abb9fe2c2819bdfbbd948fc 100644 (file)
@@ -23,6 +23,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
 import org.apache.commons.lang.builder.ToStringStyle;
 import org.sonar.api.issue.internal.DefaultIssueComment;
 import org.sonar.api.issue.internal.FieldDiffs;
+import org.sonar.api.utils.System2;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
@@ -30,6 +31,8 @@ import javax.annotation.Nullable;
 import java.io.Serializable;
 import java.util.Date;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 /**
  * @since 3.6
  */
@@ -46,11 +49,40 @@ public final class IssueChangeDto implements Serializable {
   private String changeData;
 
   // technical dates
-  private Date createdAt;
-  private Date updatedAt;
+  private Long createdAt;
+  private Long updatedAt;
 
   // functional date
-  private Date issueChangeCreationDate;
+  private Long issueChangeCreationDate;
+
+  public static IssueChangeDto of(DefaultIssueComment comment) {
+    IssueChangeDto dto = newDto(comment.issueKey());
+    dto.setKey(comment.key());
+    dto.setChangeType(IssueChangeDto.TYPE_COMMENT);
+    dto.setChangeData(comment.markdownText());
+    dto.setUserLogin(comment.userLogin());
+    dto.setIssueChangeCreationDate(comment.createdAt() == null ? null : comment.createdAt().getTime());
+    return dto;
+  }
+
+  public static IssueChangeDto of(String issueKey, FieldDiffs diffs) {
+    IssueChangeDto dto = newDto(issueKey);
+    dto.setChangeType(IssueChangeDto.TYPE_FIELD_CHANGE);
+    dto.setChangeData(diffs.toString());
+    dto.setUserLogin(diffs.userLogin());
+    dto.setIssueChangeCreationDate(diffs.creationDate() == null ? null : diffs.creationDate().getTime());
+    return dto;
+  }
+
+  private static IssueChangeDto newDto(String issueKey) {
+    IssueChangeDto dto = new IssueChangeDto();
+    dto.setIssueKey(issueKey);
+
+    // technical dates - do not use the context date
+    dto.setCreatedAt(System2.INSTANCE.now());
+    dto.setUpdatedAt(System2.INSTANCE.now());
+    return dto;
+  }
 
   public Long getId() {
     return id;
@@ -107,29 +139,29 @@ public final class IssueChangeDto implements Serializable {
     return this;
   }
 
-  public Date getCreatedAt() {
+  public Long getCreatedAt() {
     return createdAt;
   }
 
-  public IssueChangeDto setCreatedAt(Date createdAt) {
-    this.createdAt = createdAt;
+  public IssueChangeDto setCreatedAt(Long createdAt) {
+    this.createdAt = checkNotNull(createdAt);
     return this;
   }
 
-  public Date getUpdatedAt() {
+  public Long getUpdatedAt() {
     return updatedAt;
   }
 
-  public IssueChangeDto setUpdatedAt(Date updatedAt) {
+  public IssueChangeDto setUpdatedAt(@Nullable Long updatedAt) {
     this.updatedAt = updatedAt;
     return this;
   }
 
-  public Date getIssueChangeCreationDate() {
+  public Long getIssueChangeCreationDate() {
     return issueChangeCreationDate;
   }
 
-  public IssueChangeDto setIssueChangeCreationDate(Date issueChangeCreationDate) {
+  public IssueChangeDto setIssueChangeCreationDate(@Nullable Long issueChangeCreationDate) {
     this.issueChangeCreationDate = issueChangeCreationDate;
     return this;
   }
@@ -139,42 +171,12 @@ public final class IssueChangeDto implements Serializable {
     return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
   }
 
-  public static IssueChangeDto of(DefaultIssueComment comment) {
-    IssueChangeDto dto = newDto(comment.issueKey());
-    dto.setKey(comment.key());
-    dto.setChangeType(IssueChangeDto.TYPE_COMMENT);
-    dto.setChangeData(comment.markdownText());
-    dto.setUserLogin(comment.userLogin());
-    dto.setIssueChangeCreationDate(comment.createdAt());
-    return dto;
-  }
-
-  public static IssueChangeDto of(String issueKey, FieldDiffs diffs) {
-    IssueChangeDto dto = newDto(issueKey);
-    dto.setChangeType(IssueChangeDto.TYPE_FIELD_CHANGE);
-    dto.setChangeData(diffs.toString());
-    dto.setUserLogin(diffs.userLogin());
-    dto.setIssueChangeCreationDate(diffs.creationDate());
-    return dto;
-  }
-
-  private static IssueChangeDto newDto(String issueKey) {
-    IssueChangeDto dto = new IssueChangeDto();
-    dto.setIssueKey(issueKey);
-
-    // technical dates - do not use the context date
-    Date now = new Date();
-    dto.setCreatedAt(now);
-    dto.setUpdatedAt(new Date());
-    return dto;
-  }
-
   public DefaultIssueComment toComment() {
     return new DefaultIssueComment()
       .setMarkdownText(changeData)
       .setKey(kee)
-      .setCreatedAt(createdAt)
-      .setUpdatedAt(updatedAt)
+      .setCreatedAt(new Date(createdAt))
+      .setUpdatedAt(updatedAt == null ? null : new Date(updatedAt))
       .setUserLogin(userLogin)
       .setIssueKey(issueKey)
       .setNew(false);
@@ -184,7 +186,7 @@ public final class IssueChangeDto implements Serializable {
     return FieldDiffs.parse(changeData)
       .setUserLogin(userLogin)
       // issueChangeCreationDate can be null as it has been introduced after createdAt
-      .setCreationDate(issueChangeCreationDate != null ? issueChangeCreationDate : createdAt)
+      .setCreationDate(issueChangeCreationDate != null ? new Date(issueChangeCreationDate) : new Date(createdAt))
       .setIssueKey(issueKey);
   }
 }
index 3b2cbb8d1292b1e75c59268a4b72b0bfd3646d3a..83c1660265d84f12286d840bd8c5e7b42e72b29b 100644 (file)
@@ -33,7 +33,7 @@ import java.util.List;
  */
 public class DatabaseVersion implements BatchComponent, ServerComponent {
 
-  public static final int LAST_VERSION = 759;
+  public static final int LAST_VERSION = 762;
 
   /**
    * List of all the tables.n
index 8914d74ec146345a6b0fb3a865178e20d9374f2d..b067306fe9a51524de40262a64d132adb96079a7 100644 (file)
@@ -288,6 +288,9 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('756');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('757');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('758');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('759');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('760');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('761');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('762');
 
 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;
index 03ce64c522cfea2141f4bb0cdafd4074de392d86..3b79cb47b02481643f0bc8a3ce1822d10e04a888 100644 (file)
@@ -474,9 +474,9 @@ CREATE TABLE "ISSUE_CHANGES" (
   "USER_LOGIN" VARCHAR(255),
   "CHANGE_TYPE" VARCHAR(40),
   "CHANGE_DATA"  VARCHAR(16777215),
-  "CREATED_AT" TIMESTAMP,
-  "UPDATED_AT" TIMESTAMP,
-  "ISSUE_CHANGE_CREATION_DATE" TIMESTAMP,
+  "CREATED_AT" BIGINT,
+  "UPDATED_AT" BIGINT,
+  "ISSUE_CHANGE_CREATION_DATE" BIGINT
 );
 
 CREATE TABLE "ISSUE_FILTERS" (
index 91dcc972914a1e26cd3e2a79fddd7e152a9b10ba..b6c047e795dcaaeda2a1a6485e2fe715df916704 100644 (file)
@@ -68,7 +68,6 @@ public class IssueChangeDaoTest extends AbstractDaoTestCase {
     DefaultIssueComment first = comments.get(0);
     assertThat(first.markdownText()).isEqualTo("old comment");
 
-
     DefaultIssueComment second = comments.get(1);
     assertThat(second.userLogin()).isEqualTo("arthur");
     assertThat(second.key()).isEqualTo("FGHIJ");
@@ -81,8 +80,8 @@ public class IssueChangeDaoTest extends AbstractDaoTestCase {
 
     DbSession session = getMyBatis().openSession(false);
     List<String> hugeNbOfIssues = newArrayList();
-    for (int i=0; i<4500; i++) {
-      hugeNbOfIssues.add("ABCD"+i);
+    for (int i = 0; i < 4500; i++) {
+      hugeNbOfIssues.add("ABCD" + i);
     }
     List<DefaultIssueComment> comments = dao.selectCommentsByIssues(session, hugeNbOfIssues);
     MyBatis.closeQuietly(session);
@@ -192,9 +191,9 @@ public class IssueChangeDaoTest extends AbstractDaoTestCase {
       .setChangeData("Some text")
       .setChangeType("comment")
       .setIssueKey("ABCDE")
-      .setCreatedAt(DateUtils.parseDate("2014-09-09"))
-      .setUpdatedAt(DateUtils.parseDate("2014-09-10"))
-      .setIssueChangeCreationDate(DateUtils.parseDate("2014-09-11"));
+      .setCreatedAt(DateUtils.parseDate("2014-09-09").getTime())
+      .setUpdatedAt(DateUtils.parseDate("2014-09-10").getTime())
+      .setIssueChangeCreationDate(DateUtils.parseDate("2014-09-11").getTime());
 
     dao.insert(session, changeDto);
     session.commit();
@@ -211,7 +210,7 @@ public class IssueChangeDaoTest extends AbstractDaoTestCase {
 
     // Only the following fields can be updated:
     change.setChangeData("new comment");
-    change.setUpdatedAt(DateUtils.parseDate("2013-06-30"));
+    change.setUpdatedAt(DateUtils.parseDate("2013-06-30").getTime());
 
     assertThat(dao.update(change)).isTrue();
 
@@ -227,7 +226,7 @@ public class IssueChangeDaoTest extends AbstractDaoTestCase {
 
     // Only the following fields can be updated:
     change.setChangeData("new comment");
-    change.setUpdatedAt(DateUtils.parseDate("2013-06-30"));
+    change.setUpdatedAt(DateUtils.parseDate("2013-06-30").getTime());
 
     assertThat(dao.update(change)).isFalse();
   }
index ae7523836dcc7df2ddd061c1066e9482ca556661..a3602e8f3f2a57e56bc381f4a03bb792688974dc 100644 (file)
@@ -23,8 +23,7 @@ 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 java.util.Date;
+import org.sonar.api.utils.System2;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
@@ -57,7 +56,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.getIssueChangeCreationDate()).isEqualTo(DateUtils.parseDate("2014-01-03").getTime());
     assertThat(dto.getIssueKey()).isEqualTo("ABCDE");
     assertThat(dto.getUserLogin()).isEqualTo("emmerik");
   }
@@ -69,8 +68,8 @@ public class IssueChangeDtoTest {
       .setUserLogin("emmerik")
       .setChangeData("Some text")
       .setIssueKey("ABCDE")
-      .setCreatedAt(new Date())
-      .setUpdatedAt(new Date());
+      .setCreatedAt(System2.INSTANCE.now())
+      .setUpdatedAt(System2.INSTANCE.now());
 
     DefaultIssueComment comment = changeDto.toComment();
     assertThat(comment.key()).isEqualTo("EFGH");
@@ -88,7 +87,7 @@ public class IssueChangeDtoTest {
       .setUserLogin("emmerik")
       .setChangeData("Some text")
       .setIssueKey("ABCDE")
-      .setIssueChangeCreationDate(new Date());
+      .setIssueChangeCreationDate(System2.INSTANCE.now());
 
     FieldDiffs diffs = changeDto.toFieldDiffs();
     assertThat(diffs.userLogin()).isEqualTo("emmerik");
@@ -103,7 +102,7 @@ public class IssueChangeDtoTest {
       .setUserLogin("emmerik")
       .setChangeData("Some text")
       .setIssueKey("ABCDE")
-      .setCreatedAt(new Date());
+      .setCreatedAt(System2.INSTANCE.now());
 
     FieldDiffs diffs = changeDto.toFieldDiffs();
     assertThat(diffs.userLogin()).isEqualTo("emmerik");
index d1a1c8a709e094df6be567f8a7f07d5effc45f28..6c428e4a90170ddfdc7d549c3d202363cdf5f259 100644 (file)
@@ -27,8 +27,6 @@ import org.sonar.api.utils.DateUtils;
 import org.sonar.core.persistence.AbstractDaoTestCase;
 import org.sonar.core.persistence.MyBatis;
 
-import java.util.Date;
-
 public class IssueChangeMapperTest extends AbstractDaoTestCase {
   SqlSession session;
   IssueChangeMapper mapper;
@@ -52,14 +50,14 @@ public class IssueChangeMapperTest extends AbstractDaoTestCase {
     dto.setIssueKey("ABCDE");
     dto.setChangeType(IssueChangeDto.TYPE_FIELD_CHANGE);
     dto.setChangeData("severity=INFO|BLOCKER");
-    Date d = DateUtils.parseDate("2013-05-18");
+    long d = DateUtils.parseDate("2013-05-18").getTime();
     dto.setCreatedAt(d);
     dto.setUpdatedAt(d);
     dto.setIssueChangeCreationDate(d);
     mapper.insert(dto);
     session.commit();
 
-    checkTables("insert_diff", new String[]{"id"}, "issue_changes");
+    checkTables("insert_diff", new String[] {"id"}, "issue_changes");
   }
 
   @Test
@@ -70,12 +68,12 @@ public class IssueChangeMapperTest extends AbstractDaoTestCase {
     dto.setIssueKey("ABCDE");
     dto.setChangeType(IssueChangeDto.TYPE_COMMENT);
     dto.setChangeData("the comment");
-    Date d = DateUtils.parseDate("2013-05-18");
+    long d = DateUtils.parseDate("2013-05-18").getTime();
     dto.setCreatedAt(d);
     dto.setUpdatedAt(d);
     mapper.insert(dto);
     session.commit();
 
-    checkTables("insert_comment", new String[]{"id"}, "issue_changes");
+    checkTables("insert_comment", new String[] {"id"}, "issue_changes");
   }
 }
index 43980b2e35ee81da0bfae04a38dd4cfc95dad68f..be1549d36f11088556d026a1ea57747e87a08b94 100644 (file)
@@ -7,8 +7,8 @@
     user_login="arthur"
     change_type="comment"
     change_data="old comment"
-    created_at="2013-01-01"
-    updated_at="2013-01-01"
+    created_at="1356994800000"
+    updated_at="1356994800000"
     issue_change_creation_date="[null]"
     />
 
@@ -19,9 +19,9 @@
     user_login="arthur"
     change_type="diff"
     change_data="severity=MAJOR|BLOCKER"
-    created_at="2013-02-02"
-    updated_at="2013-02-02"
-    issue_change_creation_date="2013-02-02"
+    created_at="1359759600000"
+    updated_at="1359759600000"
+    issue_change_creation_date="1359759600000"
     />
 
   <!--
@@ -34,9 +34,9 @@
     user_login="arthur"
     change_type="comment"
     change_data="recent comment"
-    created_at="2013-05-05"
-    updated_at="2013-05-05"
-    issue_change_creation_date="2013-05-05"
+    created_at="1367704800000"
+    updated_at="1367704800000"
+    issue_change_creation_date="1367704800000"
     />
     -->
 </dataset>
index ffc07f03686edc9b7ec4f4f05917ce92d48c600b..3277acb54caec2db28cf9d0f493dbcd3c88a78da 100644 (file)
@@ -7,8 +7,8 @@
     user_login="arthur"
     change_type="comment"
     change_data="old comment"
-    created_at="2013-01-01"
-    updated_at="2013-01-01"
+    created_at="1356994800000"
+    updated_at="1356994800000"
     issue_change_creation_date="[null]"
     />
 
@@ -19,9 +19,9 @@
     user_login="arthur"
     change_type="diff"
     change_data="severity=MAJOR|BLOCKER"
-    created_at="2013-02-02"
-    updated_at="2013-02-02"
-    issue_change_creation_date="2013-02-02"
+    created_at="1359759600000"
+    updated_at="1359759600000"
+    issue_change_creation_date="1359759600000"
     />
 
   <issue_changes
@@ -31,8 +31,8 @@
     user_login="arthur"
     change_type="comment"
     change_data="recent comment"
-    created_at="2013-05-05"
-    updated_at="2013-05-05"
-    issue_change_creation_date="2013-05-05"
+    created_at="1367704800000"
+    updated_at="1367704800000"
+    issue_change_creation_date="1367704800000"
     />
 </dataset>
index a91841afa11a35ce1eb0e13a8831ddf72d105961..6e5a96df5453d3113d9b537d423a3828ce76f831 100644 (file)
@@ -7,9 +7,9 @@
     user_login="emmerik"
     change_type="comment"
     change_data="Some text"
-    created_at="2014-09-09"
-    updated_at="2014-09-10"
-    issue_change_creation_date="2014-09-11"
+    created_at="1410213600000"
+    updated_at="1410300000000"
+    issue_change_creation_date="1410386400000"
     />
 
 </dataset>
index c93aea039d9caa8eb4c2578a712c8d188b060c17..cd51c9c7bc0d0e0ee15d0848ad197142652547b4 100644 (file)
@@ -38,9 +38,9 @@
       user_login="arthur"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-04-16"
-      updated_at="2013-04-16"
-      issue_change_creation_date="2013-04-16"
+      created_at="1410213600000"
+      updated_at="1410213600000"
+      issue_change_creation_date="1410213600000"
       />
 
   <issue_changes
@@ -50,9 +50,9 @@
       user_login="arthur"
       change_type="diff"
       change_data="actionPlan=1.0|1.1"
-      created_at="2013-04-16"
-      updated_at="2013-04-16"
-      issue_change_creation_date="2013-04-16"
+      created_at="1410213600000"
+      updated_at="1410213600000"
+      issue_change_creation_date="1410213600000"
       />
 
   <issue_changes
@@ -62,8 +62,8 @@
       user_login="arthur"
       change_type="comment"
       change_data="recent comment"
-      created_at="2013-04-16"
-      updated_at="2013-04-16"
+      created_at="1410213600000"
+      updated_at="1410213600000"
       issue_change_creation_date="[null]"
       />
 
       user_login="arthur"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-04-16"
-      updated_at="2013-04-16"
-      issue_change_creation_date="2013-04-16"
+      created_at="1410213600000"
+      updated_at="1410213600000"
+      issue_change_creation_date="1410213600000"
       />
 
   <!-- Closed Issue on a file -->
       user_login="arthur"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-04-16"
-      updated_at="2013-04-16"
-      issue_change_creation_date="2013-04-16"
+      created_at="1410213600000"
+      updated_at="1410213600000"
+      issue_change_creation_date="1410213600000"
       />
 
   <!-- Open Issue on a sub module -->
       user_login="arthur"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-04-16"
-      updated_at="2013-04-16"
-      issue_change_creation_date="2013-04-16"
+      created_at="1410213600000"
+      updated_at="1410213600000"
+      issue_change_creation_date="1410213600000"
       />
 
   <!-- Open Issue on a root module -->
       user_login="arthur"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-04-16"
-      updated_at="2013-04-16"
-      issue_change_creation_date="2013-04-16"
+      created_at="1410213600000"
+      updated_at="1410213600000"
+      issue_change_creation_date="1410213600000"
       />
 
 </dataset>
index f36d8c96a59533acabd5b30145d55c8c36dd837d..29907c71ac0cda3b38e274ca86adfb0ac011cca5 100644 (file)
@@ -35,9 +35,9 @@
       user_login="arthur"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-04-18"
-      updated_at="2013-04-18"
-      issue_change_creation_date="2013-04-18"
+      created_at="1410386400000"
+      updated_at="1410386400000"
+      issue_change_creation_date="1410386400000"
       />
 
   <issue_changes
@@ -47,9 +47,9 @@
       user_login="arthur"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-04-16"
-      updated_at="2013-04-16"
-      issue_change_creation_date="2013-04-16"
+      created_at="1410213600000"
+      updated_at="1410213600000"
+      issue_change_creation_date="1410213600000"
       />
 
   <issue_changes
@@ -59,9 +59,9 @@
       user_login="arthur"
       change_type="diff"
       change_data="actionPlan=1.0|1.1"
-      created_at="2013-04-17"
-      updated_at="2013-04-17"
-      issue_change_creation_date="2013-04-17"
+      created_at="1410300000000"
+      updated_at="1410300000000"
+      issue_change_creation_date="1410300000000"
       />
 
 </dataset>
index 48f09145b6334c4175ff2ad4aee2b323a5b7c3df..5367328c57cf727ef3fa9ed30c78bac08ac3fd07 100644 (file)
@@ -7,8 +7,8 @@
       user_login="arthur"
       change_type="comment"
       change_data="old comment"
-      created_at="2013-01-01"
-      updated_at="2013-01-01"
+      created_at="1356994800000"
+      updated_at="1356994800000"
       issue_change_creation_date="[null]"
       />
 
@@ -19,9 +19,9 @@
       user_login="arthur"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-02-02"
-      updated_at="2013-02-02"
-      issue_change_creation_date="2013-02-02"
+      created_at="1359759600000"
+      updated_at="1359759600000"
+      issue_change_creation_date="1359759600000"
       />
 
   <issue_changes
@@ -31,8 +31,8 @@
       user_login="arthur"
       change_type="comment"
       change_data="recent comment"
-      created_at="2013-05-05"
-      updated_at="2013-05-05"
+      created_at="1367704800000"
+      updated_at="1367704800000"
       issue_change_creation_date="[null]"
       />
 
@@ -43,9 +43,9 @@
       user_login="arthur"
       change_type="diff"
       change_data="actionPlan=1.0|1.1"
-      created_at="2013-02-02"
-      updated_at="2013-02-02"
-      issue_change_creation_date="2013-02-02"
+      created_at="1359759600000"
+      updated_at="1359759600000"
+      issue_change_creation_date="1359759600000"
       />
 
   <issue_changes
@@ -55,9 +55,9 @@
       user_login="henry"
       change_type="diff"
       change_data="severity=MAJOR|BLOCKER"
-      created_at="2013-02-01"
-      updated_at="2013-02-01"
-      issue_change_creation_date="2013-02-01"
+      created_at="1356994800000"
+      updated_at="1356994800000"
+      issue_change_creation_date="1356994800000"
       />
 
 </dataset>
index 31a5056c85967c23dddb2da6b45726fadbef4df6..754dfd948f22bcc96b8a58fe49701d83e8cb63ab 100644 (file)
@@ -1,38 +1,38 @@
 <dataset>
 
   <issue_changes
-    id="100"
-    kee="COMMENT-1"
-    issue_key="ISSUE-1"
-    user_login="arthur"
-    change_type="comment"
-    change_data="old comment"
-    created_at="2013-01-01"
-    updated_at="2013-01-01"
-    issue_change_creation_date="[null]"
-    />
+      id="100"
+      kee="COMMENT-1"
+      issue_key="ISSUE-1"
+      user_login="arthur"
+      change_type="comment"
+      change_data="old comment"
+      created_at="1356994800000"
+      updated_at="1356994800000"
+      issue_change_creation_date="[null]"
+      />
 
   <issue_changes
-    id="101"
-    kee="[null]"
-    issue_key="1000"
-    user_login="arthur"
-    change_type="diff"
-    change_data="severity=MAJOR|BLOCKER"
-    created_at="2013-02-02"
-    updated_at="2013-02-02"
-    issue_change_creation_date="2013-02-02"
-    />
+      id="101"
+      kee="[null]"
+      issue_key="1000"
+      user_login="arthur"
+      change_type="diff"
+      change_data="severity=MAJOR|BLOCKER"
+      created_at="1359759600000"
+      updated_at="1359759600000"
+      issue_change_creation_date="1359759600000"
+      />
 
   <issue_changes
-    id="102"
-    kee="COMMENT-2"
-    issue_key="ISSUE-1"
-    user_login="arthur"
-    change_type="comment"
-    change_data="new comment"
-    created_at="2013-05-05"
-    updated_at="2013-06-30"
-    issue_change_creation_date="[null]"
-    />
+      id="102"
+      kee="COMMENT-2"
+      issue_key="ISSUE-1"
+      user_login="arthur"
+      change_type="comment"
+      change_data="new comment"
+      created_at="1367704800000"
+      updated_at="1372543200000"
+      issue_change_creation_date="[null]"
+      />
 </dataset>
index 94e2ec538771c9e24fb589a85a327ef6dfe7e608..641f333faa3b190b22d7cb15bf984a2ecda4ce99 100644 (file)
@@ -7,8 +7,8 @@
     user_login="arthur"
     change_type="comment"
     change_data="old comment"
-    created_at="2013-01-01"
-    updated_at="2013-01-01"
+    created_at="1356994800000"
+    updated_at="1356994800000"
     issue_change_creation_date="[null]"
     />
 
@@ -19,9 +19,9 @@
     user_login="arthur"
     change_type="diff"
     change_data="severity=MAJOR|BLOCKER"
-    created_at="2013-02-02"
-    updated_at="2013-02-02"
-    issue_change_creation_date="2013-02-02"
+    created_at="1359759600000"
+    updated_at="1359759600000"
+    issue_change_creation_date="1359759600000"
     />
 
   <issue_changes
@@ -31,8 +31,8 @@
     user_login="arthur"
     change_type="comment"
     change_data="old value"
-    created_at="2013-05-05"
-    updated_at="2013-05-05"
+    created_at="1367704800000"
+    updated_at="1367704800000"
     issue_change_creation_date="[null]"
     />
 </dataset>
index 67122e49373a91409d727e6da4d9083e5f5f5ed6..ad0e38ea83d1c229c13c3d5326d2d25eb51296cc 100644 (file)
@@ -6,8 +6,8 @@
       user_login="emmerik"
       change_type="comment"
       change_data="the comment"
-      created_at="2013-05-18"
-      updated_at="2013-05-18"
+      created_at="1368828000000"
+      updated_at="1368828000000"
       issue_change_creation_date="[null]"
       />
 </dataset>
index 164a9d22dd42ca2c79e93e7f081566756a7bdb89..d4754f60a0684dce6618e42e3723a26d7ef768b2 100644 (file)
@@ -6,8 +6,8 @@
       user_login="emmerik"
       change_type="diff"
       change_data="severity=INFO|BLOCKER"
-      created_at="2013-05-18"
-      updated_at="2013-05-18"
-      issue_change_creation_date="2013-05-18"
+      created_at="1368828000000"
+      updated_at="1368828000000"
+      issue_change_creation_date="1368828000000"
       />
 </dataset>