commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r492910 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java
Date Fri, 05 Jan 2007 05:30:07 GMT
Author: bayard
Date: Thu Jan  4 21:30:04 2007
New Revision: 492910

URL: http://svn.apache.org/viewvc?view=rev&rev=492910
Log:
Adding test for LANG-312. It passes for me, so I'm interested in whether it fails for anybody
else. 

Modified:
    jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java?view=diff&rev=492910&r1=492909&r2=492910
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java
Thu Jan  4 21:30:04 2007
@@ -19,6 +19,7 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Modifier;
 import java.util.Calendar;
+import java.util.Date;
 import java.util.Locale;
 import java.util.TimeZone;
 
@@ -209,6 +210,19 @@
                         DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(),
                         DateFormatUtils.SMTP_DATETIME_FORMAT.getLocale());
         assertEquals("Sun, 08 Jun 2003 13:11:12 +0000", text);
+    }
+
+    public void testLang312() {
+        String pattern = "dd/MM/yyyy";
+        TimeZone timeZone = TimeZone.getTimeZone("CET");
+        Locale locale = Locale.GERMANY;
+
+        Calendar cal = Calendar.getInstance(timeZone, locale);
+        cal.set(1948, 3, 19);
+        assertEquals("19/04/1948", DateFormatUtils.format( cal.getTime(), pattern, timeZone,
locale ) );
+
+        Date date = new Date(48, 3, 19);
+        assertEquals("19/04/1948", DateFormatUtils.format( date, pattern, timeZone, locale
) );
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message