aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserBadlyFormattedTest.java
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2013-11-05 09:29:13 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2013-11-05 09:29:13 +0100
commit35331a916a4feaae59ccc41e644377b0511a291c (patch)
tree846370e2006906618e137383b105cb14a3ef0f26 /org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserBadlyFormattedTest.java
parentb686fa45b6e4960dfa0ef1b1897505aec98b9bea (diff)
downloadjgit-35331a916a4feaae59ccc41e644377b0511a291c.tar.gz
jgit-35331a916a4feaae59ccc41e644377b0511a291c.zip
Also use MockSystemReader in GitDateParserBadlyFormattedTest
All tests should use MockSystemReader to isolate them from the underlying platform specifics. GitDateParserBadlyFormattedTest wasn't using MockSystemReader which induced Bug 420772 as a side effect since GitDateParser caches SimpleDateFormat instances without regarding their locale. This will be fixed in another change Bug: 420772 Change-Id: I798e55d05730a71bb0326f80aea5488541d6c1f2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserBadlyFormattedTest.java')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserBadlyFormattedTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserBadlyFormattedTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserBadlyFormattedTest.java
index 09389591e0..e0e99a14c2 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserBadlyFormattedTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateParserBadlyFormattedTest.java
@@ -48,6 +48,9 @@ import java.text.ParseException;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.eclipse.jgit.junit.MockSystemReader;
+import org.junit.After;
+import org.junit.Before;
import org.junit.experimental.theories.DataPoints;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
@@ -60,6 +63,17 @@ import org.junit.runner.RunWith;
public class GitDateParserBadlyFormattedTest {
private String dateStr;
+ @Before
+ public void setUp() {
+ MockSystemReader mockSystemReader = new MockSystemReader();
+ SystemReader.setInstance(mockSystemReader);
+ }
+
+ @After
+ public void tearDown() {
+ SystemReader.setInstance(null);
+ }
+
public GitDateParserBadlyFormattedTest(String dateStr) {
this.dateStr = dateStr;
}