Skip to content

Commit 8611e83

Browse files
author
Ralph Bergmann
committed
Add locale to HttpHeaderParserTest.rfc1123Date(long millis)
There is a DateParseException when the test runs on a german system org.apache.http.impl.cookie.DateParseException: Unable to parse the date So., 21 Sep. 2014 22:43:50 MESZ Change-Id: I8a52af1dfc24d82f8f6157ff7d661014f1ee8d26
1 parent 9a311e2 commit 8611e83

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/src/com/android/volley/toolbox/HttpHeaderParserTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
import com.android.volley.Cache;
2222
import com.android.volley.NetworkResponse;
2323

24+
import junit.framework.TestCase;
25+
2426
import java.text.DateFormat;
2527
import java.text.SimpleDateFormat;
2628
import java.util.Date;
2729
import java.util.HashMap;
30+
import java.util.Locale;
2831
import java.util.Map;
2932

30-
import junit.framework.TestCase;
31-
3233
@SmallTest
3334
public class HttpHeaderParserTest extends TestCase {
3435

@@ -162,7 +163,7 @@ private void assertEqualsWithin(long expected, long value, long fudgeFactor) {
162163
}
163164

164165
private static String rfc1123Date(long millis) {
165-
DateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
166+
DateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.ENGLISH);
166167
return df.format(new Date(millis));
167168
}
168169

0 commit comments

Comments
 (0)