Re: [EGIT PATCH 1/2] Revert "Fix commit id in egit test T0001_ConnectProviderOperationTest"
onsdag 17 december 2008 17:09:33 skrev Shawn O. Pearce:
> The only thing I can think of is the timestamp we are creating by
> the deprecated Date constructor call back on line 82. Perhaps
> on different JVMs it is using different values for the hh:mm:ss
> parts of the timestamp value?
Indeed it is. Date is dependent on local time zone.
>From e4d10dea5d62210868d71384e559a0d3ef1ca55d Mon Sep 17 00:00:00 2001
From: Robin Rosenberg <robin.rosenberg@dewire.com>
Date: Wed, 17 Dec 2008 22:46:48 +0100
Subject: [EGIT PATCH 1/2 v2] Fix testcase that was sensitive to the local time zone.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../op/T0001_ConnectProviderOperationTest.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/org.spearce.egit.core.test/src/org/spearce/egit/core/op/T0001_ConnectProviderOperationTest.java b/org.spearce.egit.core.test/src/org/spearce/egit/core/op/T0001_ConnectProviderOperationTest.java
index 0ce2d7f..092c048 100644
--- a/org.spearce.egit.core.test/src/org/spearce/egit/core/op/T0001_ConnectProviderOperationTest.java
+++ b/org.spearce.egit.core.test/src/org/spearce/egit/core/op/T0001_ConnectProviderOperationTest.java
@@ -80,7 +80,7 @@ public void testNewUnsharedFile() throws CoreException, IOException,
Commit commit = new Commit(thisGit);
commit.setTree(rootTree);
commit.setAuthor(new PersonIdent("J. Git", "j.git@egit.org", new Date(
- 1999, 1, 1), TimeZone.getTimeZone("GMT+1")));
+ 60876075600000L), TimeZone.getTimeZone("GMT+1")));
commit.setCommitter(commit.getAuthor());
commit.setMessage("testNewUnsharedFile\n\nJunit tests\n");
ObjectId id = writer.writeCommit(commit);
--
1.6.0.3.640.g6331a