Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8158880

test/java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java fail with zh_CN locale

    Details

    • Subcomponent:
    • Resolved In Build:
      b147
    • CPU:
      x86_64

      Description

      Test java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java failing in non-english locales


        Activity

        Hide
        okutsu Masayoshi Okutsu added a comment -
        Looks like this test needs to specify a Locale explicitly where the expected text data is valid.
        Show
        okutsu Masayoshi Okutsu added a comment - Looks like this test needs to specify a Locale explicitly where the expected text data is valid.
        Hide
        ntv Nadeesh Tv (Inactive) added a comment -
        As Mentioned by Masayoshi this is a test case issue.
        I need to pass / will set the default locale as en_US by adding a testSetup method
        Show
        ntv Nadeesh Tv (Inactive) added a comment - As Mentioned by Masayoshi this is a test case issue. I need to pass / will set the default locale as en_US by adding a testSetup method
        Hide
        rriggs Roger Riggs added a comment -
        This issue has also appeared on MacOSX in the test system.
        In at least one case, Locale.getDefault() is Locale.US but the Locale returned from DateTimeFormatter.getLocale() is "en_SE".

        DateTimeFormatter initializes the locale from Locale.getDefault(Locale.Category.FORMAT)).
        The system has a configuration is suspect as having the Category.FORMAT value set differently than the LANG version.

        In either case, the tests should explicitly set the locale as needed in the DateTimeFormatter
        and not rely on the System specific locale settings.
        Show
        rriggs Roger Riggs added a comment - This issue has also appeared on MacOSX in the test system. In at least one case, Locale.getDefault() is Locale.US but the Locale returned from DateTimeFormatter.getLocale() is "en_SE". DateTimeFormatter initializes the locale from Locale.getDefault(Locale.Category.FORMAT)). The system has a configuration is suspect as having the Category.FORMAT value set differently than the LANG version. In either case, the tests should explicitly set the locale as needed in the DateTimeFormatter and not rely on the System specific locale settings.
        Hide
        alanbur Alan Burlison added a comment -
        I've seen this as well, on Solaris 12 x86, setting the locale in the shell before running the test also stops the error:

        $ locale
        LANG=en_GB.UTF-8
        LC_CTYPE="en_GB.UTF-8"
        LC_NUMERIC="en_GB.UTF-8"
        LC_TIME="en_GB.UTF-8"
        LC_COLLATE="en_GB.UTF-8"
        LC_MONETARY="en_GB.UTF-8"
        LC_MESSAGES="en_GB.UTF-8"
        LC_ALL=

        $ jtrerun -t java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java 2>&1 | grep AssertionError
        java.lang.AssertionError: expected [PT] but found [GMT-08:00]
        java.lang.AssertionError: expected [ET] but found [GMT-05:00]
        java.lang.AssertionError: expected [2015-11-01 00:30:00 PDT] but found [2015-11-01 00:30:00 GMT-07:00]
        java.lang.AssertionError: expected [2015-11-01 01:30:00 PDT] but found [2015-11-01 01:30:00 GMT-07:00]
        java.lang.AssertionError: expected [2015-11-01 02:30:00 PST] but found [2015-11-01 02:30:00 GMT-08:00]
        java.lang.AssertionError: expected [2015-11-01 00:30:00 PDT] but found [2015-11-01 00:30:00 GMT-07:00]
        java.lang.AssertionError: expected [2015-11-01 01:30:00 PT] but found [2015-11-01 01:30:00 GMT-08:00]
        java.lang.AssertionError: expected [2015-11-01 02:30:00 PST] but found [2015-11-01 02:30:00 GMT-08:00]
        $

        $ LC_CTYPE=PST jtrerun -t java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java 2>&1 | grep AssertionError
        $
        Show
        alanbur Alan Burlison added a comment - I've seen this as well, on Solaris 12 x86, setting the locale in the shell before running the test also stops the error: $ locale LANG=en_GB.UTF-8 LC_CTYPE="en_GB.UTF-8" LC_NUMERIC="en_GB.UTF-8" LC_TIME="en_GB.UTF-8" LC_COLLATE="en_GB.UTF-8" LC_MONETARY="en_GB.UTF-8" LC_MESSAGES="en_GB.UTF-8" LC_ALL= $ jtrerun -t java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java 2>&1 | grep AssertionError java.lang.AssertionError: expected [PT] but found [GMT-08:00] java.lang.AssertionError: expected [ET] but found [GMT-05:00] java.lang.AssertionError: expected [2015-11-01 00:30:00 PDT] but found [2015-11-01 00:30:00 GMT-07:00] java.lang.AssertionError: expected [2015-11-01 01:30:00 PDT] but found [2015-11-01 01:30:00 GMT-07:00] java.lang.AssertionError: expected [2015-11-01 02:30:00 PST] but found [2015-11-01 02:30:00 GMT-08:00] java.lang.AssertionError: expected [2015-11-01 00:30:00 PDT] but found [2015-11-01 00:30:00 GMT-07:00] java.lang.AssertionError: expected [2015-11-01 01:30:00 PT] but found [2015-11-01 01:30:00 GMT-08:00] java.lang.AssertionError: expected [2015-11-01 02:30:00 PST] but found [2015-11-01 02:30:00 GMT-08:00] $ $ LC_CTYPE=PST jtrerun -t java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java 2>&1 | grep AssertionError $
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/6c7d79a051f6
        User: ntv
        Date: 2016-11-22 08:24:01 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/6c7d79a051f6 User: ntv Date: 2016-11-22 08:24:01 +0000
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/6c7d79a051f6
        User: lana
        Date: 2016-11-30 21:39:08 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/6c7d79a051f6 User: lana Date: 2016-11-30 21:39:08 +0000

          People

          • Assignee:
            bgopularam Bhanu Prakash Gopularam
            Reporter:
            yzhou Daisy Zhou
          • Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: