From 2b21188b82e21eb87c4e79a6f31beff9325ab2ea Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 27 Sep 2018 14:29:21 +0100 Subject: Add unit test for Apex command line tools THere was no unit test for the command line tools. This review adds unit test and also fixes a few small bugs that showed up when uit test was run. Issue-ID: POLICY-1034 Change-Id: Ic19aacdb168fb5a6faa0cd83ed22ccfcedaa51f5 Signed-off-by: liamfallon --- .../src/main/java/org/onap/policy/apex/tools/common/CliParser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tools/tools-common') diff --git a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliParser.java b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliParser.java index 31692dc21..dfaafbd25 100644 --- a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliParser.java +++ b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliParser.java @@ -34,7 +34,6 @@ import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; /** * Application CLI parser. @@ -80,7 +79,7 @@ public class CliParser { final CommandLineParser parser = new DefaultParser(); try { cmd = parser.parse(options, args); - } catch (final ParseException ex) { + } catch (final Exception ex) { Console.CONSOLE.error("Parsing failed, see reason and cause below"); Console.CONSOLE.stacktrace(ex); } -- cgit 1.2.3-korg