updated parseCVS test to use US locale to avoid non-English format problems
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137581 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
91a7f67d80
commit
f325bbd0d3
|
@ -196,17 +196,20 @@ public class DateFormatUtilsTest extends TestCase {
|
|||
Calendar cal = Calendar.getInstance(timeZone);
|
||||
cal.set(2003,5,8,10,11,12);
|
||||
String text = DateFormatUtils.format(cal.getTime(),
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(), timeZone);
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(), timeZone,
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getLocale());
|
||||
assertEquals("Sun, 08 Jun 2003 10:11:12 -0300", text);
|
||||
text = DateFormatUtils.format(cal.getTime().getTime(),
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(), timeZone);
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(), timeZone,
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getLocale());
|
||||
assertEquals("Sun, 08 Jun 2003 10:11:12 -0300", text);
|
||||
text = DateFormatUtils.SMTP_DATETIME_FORMAT.format(cal);
|
||||
assertEquals("Sun, 08 Jun 2003 10:11:12 -0300", text);
|
||||
|
||||
// format UTC
|
||||
text = DateFormatUtils.formatUTC(cal.getTime().getTime(),
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern());
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(),
|
||||
DateFormatUtils.SMTP_DATETIME_FORMAT.getLocale());
|
||||
assertEquals("Sun, 08 Jun 2003 13:11:12 +0000", text);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
@ -99,8 +100,8 @@ public class DateUtilsTest extends TestCase {
|
|||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
dateParser = new SimpleDateFormat("MMM dd, yyyy");
|
||||
dateTimeParser = new SimpleDateFormat("MMM dd, yyyy H:mm:ss.SSS");
|
||||
dateParser = new SimpleDateFormat("MMM dd, yyyy", Locale.ENGLISH);
|
||||
dateTimeParser = new SimpleDateFormat("MMM dd, yyyy H:mm:ss.SSS", Locale.ENGLISH);
|
||||
|
||||
date1 = dateTimeParser.parse("February 12, 2002 12:34:56.789");
|
||||
date2 = dateTimeParser.parse("November 18, 2001 1:23:11.321");
|
||||
|
|
Loading…
Reference in New Issue