@Test
    public void testHierarchicalWFileList() throws Exception {
        //tests to make sure that hierarchy is maintained when reading from
        //file list
        //also tests that list actually works.
        Path outputDir = getNewOutputDir("hierarchical_file_list");

        Map<String, String> args = getDefaultArgs("hierarchical", outputDir);
        args.put("numConsumers", "1");
        args.put("fileList", Paths
                .get(getResourceAsUri("/testFileList.txt"))
                .toString());
        args.put("recursiveParserWrapper", "true");
        args.put("basicHandlerType", "text");
        BatchProcessTestExecutor ex = new BatchProcessTestExecutor(args, "/tika-batch-config-MockConsumersBuilder.xml");
        ex.execute();
        Path test1 = outputDir.resolve("test1.xml.json");
        Path test2 = outputDir.resolve("sub1a/test2.xml.json");
        Path test3 = outputDir.resolve("sub1a/sub2a/test3.xml.json");
        assertTrue(Files.exists(test1), "test1 exists");
        assertTrue(Files.size(test1) > 10, "test1 length > 10");
        assertTrue(Files.exists(test3) && Files.size(test3) > 10);
        Path test2Dir = outputDir.resolve("sub1a");
        //should be just the subdirectory, no actual test2 file
        assertEquals(1, countChildren(test2Dir));
        assertFalse(Files.exists(test2));
    }
This tests to make sure that BatchProcess waits the appropriate
amount of time on an early termination before stopping.
<p>
If this fails, then interruptible parsers (e.g. those with
nio channels) will be interrupted and there will be corrupted data.
tika-batch/src/test/java/org/apache/tika/batch/fs/BatchProcessTest.java