@Test
public void testInitializationOfNonPrimitivesViaConfig() throws Exception {

    try (InputStream is =
                 getClass().getResourceAsStream("/org/apache/tika/parser/pdf/tika-config-non-primitives.xml")) {
        assertNotNull(is);
        TikaConfig tikaConfig = new TikaConfig(is);
        AutoDetectParser p = new AutoDetectParser(tikaConfig);
        Map<MediaType, Parser> parsers = p.getParsers();
        Parser composite = parsers.get(MediaType.application("pdf"));
        Parser pdfParser = ((CompositeParser)composite).getParsers().get(MediaType.application("pdf"));
        assertEquals("org.apache.tika.parser.pdf.PDFParser", pdfParser.getClass().getName());
        assertEquals(PDFParserConfig.OCR_STRATEGY.OCR_ONLY, ((PDFParser)pdfParser).getPDFParserConfig().getOcrStrategy());
        assertEquals(ImageType.RGB, ((PDFParser)pdfParser).getPDFParserConfig().getOcrImageType());
    }
}