From f22056ccb21aefdc5da12767e3bd85b98f1e4f4e Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 13 Nov 2024 12:37:44 +0100 Subject: [PATCH] add sxssf test --- .../pjfanning/xlsx/StreamingReaderTest.java | 23 ++++++++++++++++++ src/test/resources/poi-69433.xlsx | Bin 0 -> 3668 bytes 2 files changed, 23 insertions(+) create mode 100644 src/test/resources/poi-69433.xlsx diff --git a/src/test/java/com/github/pjfanning/xlsx/StreamingReaderTest.java b/src/test/java/com/github/pjfanning/xlsx/StreamingReaderTest.java index 2a365f2c..d188e458 100644 --- a/src/test/java/com/github/pjfanning/xlsx/StreamingReaderTest.java +++ b/src/test/java/com/github/pjfanning/xlsx/StreamingReaderTest.java @@ -1681,6 +1681,29 @@ public void testMissingSheet() throws Exception { } } + @Test + public void testSXSSF() throws Exception { + // tests a file create using POI SXSSF + // https://bz.apache.org/bugzilla/show_bug.cgi?id=69433 + try ( + InputStream inputStream = new FileInputStream("src/test/resources/poi-69433.xlsx"); + Workbook wb = StreamingReader.builder().open(inputStream) + ) { + Iterator sheetIterator = wb.sheetIterator(); + + final AtomicInteger cellCount = new AtomicInteger(); + sheetIterator.forEachRemaining(sheet -> { + for (Row r : sheet) { + r.cellIterator().forEachRemaining(cell -> { + assertNotNull(cell); + cellCount.incrementAndGet(); + }); + } + }); + assertEquals(12, cellCount.get()); + } + } + private void testReadFile(boolean useReadOnlySst) throws Exception { try ( InputStream inputStream = new FileInputStream("src/test/resources/stream_reader_test.xlsx"); diff --git a/src/test/resources/poi-69433.xlsx b/src/test/resources/poi-69433.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..edba1807717eaa392d7d41b76475ac7463bb5eed GIT binary patch literal 3668 zcmai12RN1OAI2faK1NoFL~)Rrk?fhhMK;F@2gfEHn~sr{jQTQ4_6XUZ?2uLV`ZyI? zNyv!*c|-d9zOH`nb-mAZz1Q=5-sicW`?-JjqoEAK<-!7Ep3^~z`EXkX?&Jn@ax>NO zc7`F0uX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