static public JobConf createJob(String[] argv) throws IOException {
    StreamJob job = new StreamJob();
    job.argv_ = argv;
    job.init();
    job.preProcessArgs();
    job.parseArgv();
    job.postProcessArgs();
    job.setJobConf();
    return job.jobConf_;
  }
@Test
  public void testCreateJob() throws IOException {
    JobConf job;
    ArrayList<String> dummyArgs = new ArrayList<String>();
    dummyArgs.add("-input"); dummyArgs.add("dummy");
    dummyArgs.add("-output"); dummyArgs.add("dummy");
    dummyArgs.add("-mapper"); dummyArgs.add("dummy");
    dummyArgs.add("-reducer"); dummyArgs.add("dummy");
    ArrayList<String> args;
    
    args = new ArrayList<String>(dummyArgs);
    args.add("-inputformat");
    args.add("org.apache.hadoop.mapred.KeyValueTextInputFormat");
    job = StreamJob.createJob(args.toArray(new String[] {}));
    assertEquals(KeyValueTextInputFormat.class, job.getInputFormat().getClass());
    
    args = new ArrayList<String>(dummyArgs);
    args.add("-inputformat");
    args.add("org.apache.hadoop.mapred.SequenceFileInputFormat");
    job = StreamJob.createJob(args.toArray(new String[] {}));
    assertEquals(SequenceFileInputFormat.class, job.getInputFormat().getClass());
    
    args = new ArrayList<String>(dummyArgs);
    args.add("-inputformat");
    args.add("org.apache.hadoop.mapred.KeyValueTextInputFormat");
    args.add("-inputreader");
    args.add("StreamXmlRecordReader,begin=<doc>,end=</doc>");
    job = StreamJob.createJob(args.toArray(new String[] {}));
    assertEquals(StreamInputFormat.class, job.getInputFormat().getClass());
  }