Skip to content

Commit

Permalink
Issue #10066 - a more reliable test case
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Jul 5, 2023
1 parent bba390f commit beb858c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
{
Expand All @@ -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"));
}
}

0 comments on commit beb858c

Please sign in to comment.