commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lam nguyen phuc <ruado1...@gmail.com>
Subject [LANG] FastDateParserTest is failing
Date Fri, 09 Nov 2012 06:13:30 GMT
Hi,

I cloned the commons-lang repository from github and encountered a failed
test in FastDateParserTest. Here is the output from junit:

Testcase: testParses took 0.015 sec
    FAILED
ja_JP 1940 G/y/M/d/h/a/E/Z America/New_York expected:<Sat Feb 10 12:20:00
SGT 1940> but was:<Sat Feb 10 12:00:00 SGT 1940>
junit.framework.AssertionFailedError: ja_JP 1940 G/y/M/d/h/a/E/Z
America/New_York expected:<Sat Feb 10 12:20:00 SGT 1940> but was:<Sat Feb
10 12:00:00 SGT 1940>
    at
org.apache.commons.lang3.time.FastDateParserTest.testParses(FastDateParserTest.java:221)

Digging into the test code, I found out that the format patterns (long and
short forms) did not take minute into account, thus causing the test to
fail in some certain locale (in this case it is the Japanese locale).
Changing the patterns as follows effectively fixes the failing test:

    private static final String SHORT_FORMAT_NOERA = "y/M/d/h/a/m/E/Z";
    private static final String LONG_FORMAT_NOERA =
"yyyy/MMMM/dddd/hhhh/mmmm/aaaa/EEEE/ZZZZ";

Regards,
Harry

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message