Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestPureDate.java fails on Java 11.0.9 #55

Open
ghost opened this issue Nov 13, 2020 · 0 comments
Open

TestPureDate.java fails on Java 11.0.9 #55

ghost opened this issue Nov 13, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 13, 2020

Bug Report

In Java 11.0.9 the use of timezone "CST" no longer works causing the test on line 55 of TestPureDate.java to fail:

Assert.assertEquals("2013-12-31 19:01:01.070 CST", date.format("[CST]yyyy-MM-dd HH:mm:ss.SSS z"));

Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.388 sec <<< FAILURE! - in org.finos.legend.pure.m4.coreinstance.primitive.date.TestPureDate
testFormatWithTimeZoneShift(org.finos.legend.pure.m4.coreinstance.primitive.date.TestPureDate)  Time elapsed: 0.029 sec  <<< FAILURE!

This should instead be

Assert.assertEquals("2013-12-31 19:01:01.070 GMT-06:00", date.format("[CST]yyyy-MM-dd HH:mm:ss.SSS z"));

Steps to Reproduce:

  1. Using Java 11.0.9
  2. run mvn -Dtest=TestPureDate test
  3. The test on line 55 fails
  4. Using Java 11.0.7
  5. run mvn -Dtest=TestPureDate test
  6. The test on line 55 passes

Expected Result:

The test should pass consistently on 11.0.7 and 11.0.9

Actual Result:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.finos.legend.pure.m4.coreinstance.primitive.date.TestPureDate
Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.388 sec <<< FAILURE! - in org.finos.legend.pure.m4.coreinstance.primitive.date.TestPureDate
testFormatWithTimeZoneShift(org.finos.legend.pure.m4.coreinstance.primitive.date.TestPureDate)  Time elapsed: 0.029 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<...-12-31 19:01:01.070 [CST]> but was:<...-12-31 19:01:01.070 [GMT-06:00]>
        at org.junit.Assert.assertEquals(Assert.java:117)
        at org.junit.Assert.assertEquals(Assert.java:146)
        at org.finos.legend.pure.m4.coreinstance.primitive.date.TestPureDate.testFormatWithTimeZoneShift(TestPureDate.java:55)

Results :

Failed tests:
  TestPureDate.testFormatWithTimeZoneShift:55 expected:<...-12-31 19:01:01.070 [CST]> but was:<...-12-31 19:01:01.070 [GMT-06:00]>

Environment:

Version: master after commit f98651e
OS: Ubuntu 18.04.5 LTS and Windows 10 (baremetal)
Java: 11.0.7 and 11.0.9

Additional Context:

As this issue is version specific I believe it needs a deeper dive into the use of java.util.TimeZone across the project. In this case used on line 255 of DateFormat.java

I am happy to open a PR to resolve across the board; let me know if you would like me to proceed

Ref: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/TimeZone.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants