Skip to content

DefaultDateTypeAdapterTest fails on JDK 8 and 17 #2199

Closed
@eamonnmcmanus

Description

[ERROR] com.google.gson.internal.bind.DefaultDateTypeAdapterTest.testParsingDatesFormattedWithSystemLocale  Time elapsed: 0.015 s  <<< ERROR!
com.google.gson.JsonSyntaxException: Failed parsing '1 janv. 1970 à 00:00:00' as Date; at path $
        at com.google.gson.internal.bind.DefaultDateTypeAdapter.deserializeToDate(DefaultDateTypeAdapter.java:164)
        at com.google.gson.internal.bind.DefaultDateTypeAdapter.read(DefaultDateTypeAdapter.java:147)
        at com.google.gson.internal.bind.DefaultDateTypeAdapter.read(DefaultDateTypeAdapter.java:47)
        at com.google.gson.TypeAdapter.fromJson(TypeAdapter.java:263)
        at com.google.gson.TypeAdapter.fromJson(TypeAdapter.java:279)
        at com.google.gson.internal.bind.DefaultDateTypeAdapterTest.assertParsed(DefaultDateTypeAdapterTest.java:210)
        at com.google.gson.internal.bind.DefaultDateTypeAdapterTest.testParsingDatesFormattedWithSystemLocale(DefaultDateTypeAdapterTest.java:85)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at junit.framework.TestCase.runTest(TestCase.java:177)
        at junit.framework.TestCase.runBare(TestCase.java:142)
        at junit.framework.TestResult$1.protect(TestResult.java:122)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at junit.framework.TestResult.run(TestResult.java:125)
        at junit.framework.TestCase.run(TestCase.java:130)
        at junit.framework.TestSuite.runTest(TestSuite.java:241)
        at junit.framework.TestSuite.run(TestSuite.java:236)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:377)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:284)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:248)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:167)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
        at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
        at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
Caused by: java.text.ParseException: Failed to parse date ["1 janv. 1970 à 00:00:00"]: Invalid number: 1 ja
        at com.google.gson.internal.bind.util.ISO8601Utils.parse(ISO8601Utils.java:279)
        at com.google.gson.internal.bind.DefaultDateTypeAdapter.deserializeToDate(DefaultDateTypeAdapter.java:162)
        ... 27 more
Caused by: java.lang.NumberFormatException: Invalid number: 1 ja
        at com.google.gson.internal.bind.util.ISO8601Utils.parseInt(ISO8601Utils.java:323)
        at com.google.gson.internal.bind.util.ISO8601Utils.parse(ISO8601Utils.java:133)
        ... 28 more

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions