@Test
public void testParseMaps() {

  DistCpOptions options = OptionsParser.parse(new String[] {
      "hdfs://localhost:8020/source/first",
      "hdfs://localhost:8020/target/"});
  assertThat(options.getMaxMaps()).isEqualTo(DistCpConstants.DEFAULT_MAPS);
  options = OptionsParser.parse(new String[] {
      "-m",
      "1",
      "hdfs://localhost:8020/source/first",
      "hdfs://localhost:8020/target/"});
  assertThat(options.getMaxMaps()).isEqualTo(1);
  options = OptionsParser.parse(new String[] {
      "-m",
      "0",
      "hdfs://localhost:8020/source/first",
      "hdfs://localhost:8020/target/"});
  assertThat(options.getMaxMaps()).isEqualTo(1);
  try {
    OptionsParser.parse(new String[] {
        "-m",
        "hello",
        "hdfs://localhost:8020/source/first",
        "hdfs://localhost:8020/target/"});
    Assert.fail("Non numberic map parsed");
  } catch (IllegalArgumentException ignore) { }
  try {
    OptionsParser.parse(new String[] {
        "-mapredXslConf",
        "hdfs://localhost:8020/source/first",
        "hdfs://localhost:8020/target/"});
    Assert.fail("Non numberic map parsed");
  } catch (IllegalArgumentException ignore) { }
}