@SuppressWarnings("unchecked")
  public static void main(String[] args) 
    throws IOException, InterruptedException, ClassNotFoundException  {
    Job job = ValueAggregatorJob.createValueAggregatorJob(args
        , new Class[] {WordCountPlugInClass.class});
    job.setJarByClass(AggregateWordCount.class);
    int ret = job.waitForCompletion(true) ? 0 : 1;
    ExitUtil.terminate(ret);
  }
@Test
  void testAggregateTestCount()
      throws IOException, ClassNotFoundException, InterruptedException {

    ExitUtil.disableSystemExit();
    FileSystem fs = getFileSystem();
    fs.mkdirs(INPUT_PATH);
    Path file1 = new Path(INPUT_PATH, "file1");
    Path file2 = new Path(INPUT_PATH, "file2");
    FileUtil.write(fs, file1, "Hello World");
    FileUtil.write(fs, file2, "Hello Hadoop");

    String[] args =
        new String[]{INPUT_PATH.toString(), OUTPUT_PATH.toString(), "1",
            "textinputformat"};

    // Run AggregateWordCount Job.
    try {
      AggregateWordCount.main(args);
    } catch (ExitException e) {
      assertEquals(0, e.status);
    }

    String allEntries;
    try (FSDataInputStream stream = fs
        .open(new Path(OUTPUT_PATH, "part-r-00000"));) {
      allEntries = IOUtils.toString(stream, Charset.defaultCharset());
    }

    assertEquals("Hadoop\t1\n" + "Hello\t2\n" + "World\t1\n", allEntries);
  }