From beb858c3ce35896d4e04e4069929aeb38cdd7d04 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 5 Jul 2023 14:14:08 -0500 Subject: [PATCH] Issue #10066 - a more reliable test case Signed-off-by: Joakim Erdfelt --- .../test/java/org/eclipse/jetty/xml/XmlParserTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java index fb4083ed891b..265bf659cfdd 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java @@ -18,6 +18,8 @@ import javax.xml.parsers.SAXParserFactory; import org.junit.jupiter.api.Test; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -47,7 +49,7 @@ public void testXmlParser() throws Exception * Customize SAXParserFactory behavior. */ @Test - public void testNewSAXParserFactory() + public void testNewSAXParserFactory() throws SAXException { XmlParser xmlParser = new XmlParser() { @@ -63,7 +65,9 @@ protected SAXParserFactory newSAXParserFactory() SAXParser saxParser = xmlParser.getSAXParser(); assertNotNull(saxParser); - // look to see it was set at parser level - assertFalse(saxParser.isNamespaceAware()); + + XMLReader xmlReader = saxParser.getXMLReader(); + // look to see it was set at XMLReader level + assertFalse(xmlReader.getFeature("http://apache.org/xml/features/xinclude")); } }