Skip to content

Commit

Permalink
Merge branch 'jetty-11.0.x' into jetty-12.0.x-merge-11
Browse files Browse the repository at this point in the history
  • Loading branch information
olamy committed Oct 17, 2023
2 parents e99d47c + 65b18ac commit 75bf414
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.junit.jupiter.api.Test;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

Expand All @@ -35,7 +36,16 @@ public void testXmlParser() throws Exception
{
// we want to parse a simple XML, no dtds, no xsds.
// just do it, without validation
XmlParser parser = new XmlParser(false);
XmlParser parser = new XmlParser(false)
{
@Override
protected InputSource resolveEntity(String pid, String sid)
{
InputSource inputSource = super.resolveEntity(pid, sid);
assertNotNull(inputSource, "You are using entities in your XML that don't match your redirectEntity mappings: pid=" + pid + ", sid=" + sid);
return inputSource;
}
};
URL url = XmlParserTest.class.getResource("configureSimple.xml");
assertNotNull(url);
XmlParser.Node testDoc = parser.parse(url.toString());
Expand All @@ -44,7 +54,7 @@ public void testXmlParser() throws Exception
assertTrue(testDocStr.startsWith("<Configure"));
assertTrue(testDocStr.endsWith("</Configure>"));
}

@Test
public void testAddCatalogSimple() throws Exception
{
Expand Down

0 comments on commit 75bf414

Please sign in to comment.