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

[lang] test.time fails in Japanese (non-us) locale.

    XMLWordPrintableJSON

Details

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

    • 22245

    Description

      test.time fails in Japanese locale.

      The tests are DateUtilsTest.testParseCVS() and
      DateFormatUtilsTest.testSMTP().

      The cause is that these tests depend on US locale but use
      default locale.

      By the way, does parseCVS() needs Locale arg?
      I think "CVS format" means that the language is English.

      ant test.time log:

      test.time:
      [echo] Running time package tests ...
      [java] .E.E.E.E.E.E.E......F..............
      [java] Time: 5.126
      [java] There were 7 errors:
      [java] 1)
      testConstructor(org.apache.commons.lang.time.DateUtilsTest)java.text.ParseException:
      Unparseable date: "February 12, 2002 12:34:56.789"
      [java] at java.text.DateFormat.parse(DateFormat.java:334)
      [java] at
      org.apache.commons.lang.time.DateUtilsTest.setUp(DateUtilsTest.java:105)
      [java] 2)
      testRound(org.apache.commons.lang.time.DateUtilsTest)java.text.ParseException:
      Unparseable date: "February 12, 2002 12:34:56.789"
      [java] at java.text.DateFormat.parse(DateFormat.java:334)
      [java] at
      org.apache.commons.lang.time.DateUtilsTest.setUp(DateUtilsTest.java:105)
      [java] 3)
      testTruncate(org.apache.commons.lang.time.DateUtilsTest)java.text.ParseException:
      Unparseable date: "February 12, 2002 12:34:56.789"
      [java] at java.text.DateFormat.parse(DateFormat.java:334)
      [java] at
      org.apache.commons.lang.time.DateUtilsTest.setUp(DateUtilsTest.java:105)
      [java] 4)
      testParseCVS(org.apache.commons.lang.time.DateUtilsTest)java.text.ParseException:
      Unparseable date: "February 12, 2002 12:34:56.789"
      [java] at java.text.DateFormat.parse(DateFormat.java:334)
      [java] at
      org.apache.commons.lang.time.DateUtilsTest.setUp(DateUtilsTest.java:105)
      [java] 5)
      testIteratorEx(org.apache.commons.lang.time.DateUtilsTest)java.text.ParseException:
      Unparseable date: "February 12, 2002 12:34:56.789"
      [java] at java.text.DateFormat.parse(DateFormat.java:334)
      [java] at
      org.apache.commons.lang.time.DateUtilsTest.setUp(DateUtilsTest.java:105)
      [java] 6)
      testWeekIterator(org.apache.commons.lang.time.DateUtilsTest)java.text.ParseException:
      Unparseable date: "February 12, 2002 12:34:56.789"
      [java] at java.text.DateFormat.parse(DateFormat.java:334)
      [java] at
      org.apache.commons.lang.time.DateUtilsTest.setUp(DateUtilsTest.java:105)
      [java] 7)
      testMonthIterator(org.apache.commons.lang.time.DateUtilsTest)java.text.ParseException:
      Unparseable date: "February 12, 2002 12:34:56.789"
      [java] at java.text.DateFormat.parse(DateFormat.java:334)
      [java] at
      org.apache.commons.lang.time.DateUtilsTest.setUp(DateUtilsTest.java:105)
      [java] There was 1 failure:
      [java] 1)
      testSMTP(org.apache.commons.lang.time.DateFormatUtilsTest)junit.framework.ComparisonFailure:
      expected:<Sun, 08 Jun...> but was:<日, 08 6...>
      [java] at
      org.apache.commons.lang.time.DateFormatUtilsTest.testSMTP(DateFormatUtilsTest.java:200)
      [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: 27, Failures: 1, Errors: 7

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--patch.diff
          4 kB
          KANEUCHI Tetsuya

        Activity

          People

            Unassigned Unassigned
            tetsuyak@ka2.so-net.ne.jp KANEUCHI Tetsuya
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: