TreeHashArchiveCommand extends AbstractCommand { @Override public void exec(OptionSet options, GlacierUploaderOptionParser optionParser) { final File file = options.valueOf(optionParser.calculateHash); this.calculateTreeHash(file); } TreeHashArchiveCommand(final AmazonGlacier client, final AmazonSQS sqs, final AmazonSNS sns); @Override void exec(OptionSet options, GlacierUploaderOptionParser optionParser); @Override boolean valid(OptionSet options, GlacierUploaderOptionParser optionParser);  }
@Test public void canNotCalculateTreeHashForMissingFile() throws Exception { final File file = new File("notexisting.txt"); final OptionSet options = optionParser.parse("--calculate", file.getAbsolutePath()); new TreeHashArchiveCommand(client, sqs, sns).exec(options, optionParser); }