Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-47

test.lang fails if compiled with non iso-8859-1 locales

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • None
    • None
    • Operating System: other
      Platform: Other

    • 18836

    Description

      Linux platform JDK 1.4.1_02

      $ export LANG=C ; ant clean && ant dist && ant test

      test.lang:
      [echo] Running lang package tests ...
      [java] .........................................
      [java] .........................................
      [java] .........................................
      [java] .........................................
      [java] ...........................F.F
      [java] Time: 0.402
      [java] There were 2 failures:
      [java] 1)
      testEscapeHtml(org.apache.commons.lang.StringEscapeUtilsTest)junit.framework.ComparisonFailure:
      languages expected:<...ccedil...> but was:<...#65533...>
      [java] at
      org.apache.commons.lang.StringEscapeUtilsTest.testEscapeHtml(StringEscapeUtilsTest.java:161)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] 2)
      testHtmlunescape(org.apache.commons.lang.StringEscapeUtilsTest)junit.framework.ComparisonFailure:
      languages expected:<...?...> but was:<...ç...>
      [java] at
      org.apache.commons.lang.StringEscapeUtilsTest.testHtmlunescape(StringEscapeUtilsTest.java:168)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      [java] FAILURES!!!
      [java] Tests run: 192, Failures: 2, Errors: 0

      $ export LANG=en_US ; ant clean && ant dist && ant test

      [ this one works ]

      $ export LANG=en_US.utf-8 ; ant clean && ant dist && ant test

      [ fails, with a slightly different error #2: ]

      [java] 2)
      testHtmlunescape(org.apache.commons.lang.StringEscapeUtilsTest)junit.framework.ComparisonFailure:
      languages expected:<...�...> but was:<...ç...>

      LANG's setting for "ant test" does not appear to matter. If LANG=C for "ant
      dist", "ant test" will fail even if LANG=en_US.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mrsam@courier-mta.org Sam Varshavchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: