From: PJ Fanning Date: Tue, 30 Aug 2022 11:10:46 +0000 (+0000) Subject: test for TIKA-3163 X-Git-Tag: REL_5_2_3~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=30a0a4362ac38d97f5214a3b558486f881ab6958;p=poi.git test for TIKA-3163 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903775 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 4f12364294..7b5093d13e 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -96,7 +96,9 @@ import org.apache.poi.xssf.SXSSFITestDataProvider; import org.apache.poi.xssf.XLSBUnsupportedException; import org.apache.poi.xssf.XSSFITestDataProvider; import org.apache.poi.xssf.XSSFTestDataSamples; +import org.apache.poi.xssf.eventusermodel.XSSFReader; import org.apache.poi.xssf.model.CalculationChain; +import org.apache.poi.xssf.model.StylesTable; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.extensions.XSSFCellFill; import org.apache.xmlbeans.XmlException; @@ -3724,4 +3726,22 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } } } + + @Test + void testTika3163() throws Exception { + File file = XSSFTestDataSamples.getSampleFile("CVLKRA-KYC_Download_File_Structure_V3.1.xlsx"); + try ( + FileInputStream fis = new FileInputStream(file); + XSSFWorkbook workbook = new XSSFWorkbook(fis) + ) { + assertNotNull(workbook.getStylesSource()); + assertEquals(23, workbook.getStylesSource().getFonts().size()); + } + try (OPCPackage pkg = OPCPackage.open(file, PackageAccess.READ)) { + XSSFReader reader = new XSSFReader(pkg); + StylesTable stylesTable = reader.getStylesTable(); + assertNotNull(stylesTable); + assertEquals(23, stylesTable.getFonts().size()); + } + } } \ No newline at end of file diff --git a/test-data/spreadsheet/CVLKRA-KYC_Download_File_Structure_V3.1.xlsx b/test-data/spreadsheet/CVLKRA-KYC_Download_File_Structure_V3.1.xlsx new file mode 100644 index 0000000000..5a4c7c205a Binary files /dev/null and b/test-data/spreadsheet/CVLKRA-KYC_Download_File_Structure_V3.1.xlsx differ