]> source.dussan.org Git - poi.git/commitdiff
Set locale provider to JRE,CLDR for tests to have compatible date formatting in JDK 9+
authorDominik Stadler <centic@apache.org>
Sun, 26 Aug 2018 11:41:31 +0000 (11:41 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 26 Aug 2018 11:41:31 +0000 (11:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839199 13f79535-47bb-0310-9956-ffa450edef68

build.gradle
src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java

index c3497c532e45bb4477f3ed1d4bc453b5fad439ef..2ce5f83711120aeea1f90ec4bd97444c7b129e4a 100644 (file)
@@ -138,6 +138,9 @@ subprojects {
         systemProperties['user.dir'] = workingDir
         
         systemProperties['POI.testdata.path'] = '../../test-data'
+        
+        // this is necessary for JDK 9+ to keep formatting dates the same way as in previous JDK-versions
+        systemProperties['java.locale.providers'] = 'JRE,CLDR'
     }
 
     jacoco {
index ef23f36ae47af577d34b37250af6f69b2ab7c2e2..f4e61801a5ff9c6b4cf093170c0cbe29349a067d 100644 (file)
@@ -69,7 +69,8 @@ public class TestExcelStyleDateFormatter {
                                 new StringBuffer(),
                                 new FieldPosition(java.text.DateFormat.MONTH_FIELD)).toString();
                 //System.err.println(result +  " - " + getUnicode(result.charAt(0)));
-                assertEquals("Failed for locale " + locale + " and date " + testDates.get(i) + ", having: " + result,
+                assertEquals("Failed for locale " + locale + ", provider: " + System.getProperty("java.locale.providers") +
+                        " and date " + testDates.get(i) + ", having: " + result,
                         getUnicode(testMap.get(locale).get(i).charAt(0)), getUnicode(result.charAt(0)));
             }
         }