From: Andreas Beeker Date: Sun, 29 Aug 2021 18:58:36 +0000 (+0000) Subject: alter exception check to be compatible with Oracle / IBM jdk X-Git-Tag: REL_5_1_0~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1d4b74315964051c3ff9b57614bb282b381ac81f;p=poi.git alter exception check to be compatible with Oracle / IBM jdk git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892704 13f79535-47bb-0310-9956-ffa450edef68 --- 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 0afb927551..330e025bab 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 @@ -216,12 +216,13 @@ public final class TestXSSFExportToXML { @Test void testExportToXMLSingleAttributeNamespace() throws Exception { + Pattern p = Pattern.compile("Failed to read (external )?schema document .*Schema11., because .file. access is not allowed"); try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMapping-singleattributenamespace.xlsx")) { for (XSSFMap map : wb.getCustomXMLMappings()) { XSSFExportToXml exporter = new XSSFExportToXml(map); UnsynchronizedByteArrayOutputStream os = new UnsynchronizedByteArrayOutputStream(); SAXParseException ex = assertThrows(SAXParseException.class, () -> exporter.exportToXML(os, true)); - assertEquals("schema_reference: Failed to read schema document 'Schema11', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.", ex.getMessage().trim()); + assertTrue(p.matcher(ex.getMessage()).find()); } } }