Skip to content

Commit

Permalink
add sxssf test
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Nov 13, 2024
1 parent 9cd71c6 commit f22056c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/test/java/com/github/pjfanning/xlsx/StreamingReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Sheet> 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");
Expand Down
Binary file added src/test/resources/poi-69433.xlsx
Binary file not shown.

0 comments on commit f22056c

Please sign in to comment.