@Test
public void testParseAtomicCommit() {

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