@Override
  public int run(String[] args) throws Exception {
    try {
      this.argv_ = Arrays.copyOf(args, args.length);
      init();

      preProcessArgs();
      parseArgv();
      if (printUsage) {
        printUsage(detailedUsage_);
        return 0;
      }
      postProcessArgs();

      setJobConf();
    } catch (IllegalArgumentException ex) {
      //ignore, since log will already be printed
      // print the log in debug mode.
      LOG.debug("Error in streaming job", ex);
      return 1;
    }
    return submitAndMonitorJob();
  }
@Test
  public void testOptions() throws Exception {
    StreamJob streamJob = new StreamJob();
    assertEquals(1, streamJob.run(new String[0]));
    assertEquals(0, streamJob.run(new String[] {"-help"}));
    assertEquals(0, streamJob.run(new String[] {"-info"}));
  }