diff options
author | PJ Fanning <fanningpj@apache.org> | 2017-07-03 20:56:02 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2017-07-03 20:56:02 +0000 |
commit | 26389768b9f43a04cb668fc3cac968a34aa814e8 (patch) | |
tree | be460a3355e482dc0cb9b1dd217525f25370103c /src/testcases/org | |
parent | c78f22564ff25ade38e42eb7523499fcc40a737c (diff) | |
download | poi-26389768b9f43a04cb668fc3cac968a34aa814e8.tar.gz poi-26389768b9f43a04cb668fc3cac968a34aa814e8.zip |
[Bug 60422] fix data formatter issue with specific format in German locale
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800713 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org')
-rw-r--r-- | src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java b/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java index 679404f141..211f801913 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java +++ b/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java @@ -811,7 +811,6 @@ public class TestDataFormatter { CellReference ref = new CellReference("D47"); Cell cell = wb.getSheetAt(0).getRow(ref.getRow()).getCell(ref.getCol()); - //noinspection deprecation assertEquals(CellType.FORMULA, cell.getCellTypeEnum()); assertEquals("G9:K9 I7:I12", cell.getCellFormula()); @@ -888,18 +887,12 @@ public class TestDataFormatter { ≈ */ @Test public void testBug60422() { - //when this is set to Locale.Germany, the result is - LocaleUtil.setUserLocale(Locale.ROOT); - try { - char euro = '\u20AC'; - DataFormatter df = new DataFormatter(Locale.GERMANY); - String formatString = String.format(Locale.ROOT, - "_-* #,##0.00\\ \"%s\"_-;\\-* #,##0.00\\ \"%s\"_-;_-* \"-\"??\\ \"%s\"_-;_-@_-", - euro, euro, euro); - //this should be 4,33 - assertEquals("4.33 " + euro, df.formatRawCellContents(4.33, 178, formatString)); - } finally { - LocaleUtil.resetUserLocale(); - } + char euro = '\u20AC'; + DataFormatter df = new DataFormatter(Locale.GERMANY); + String formatString = String.format(Locale.ROOT, + "_-* #,##0.00\\ \"%s\"_-;\\-* #,##0.00\\ \"%s\"_-;_-* \"-\"??\\ \"%s\"_-;_-@_-", + euro, euro, euro); + assertEquals("4,33 " + euro, df.formatRawCellContents(4.33, 178, formatString)); + assertEquals("1.234,33 " + euro, df.formatRawCellContents(1234.33, 178, formatString)); } } |