Set locale provider to JRE,CLDR for tests to have compatible date formatting in JDK 9+

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839199 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2018-08-26 11:41:31 +00:00
parent de6280700b
commit 63d904acb2
2 changed files with 5 additions and 1 deletions

View 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 {

View 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)));
}
}