OpenJPA
  1. OpenJPA
  2. OPENJPA-1383

tests rely on US date formatting without setting the correct Locale

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M2
    • Fix Version/s: 2.0.0-beta
    • Component/s: None
    • Labels:
      None

      Description

      A few tests fail if built on a non-US locale (using de.AT here):

      java.text.ParseException: Unparseable date: "10/01/2008 1:51 AM"
       at java.text.DateFormat.parse(DateFormat.java:337) 
       at org.apache.openjpa.persistence.query.results.TestJPQLMultiSelectTypedResults.populate(TestJPQLMultiSelectTypedResults.java:73)
       at org.apache.openjpa.persistence.query.results.TestJPQLMultiSelectTypedResults.setUp(TestJPQLMultiSelectTypedResults.java:55)
      

      tests in error:

        testMultipleConstructor(org.apache.openjpa.persistence.query.results.TestJPQLMultiSelectTypedResults)
        testMultipleConstructorMixWithMultiSelect(org.apache.openjpa.persistence.query.results.TestJPQLMultiSelectTypedResults)
        testMultiSelect(org.apache.openjpa.persistence.query.results.TestJPQLMultiSelectTypedResults)
        testMultiSelect(org.apache.openjpa.persistence.criteria.results.TestTypedResults)
        testTypedJPQLQuery(org.apache.openjpa.persistence.criteria.results.TestTypedResults)
        testDateQuery(org.apache.openjpa.persistence.criteria.results.TestTypedResults)
      

      Please manually set the proper Locale in the tests

        Activity

        Hide
        Michael Dick added a comment -

        Checked in changes to use DateFormat.SHORT and Locale.US - let me know if this works for you.

        Show
        Michael Dick added a comment - Checked in changes to use DateFormat.SHORT and Locale.US - let me know if this works for you.
        Hide
        Mark Struberg added a comment -

        retested - works now, txs!

        Show
        Mark Struberg added a comment - retested - works now, txs!
        Hide
        Michael Dick added a comment -

        Glad it worked, thanks Mark.

        Show
        Michael Dick added a comment - Glad it worked, thanks Mark.

          People

          • Assignee:
            Michael Dick
            Reporter:
            Mark Struberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development