diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-07-15 21:52:32 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-07-15 21:52:32 +0000 |
commit | 87ee700d04af1fea764c0762f0fb5dada4411295 (patch) | |
tree | fadbb626410244764c087b4ed23cc467eed76764 /poi-ooxml/src/test | |
parent | 70bd85fda41f885427e3db8d5b32eb71656f8eb0 (diff) | |
download | poi-87ee700d04af1fea764c0762f0fb5dada4411295.tar.gz poi-87ee700d04af1fea764c0762f0fb5dada4411295.zip |
[github-340] make more use of StandardCharsets. Thanks to XenoAmess. This closes #340
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902755 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml/src/test')
-rw-r--r-- | poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java index 9100040136..66c7ae39e5 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java @@ -74,7 +74,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xml = os.toString("UTF-8"); + String xml = os.toString(StandardCharsets.UTF_8); assertNotNull(xml); assertFalse(xml.isEmpty()); @@ -122,7 +122,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xml = os.toString("UTF-8"); + String xml = os.toString(StandardCharsets.UTF_8); assertNotNull(xml); assertFalse(xml.isEmpty()); @@ -196,7 +196,7 @@ public final class TestXSSFExportToXML { String xml; try (UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream()) { exporter.exportToXML(os, true); - xml = os.toString("UTF-8"); + xml = os.toString(StandardCharsets.UTF_8); } assertNotNull(xml); @@ -258,7 +258,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -302,7 +302,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -337,7 +337,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -376,7 +376,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -402,7 +402,7 @@ public final class TestXSSFExportToXML { UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -480,7 +480,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -558,7 +558,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -589,7 +589,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, false); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -621,7 +621,7 @@ public final class TestXSSFExportToXML { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, true); - String xmlData = os.toString("UTF-8"); + String xmlData = os.toString(StandardCharsets.UTF_8); assertNotNull(xmlData); assertFalse(xmlData.isEmpty()); @@ -647,7 +647,7 @@ public final class TestXSSFExportToXML { UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(os, false); - assertNotNull(os.toString("UTF-8")); + assertNotNull(os.toString(StandardCharsets.UTF_8)); } } } @@ -660,7 +660,7 @@ public final class TestXSSFExportToXML { UnsynchronizedByteArrayOutputStream bos = new UnsynchronizedByteArrayOutputStream(); exporter.exportToXML(bos, true); assertNotNull(DocumentHelper.readDocument(bos.toInputStream())); - String exportedXml = bos.toString("UTF-8"); + String exportedXml = bos.toString(StandardCharsets.UTF_8); assertEquals("<Test><Test>1</Test></Test>", exportedXml.replaceAll("\\s+", "")); } } |