for (Entry<String, CmdLineTool> entry : CLI.getToolLookupMap().entrySet()) { final String toolName = entry.getKey(); final CmdLineTool tool = entry.getValue();
public static void main(String[] args) { usage(); System.exit(0);
/** * Ensure all tools do not fail printing help message; */ @Test public void testHelpMessageOfTools() { for (String toolName : CLI.getToolNames()) { System.err.println("-> ToolName" + toolName); try { CLI.main(new String[]{toolName, "help"}); } catch (ExitException e) { Assert.assertEquals(0, e.status()); } } }
/** * Ensure the main method prints error and returns -1 */ @Test public void testUnknownFileMessage() { try { CLI.main(new String[]{"Doccat", "unknown.model"}); } catch (ExitException e) { Assert.assertEquals(-1, e.status()); } }
/** * Ensure the main method does not fail to print help message. */ @Test public void testMainHelpMessage() { try { CLI.main(new String[]{}); } catch (ExitException e) { Assert.assertEquals(0, e.status()); } }
for (Entry<String, CmdLineTool> entry : CLI.getToolLookupMap().entrySet()) { final String toolName = entry.getKey(); final CmdLineTool tool = entry.getValue();
public static void main(String[] args) { usage(); System.exit(0);
/** * Ensure the main method prints error and returns 1. */ @Test public void testUnknownToolMessage() { try { CLI.main(new String[]{"unknown name"}); } catch (ExitException e) { Assert.assertEquals(1, e.status()); } }
for (Entry<String, CmdLineTool> entry : CLI.getToolLookupMap().entrySet()) { final String toolName = entry.getKey(); final CmdLineTool tool = entry.getValue();
public static void main(String[] args) { usage(); System.exit(0);
/** * Ensure the tool checks the parameter and returns 1. */ @Test public void testToolParameterMessage() { try { CLI.main(new String[]{"DoccatTrainer", "-param", "value"}); } catch (ExitException e) { Assert.assertEquals(1, e.status()); } }