commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevencasw...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang/time DateFormatUtilsTest.java DateUtilsTest.java
Date Sun, 10 Aug 2003 13:30:33 GMT
stevencaswell    2003/08/10 06:30:33

  Modified:    lang/src/test/org/apache/commons/lang/time
                        DateFormatUtilsTest.java DateUtilsTest.java
  Log:
  updated parseCVS test to use US locale to avoid non-English format problems
  
  Revision  Changes    Path
  1.4       +6 -3      jakarta-commons/lang/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java
  
  Index: DateFormatUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DateFormatUtilsTest.java	6 Aug 2003 21:13:39 -0000	1.3
  +++ DateFormatUtilsTest.java	10 Aug 2003 13:30:33 -0000	1.4
  @@ -196,17 +196,20 @@
           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);
       }
   
  
  
  
  1.8       +3 -2      jakarta-commons/lang/src/test/org/apache/commons/lang/time/DateUtilsTest.java
  
  Index: DateUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/time/DateUtilsTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DateUtilsTest.java	6 Aug 2003 00:42:56 -0000	1.7
  +++ DateUtilsTest.java	10 Aug 2003 13:30:33 -0000	1.8
  @@ -60,6 +60,7 @@
   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 @@
       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");
  
  
  

Mime
View raw message