Adding test for LANG-312. It passes for me, so I'm interested in whether it fails for anybody else.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@492910 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
be732f09d7
commit
abb136d51f
|
@ -19,6 +19,7 @@ package org.apache.commons.lang.time;
|
|||
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;
|
||||
|
||||
|
@ -211,4 +212,17 @@ public class DateFormatUtilsTest extends TestCase {
|
|||
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 ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue