aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2021-08-29 18:58:36 +0000
committerAndreas Beeker <kiwiwings@apache.org>2021-08-29 18:58:36 +0000
commit1d4b74315964051c3ff9b57614bb282b381ac81f (patch)
tree8514f36707649a276d9b9ee5a8ecb467ba636c4e
parentf71cebcce5ed809ee15cd69524f8cb0b0b2ea47c (diff)
downloadpoi-1d4b74315964051c3ff9b57614bb282b381ac81f.tar.gz
poi-1d4b74315964051c3ff9b57614bb282b381ac81f.zip
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
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java3
1 files changed, 2 insertions, 1 deletions
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());
}
}
}