Skip to content

Commit

Permalink
Expect an XML parser error in one test when running with IBM JDK
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1922231 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
centic9 committed Nov 30, 2024
1 parent 4f5d778 commit 1700967
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import com.microsoft.schemas.vml.impl.CTShapetypeImpl;
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
import org.apache.poi.POIDataSamples;
import org.apache.poi.ooxml.POIXMLException;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
Expand Down Expand Up @@ -218,6 +219,9 @@ void bug65061_InvalidXmlns() throws IOException, XmlException {
void testInvalidFile() throws IOException {
try (XSSFWorkbook workbook = openSampleWorkbook("clusterfuzz-testcase-minimized-POIXSSFFuzzer-5089447305609216.xlsx")) {
assertNotNull(workbook);
} catch (POIXMLException e) {
// XML parser of IBM JDK is a bit more picky on XML in this file, so we expect it to fail there with this error
assertTrue(e.getMessage().contains("Attribute name \"sheetId\" associated with an element type \"sheet\" must be followed by the ' = ' character."));
}
}
}

0 comments on commit 1700967

Please sign in to comment.