From 1d4b74315964051c3ff9b57614bb282b381ac81f Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Sun, 29 Aug 2021 18:58:36 +0000 Subject: [PATCH] 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 --- .../org/apache/poi/xssf/extractor/TestXSSFExportToXML.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()); } } } -- 2.39.5