From 273e02461181d7058c622ab2863912066890021d Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sat, 28 Sep 2019 20:57:23 -0700 Subject: [PATCH] Fix #84 --- src/test/java/wstxtest/sax/TestEntityResolver.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/java/wstxtest/sax/TestEntityResolver.java b/src/test/java/wstxtest/sax/TestEntityResolver.java index 1b3e8900..05e36575 100644 --- a/src/test/java/wstxtest/sax/TestEntityResolver.java +++ b/src/test/java/wstxtest/sax/TestEntityResolver.java @@ -8,6 +8,7 @@ import org.xml.sax.*; import org.xml.sax.helpers.DefaultHandler; +import com.ctc.wstx.exc.WstxException; import com.ctc.wstx.sax.WstxSAXParserFactory; import wstxtest.BaseWstxTest; @@ -37,8 +38,14 @@ public void testWithDummyExtSubset() */ try { sp.parse(new InputSource(new StringReader(XML)), h); + fail("Should not pass"); } catch (SAXException e) { - verifyException(e, "No such file or directory"); + Throwable cause = e.getCause(); + assertNotNull(cause); + assertTrue(cause instanceof WstxException); + // [woodstox-core#84]: actual message varies by OS so only verify this: + verifyException(e, " file "); + verifyException(e, "no-such-thing.dtd"); } // And then with dummy resolver; should work ok now