@Test
  public void testGetInputSummaryWithContentSummaryInputFormat()
      throws IOException {
    final int BYTES_PER_FILE = 10;

    final Collection<Path> testPaths = Arrays.asList(new Path("p1/test.txt"),
        new Path("p2/test.txt"), new Path("p3/test.txt"),
        new Path("p4/test.txt"), new Path("p5/test.txt"));

    jobConf.setInt(ConfVars.HIVE_EXEC_INPUT_LISTING_MAX_THREADS.varname, 2);

    ContentSummaryInputFormatTestClass
        .setContentSummary(new ContentSummary.Builder().length(BYTES_PER_FILE)
            .fileCount(2).directoryCount(1).build());

    /*
     * Write more bytes to the files to test that ContentSummaryInputFormat is
     * actually working returning the file size not from the filesystem
     */
    ContentSummary summary = runTestGetInputSummary(jobConf, properties,
        testPaths, BYTES_PER_FILE * 2, ContentSummaryInputFormatTestClass.class,
        Collections.emptyMap());
    assertEquals(testPaths.size() * BYTES_PER_FILE, summary.getLength());
    assertEquals(testPaths.size() * 2, summary.getFileCount());
    assertEquals(testPaths.size(), summary.getDirectoryCount());
  }
Read several files so that their information is cached, then delete those
files and read them again to see if the results were cached from the first
read. If the cache is not working, the sizes will be off since the files no
longer exist in the file system.

@throws Exception e
ql/src/test/org/apache/hadoop/hive/ql/exec/TestGetInputSummary.java