commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <>
Subject [jira] [Commented] (LANG-942) Test failure in FastDateParserTest and FastDateFormat_ParserTest when building with JDK8
Date Sat, 04 Jan 2014 17:42:53 GMT


Benedikt Ritter commented on LANG-942:

Right now, the easiest way to fix it would be removing the EDT and Eastern Daylight Time from
the tests. However, that would leave parts of the code without test coverage (the code does
different things for time zones that start with - or +, time zones that start with GMT, and
all the other time zones).

The question here is, what is the correct result? This should be expressed in the test and
the implementation has to be changed to conform to the test. What I don't unterstand is what
exactly Eastern Daylight Time is. Is it a time zone by itself? Or is it a grouping of time
zones? It looks like IET and US/Michigan have different times, so the question appears what
the expected result is, when parsing something like:

"2003-07-10T16:33:20.000 Eastern Daylight Time"

Therefore they cannot be used as keys in a map anyway.

Yes, but the problem is: how do we map "Eastern Daylight Time" in a string representation
of a Date, if Eastern Daylight Time can mean several time zones. I'd say we should do the
same like {{java.util.SimpleDateFromat}} does in this case.

> Test failure in FastDateParserTest and FastDateFormat_ParserTest when building with JDK8
> ----------------------------------------------------------------------------------------
>                 Key: LANG-942
>                 URL:
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.time.*
>    Affects Versions: 3.2
>         Environment: JDK8
>            Reporter: Benedikt Ritter
>             Fix For: 3.2.1
> The following failure is thrown when using JDK 8:
> {code}
> -------------------------------------------------------------------------------
> Test set: org.apache.commons.lang3.time.FastDateFormat_ParserTest
> -------------------------------------------------------------------------------
> Tests run: 29, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.315 sec <<<
FAILURE! - in org.apache.commons.lang3.time.FastDateFormat_ParserTest
> testParseZone(org.apache.commons.lang3.time.FastDateFormat_ParserTest)  Time elapsed:
0.005 sec  <<< FAILURE!
> java.lang.AssertionError: expected:<Thu Jul 10 22:33:20 CEST 2003> but was:<Thu
Jul 10 23:33:20 CEST 2003>
> 	at
> 	at org.junit.Assert.failNotEquals(
> 	at org.junit.Assert.assertEquals(
> 	at org.junit.Assert.assertEquals(
> 	at org.apache.commons.lang3.time.FastDateParserTest.testParseZone(
> 	[...]
> {code}
> It is caused by the following assertion in FastDateParserTest (from which FastDateFormat_ParserTest
> {code:java}
> assertEquals(cal.getTime(), fdf.parse("2003-07-10T16:33:20.000 Eastern Daylight Time"));
> {code}
> {{FastDateParserTest}} fails with the same error.

This message was sent by Atlassian JIRA

View raw message