@Test
    public void testExternalDTD() throws Exception {
        String xml = "<!DOCTYPE foo SYSTEM \"http://127.234.172.38:7845/bar\"><foo/>";
        try {
            parser.parse(new InputSource(new StringReader(xml)), offline);
        } catch (ConnectException e) {
            fail("Parser tried to access the external DTD:" + e);
        }
    }
Unit tests for the {@link OfflineContentHandler} class.
tika-core/src/test/java/org/apache/tika/sax/OfflineContentHandlerTest.java