@Test
    public void testUnknownParser() throws Exception {
        ServiceLoader ignoreLoader =
                new ServiceLoader(getClass().getClassLoader(), LoadErrorHandler.IGNORE);
        ServiceLoader warnLoader =
                new ServiceLoader(getClass().getClassLoader(), LoadErrorHandler.WARN);
        ServiceLoader throwLoader =
                new ServiceLoader(getClass().getClassLoader(), LoadErrorHandler.THROW);
        Path configPath = Paths.get(new URI(getConfigPath("TIKA-1700-unknown-parser.xml")));

        TikaConfig ignore = new TikaConfig(configPath, ignoreLoader);
        assertNotNull(ignore);
        assertNotNull(ignore.getParser());
        assertEquals(1, ((CompositeParser) ignore.getParser()).getAllComponentParsers().size());

        TikaConfig warn = new TikaConfig(configPath, warnLoader);
        assertNotNull(warn);
        assertNotNull(warn.getParser());
        assertEquals(1, ((CompositeParser) warn.getParser()).getAllComponentParsers().size());

        try {
            new TikaConfig(configPath, throwLoader);
            fail("Shouldn't get here, invalid parser class");
        } catch (TikaException expected) {
        }
    }
Make sure that with a service loader given, we can
get different configurable behaviour on parser classes
which can't be found.
tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java