@Test
public void testParseDeleteMissing() {

  DistCpOptions options = OptionsParser.parse(new String[] {
      "hdfs://localhost:8020/source/first",
      "hdfs://localhost:8020/target/"});
  Assert.assertFalse(options.shouldDeleteMissing());
  options = OptionsParser.parse(new String[] {
      "-update",
      "-delete",
      "hdfs://localhost:8020/source/first",
      "hdfs://localhost:8020/target/"});
  Assert.assertTrue(options.shouldSyncFolder());
  Assert.assertTrue(options.shouldDeleteMissing());
  options = OptionsParser.parse(new String[] {
      "-overwrite",
      "-delete",
      "hdfs://localhost:8020/source/first",
      "hdfs://localhost:8020/target/"});
  Assert.assertTrue(options.shouldOverwrite());
  Assert.assertTrue(options.shouldDeleteMissing());
  try {
    OptionsParser.parse(new String[] {
        "-atomic",
        "-delete",
        "hdfs://localhost:8020/source/first",
        "hdfs://localhost:8020/target/"});
    Assert.fail("Atomic and delete folders were allowed");
  } catch (IllegalArgumentException ignore) { }
}