@Test
public void testMainArguments() {

  final Props jobProps = new Props();
  jobProps.put(TonyJobArg.HDFS_CLASSPATH.azPropName, "hdfs://nn:8020");
  jobProps.put(TonyJob.WORKER_ENV_PREFIX + "E1", "e1");
  jobProps.put(TonyJob.WORKER_ENV_PREFIX + "E2", "e2");
  final TonyJob tonyJob = new TonyJob("test_tony_job", new Props(), jobProps, log) {
    @Override
    public String getWorkingDirectory() {
      return System.getProperty("java.io.tmpdir");
    }
  };
  String args = tonyJob.getMainArguments();
  Assert.assertTrue(args.contains(TonyJobArg.HDFS_CLASSPATH.tonyParamName + " hdfs://nn:8020"));
  Assert.assertTrue(args.contains(TonyJobArg.SHELL_ENV.tonyParamName + " E2=e2"));
  Assert.assertTrue(args.contains(TonyJobArg.SHELL_ENV.tonyParamName + " E1=e1"));
}