private static void test(String testFileName, byte[] bytes, Parser parser, ParseContext context)
            throws Exception {
        boolean ex = false;
        try {
            parse(testFileName, new ByteArrayInputStream(bytes), parser, context);
        } catch (SAXParseException e) {
            ex = true;
        } catch (TikaException e) {
            ex = true;
        }
        assertTrue(ex, "should have had an exception");
    }
Tests to confirm defenses against entity expansion attacks.
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/parser/TestXMLEntityExpansion.java