File tree Expand file tree Collapse file tree
geowebcache/wms/src/test/java/org/geowebcache/service/wms Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import java .util .HashMap ;
1717import java .util .Map ;
1818import javax .xml .parsers .DocumentBuilder ;
19+ import javax .xml .parsers .DocumentBuilderFactory ;
1920import org .easymock .EasyMock ;
21+ import org .geotools .util .InternalEntityResolver ;
22+ import org .geotools .util .factory .GeoTools ;
23+ import org .geotools .util .factory .Hints ;
2024import org .geotools .xml .XMLUtils ;
2125import org .geowebcache .config .DefaultGridsets ;
2226import 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 );
You can’t perform that action at this time.
0 commit comments