Skip to content

Commit 5ef63b4

Browse files
committed
Make use of XMLUtils.supportDTD to maintain WMS DTD support
1 parent 3b97b31 commit 5ef63b4

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

geowebcache/wms/src/test/java/org/geowebcache/service/wms/WMSGetCapabilitiesTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
import java.util.HashMap;
1717
import java.util.Map;
1818
import javax.xml.parsers.DocumentBuilder;
19+
import javax.xml.parsers.DocumentBuilderFactory;
1920
import org.easymock.EasyMock;
21+
import org.geotools.util.InternalEntityResolver;
22+
import org.geotools.util.factory.GeoTools;
23+
import org.geotools.util.factory.Hints;
2024
import org.geotools.xml.XMLUtils;
2125
import org.geowebcache.config.DefaultGridsets;
2226
import org.geowebcache.config.legends.LegendRawInfo;
@@ -120,7 +124,11 @@ public void testEscapeXMLChars() throws Exception {
120124

121125
String xml = capabilities.generateGetCapabilities(StandardCharsets.UTF_8);
122126

123-
DocumentBuilder builder = XMLUtils.newDocumentBuilder();
127+
DocumentBuilderFactory factory = XMLUtils.newDocumentBuilderFactory();
128+
129+
Hints hints = GeoTools.addDefaultHints(new Hints(Hints.ENTITY_RESOLVER, InternalEntityResolver.INSTANCE));
130+
XMLUtils.supportDTD(factory, true, hints);
131+
DocumentBuilder builder = XMLUtils.newDocumentBuilder(factory, hints);
124132
InputSource is = new InputSource();
125133
is.setCharacterStream(new StringReader(xml));
126134
Document document = builder.parse(is);

0 commit comments

Comments
 (0)