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

Tests should not leave locales to chance

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 18
    • tools
    • None

      A considerable portion of javadoc tests assume the locale of the system under test. Such a test typically compares the output with that of expected on an English locale.

      A test must not assume the locale of the system under test. Otherwise, such a test might fail if the system under test has a different locale that the test assumes.

      To defend against such failures, a test could combine either of these strategies:

       * Report if the actual locale differs from the assumed one (e.g. throw SkippedException)
       * Contain only locale-agnostic assertions (i.e. either both the expected and actual output are generated for the assumed locale or both are guaranteed to not change with a locale)
       * Enforce the assumed locale by configuring the system under test

            Unassigned Unassigned
            prappo Pavel Rappo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: