discomarathon / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Can't build gson-1.3 in timezones other than PST: #184

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set the system timezone to something other than Pacific (I'm in the
Eastern timezone).
2. Build gson via Maven.

What is the expected output? What do you see instead?

Expecting all tests to pass so . Serialized times carry their timezones
with them, thus the times are offset from expected values. This is probably
correct behavior in production, so the problem is with the test. For
instance, in the Eastern timezone:

-------------------------------------------------------------------------------
Test set: com.google.gson.functional.DefaultTypeAdaptersTest
-------------------------------------------------------------------------------
Tests run: 38, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.157 sec
<<< FAILURE!
testDefaultJavaSqlTimestampSerialization(com.google.gson.functional.DefaultTypeA
daptersTest)
 Time elapsed: 0.016 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<"Dec 3, 2009 [1]:18:02 PM">
but was:<"Dec 3, 2009 [4]:18:02 PM">
    at junit.framework.Assert.assertEquals(Assert.java:81)
    at junit.framework.Assert.assertEquals(Assert.java:87)
    at
com.google.gson.functional.DefaultTypeAdaptersTest.testDefaultJavaSqlTimestampSe
rialization(DefaultTypeAdaptersTest.java:239)

testDefaultJavaSqlTimeSerialization(com.google.gson.functional.DefaultTypeAdapte
rsTest)
 Time elapsed: 0 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<"0[1]:18:02 PM"> but
was:<"0[4]:18:02 PM">
    at junit.framework.Assert.assertEquals(Assert.java:81)
    at junit.framework.Assert.assertEquals(Assert.java:87)
    at
com.google.gson.functional.DefaultTypeAdaptersTest.testDefaultJavaSqlTimeSeriali
zation(DefaultTypeAdaptersTest.java:252)

What version of the product are you using? On what operating system?

gson-1.3, SVN rev. 518 on 32-bit Windows XP w/cygwin.

Please provide any additional information below.

One workaround is to change the local system timezone to PST; this causes
all unit tests to pass.

Original issue reported on code.google.com by mich...@barnathan.name on 28 Dec 2009 at 4:09

GoogleCodeExporter commented 9 years ago
Thanks for the bug report.
Fixed in r519 by using PST time-zone as default in test setup.

Original comment by inder123 on 8 Jan 2010 at 6:54

GoogleCodeExporter commented 9 years ago
couldn't get r519 to build. the last revision that i got to build is r513, 
though i 
didn't try everything between r519 and head (which is r537, which i think is 
the 
closest thing to release 1.4). anyone know which revision is release 1.4 ?

Original comment by lytles...@gmail.com on 24 Feb 2010 at 2:09

GoogleCodeExporter commented 9 years ago
You should be able to use the head version. We try to never regress the head 
branch.

Original comment by inder123 on 24 Feb 2010 at 9:27