@Test
    public void testConfig() throws Exception {
        //test that memory allocation of the bin element is limited
        //via the config file.  Unfortunately, this test file's bin embedding contains 10 bytes
        //so we had to set the config to 0.
        try (InputStream is = getResourceAsStream(
                "/org/apache/tika/parser/microsoft/rtf/tika-config.xml")) {
            assertNotNull(is);
            TikaConfig tikaConfig = new TikaConfig(is);
            Parser p = new AutoDetectParser(tikaConfig);
            List<Metadata> metadataList = getRecursiveMetadata("testBinControlWord.rtf", p);
            assertEquals(1, metadataList.size());
            assertContains("TikaMemoryLimitException", metadataList.get(0)
                    .get(TikaCoreProperties.TIKA_META_EXCEPTION_EMBEDDED_STREAM));
        }
    }
Junit test class for the Tika {@link RTFParser}
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/test/java/org/apache/tika/parser/microsoft/rtf/RTFParserTest.java