aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserTest.java
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2012-09-18 19:23:17 +0200
committerRobin Rosenberg <robin.rosenberg@dewire.com>2012-09-18 19:23:17 +0200
commite0a3091af74846b697b5a34da0d7807fe4539e5c (patch)
treef3e38dc47dea2adb1223ac7e2bb0bdc48c2db8fd /org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserTest.java
parent84e171fbabd898ff46c714058d12a364c1b6499c (diff)
downloadjgit-e0a3091af74846b697b5a34da0d7807fe4539e5c.tar.gz
jgit-e0a3091af74846b697b5a34da0d7807fe4539e5c.zip
Introduce "never" as parseable date
For configuration parameter like "gc.pruneexpire" we need to understand the value "never". Never is handled as a date so far into the future that it will never happen. The actual value currently used is the constant GitDateParser.NEVER. Change-Id: I7744eaee9bf5026da517151c212c88325c348d6c Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserTest.java')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserTest.java
index 98e84fed83..6b0632aef0 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserTest.java
@@ -77,6 +77,17 @@ public class GitDateParserTest {
}
@Test
+ public void never() throws ParseException {
+ GregorianCalendar cal = new GregorianCalendar(SystemReader
+ .getInstance().getTimeZone(), SystemReader.getInstance()
+ .getLocale());
+ Date parse = GitDateParser.parse("never", cal);
+ Assert.assertEquals(GitDateParser.NEVER, parse);
+ parse = GitDateParser.parse("never", null);
+ Assert.assertEquals(GitDateParser.NEVER, parse);
+ }
+
+ @Test
public void now() throws ParseException {
String dateStr = "2007-02-21 15:35:00 +0100";
Date refDate = SystemReader.getInstance()