From e7c1b29008b01dd55251d365a1b761f6c1eccf6e Mon Sep 17 00:00:00 2001 From: Winston Li Date: Mon, 9 Mar 2015 21:29:03 +0000 Subject: [PATCH] Change timestamp parsing to include milliseconds. --- .../api/request/getdoc/SnapshotGetDocResult.java | 2 +- .../wlgitbridge/writelatex/model/Snapshot.java | 6 +++--- .../canCloneARepository/state/state.json | 4 ++-- .../state/state.json | 8 ++++---- .../canPullADeletedTexFile/base/state.json | 4 ++-- .../withDeletedTexFile/state.json | 6 +++--- .../state/state.json | 14 +++++++------- .../WLGitBridgeIntegrationTest/state.json | 16 ++++++++-------- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocResult.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocResult.java index 1f76d76bb7..c2dcb8c6fa 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocResult.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocResult.java @@ -85,7 +85,7 @@ public class SnapshotGetDocResult extends Result { email = userObject.get("email").getAsString(); } else { name = "Anonymous"; - email = "anonymous@writelatex.com"; + email = "anonymous@overleaf.com"; } } } diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/Snapshot.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/Snapshot.java index 8bd927dd0c..0b0cc0d910 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/Snapshot.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/Snapshot.java @@ -33,12 +33,12 @@ public class Snapshot implements Comparable { userEmail = user.getEmail(); TimeZone tz = TimeZone.getDefault(); Calendar cal = Calendar.getInstance(tz); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); sdf.setCalendar(cal); try { cal.setTime(sdf.parse(info.getCreatedAt())); - } catch (ParseException e) { - throw new RuntimeException(e); + } catch (ParseException e2) { + throw new RuntimeException(e2); } createdAt = cal.getTime(); diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneARepository/state/state.json b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneARepository/state/state.json index 6c2b2bb10e..3d6f119160 100644 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneARepository/state/state.json +++ b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneARepository/state/state.json @@ -3,7 +3,7 @@ "project": "testproj", "getDoc": { "versionID": 1, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -13,7 +13,7 @@ "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.333Z" } ], "getForVers": [ diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/state.json b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/state.json index e4abf7846a..82b3666659 100644 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/state.json +++ b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/state.json @@ -3,7 +3,7 @@ "project": "testproj1", "getDoc": { "versionID": 1, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -13,7 +13,7 @@ "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.456Z" } ], "getForVers": [ @@ -47,7 +47,7 @@ "project": "testproj2", "getDoc": { "versionID": 1, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -57,7 +57,7 @@ "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.456Z" } ], "getForVers": [ diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/state.json b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/state.json index 65f186f256..c5d524ce0c 100644 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/state.json +++ b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/state.json @@ -3,7 +3,7 @@ "project": "testproj", "getDoc": { "versionID": 1, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -13,7 +13,7 @@ "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.456Z" } ], "getForVers": [ diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/withDeletedTexFile/state.json b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/withDeletedTexFile/state.json index 7bd4d5384d..1c966d2018 100644 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/withDeletedTexFile/state.json +++ b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/withDeletedTexFile/state.json @@ -3,7 +3,7 @@ "project": "testproj", "getDoc": { "versionID": 2, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -13,14 +13,14 @@ "comment": "i deleted test.tex", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:48:01Z" + "createdAt": "2014-11-30T18:48:01.123Z" }, { "versionID": 1, "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.456Z" } ], "getForVers": [ diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/cannotCloneAProtectedProject/state/state.json b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/cannotCloneAProtectedProject/state/state.json index 4599d38d0e..859bc623a7 100644 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/cannotCloneAProtectedProject/state/state.json +++ b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/cannotCloneAProtectedProject/state/state.json @@ -4,7 +4,7 @@ "getDoc": { "error": 403, "versionID": 1, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -14,7 +14,7 @@ "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.456Z" } ], "getForVers": [ @@ -42,7 +42,7 @@ "project": "invalidFiles", "getDoc": { "versionID": 1, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -52,7 +52,7 @@ "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.456Z" } ], "getForVers": [ @@ -95,7 +95,7 @@ "project": "invalidProject", "getDoc": { "versionID": 1, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -136,7 +136,7 @@ "project": "error", "getDoc": { "versionID": 1, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -146,7 +146,7 @@ "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.456Z" } ], "getForVers": [ diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/state.json b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/state.json index 49efcb3979..90fa025334 100644 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/state.json +++ b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/state.json @@ -3,7 +3,7 @@ "project": "1826rqgsdb", "getDoc": { "versionID": 243, - "createdAt": "2014-11-30T18:40:58Z", + "createdAt": "2014-11-30T18:40:58.123Z", "email": "jdleesmiller+1@gmail.com", "name": "John+1" }, @@ -13,49 +13,49 @@ "comment": "added more info on doc GET and error details", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-30T18:47:01Z" + "createdAt": "2014-11-30T18:47:01.456Z" }, { "versionID": 185, "comment": "with more details on POST request", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-11T17:18:40Z" + "createdAt": "2014-11-11T17:18:40.789Z" }, { "versionID": 175, "comment": "with updated PUT/POST request", "email": "jdleesmiller+1@gmail.com", "name": "John+1", - "createdAt": "2014-11-09T23:09:13Z" + "createdAt": "2014-11-09T23:09:13.123Z" }, { "versionID": 146, "comment": "added PUT format", "email": "jdleesmiller@gmail.com", "name": "John Lees-Miller", - "createdAt": "2014-11-07T15:11:35Z" + "createdAt": "2014-11-07T15:11:35.456Z" }, { "versionID": 74, "comment": "with example output", "email": "jdleesmiller@gmail.com", "name": "John Lees-Miller", - "createdAt": "2014-11-05T18:09:41Z" + "createdAt": "2014-11-05T18:09:41.789Z" }, { "versionID": 39, "comment": "with more files", "email": "jdleesmiller@gmail.com", "name": "John Lees-Miller", - "createdAt": "2014-11-05T18:02:19Z" + "createdAt": "2014-11-05T18:02:19.123Z" }, { "versionID": 24, "comment": "first draft", "email": "jdleesmiller@gmail.com", "name": "John Lees-Miller", - "createdAt": "2014-11-05T17:56:58Z" + "createdAt": "2014-11-05T17:56:58.456Z" } ], "getForVers": [