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

Insufficient datetime pattern in FastDateParserTest

    XMLWordPrintableJSON

Details

    • Test
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • lang.time.*
    • None

    Description

      One of the test cases in FastDateParserTest is failing due to insufficient datetime pattern. Here is the output from junit:

      Testcase: testParses took 0.015 sec
      FAILED
      ja_JP 1940 G/y/M/d/h/a/E/Z America/New_York expected:<Sat Feb 10 12:20:00 SGT 1940> but was:<Sat Feb 10 12:00:00 SGT 1940>
      junit.framework.AssertionFailedError: ja_JP 1940 G/y/M/d/h/a/E/Z America/New_York expected:<Sat Feb 10 12:20:00 SGT 1940> but was:<Sat Feb 10 12:00:00 SGT 1940>
      at org.apache.commons.lang3.time.FastDateParserTest.testParses(FastDateParserTest.java:221)

      To fix the failing test, it is necessary to change two date time patterns (short and long forms) as follows:

      private static final String SHORT_FORMAT_NOERA = "y/M/d/h/a/m/E/Z";
      private static final String LONG_FORMAT_NOERA = "yyyy/MMMM/dddd/hhhh/mmmm/aaaa/EEEE/ZZZZ";

      Attachments

        1. FastDateParserTest.diff
          1 kB
          nguyen phuc lam

        Activity

          People

            chonton Charles Honton
            ruado1987 nguyen phuc lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: