CliHandler { public HashMap<String, String> fetchSourceItemFiles() throws ParseException { String optionName = "S"; return parseKeyValueOption(optionName); } CliHandler(String[] args); void printUsage(); HashMap<String, String> fetchTemplateFiles(); HashMap<String, String> fetchSourceItemFiles(); String fetchTargetItemFile(); HashMap<String, String> fetchGlobalMetadataFiles(); String[] fetchArguments();  }
@Test public void testParseSourceItemFiles() throws Exception { HashMap<String, String> sourceItemFiles = cliHandler.fetchSourceItemFiles(); assertEquals(3, sourceItemFiles.size()); assertEquals("foo/baa/prod.N1", sourceItemFiles.get("source1")); assertEquals("foo/bah/MER.N1", sourceItemFiles.get("source2")); assertEquals("foo/bar/ATS.N1", sourceItemFiles.get("source3")); }
@Test public void testFetchSourceItemFiles() throws Exception { command = new String[]{ "-v", "template1=/my/template/dir/veltemp.vm.txt", "-t", "/my/out/product.n1"}; cliHandler = new CliHandler(command); HashMap<String, String> sourceItemFiles = cliHandler.fetchSourceItemFiles(); assertNotNull(sourceItemFiles); assertEquals(0, sourceItemFiles.size()); }