From 89cf755a6e80c5ebd4bd989faad85aba60fc7b69 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Fri, 13 Oct 2017 15:36:44 +0530 Subject: Removed the dead codes Swagger client sdk support is removed. Issue-Id: CLI-66 Change-Id: Ic7b23cfd72f2ae29de7ab44d2cffb35af2db701b Signed-off-by: Kanagaraj Manickam k00365106 --- .../java/org/onap/cli/main/OnapCliMainTest.java | 4 +-- .../org/onap/cli/main/utils/OnapCliUtilsTest.java | 36 +++++++++++----------- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'main/src/test/java') diff --git a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java index 6eb2e11f..d720ed95 100644 --- a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java +++ b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java @@ -31,7 +31,7 @@ import org.onap.cli.fw.OnapCommand; import org.onap.cli.fw.OnapCommandRegistrar; import org.onap.cli.fw.error.OnapCommandException; import org.onap.cli.fw.error.OnapCommandHelpFailed; -import org.onap.cli.main.utils.OnapCliUtils; +import org.onap.cli.main.utils.OnapCliArgsParser; import jline.console.ConsoleReader; import mockit.Invocation; @@ -120,7 +120,7 @@ public class OnapCliMainTest { OnapCommand cmd = OnapCommandRegistrar.getRegistrar().get("sample-create"); List args = new ArrayList<>(Arrays.asList(new String[] { "sample-create", "--service-name", "test-service", "-i", "ip1", "-i", "ip2", "-o", "port1=value1", "-o", "port2=value2" })); - OnapCliUtils.populateParams(cmd.getParameters(), args); + OnapCliArgsParser.populateParams(cmd.getParameters(), args); } @Test diff --git a/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java b/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java index 1ea1a22d..ad1a7ccc 100644 --- a/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java +++ b/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java @@ -63,7 +63,7 @@ public class OnapCliUtilsTest { String[] args = new String[] { "sample-create", "--host-username", "admin", "--host-password", "123", "--host-url", "a@b.com", "--string-param", "blah", "--long-opt", "10" }; - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertEquals("host-username", expectedList.get(2), param1.getValue()); @@ -82,7 +82,7 @@ public class OnapCliUtilsTest { paramslist.add(paramargs); String[] args = new String[] { "positional-args", "http://localhost:8082/file.txt" }; paramargs.setParameterType(ParameterType.STRING); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertEquals("positional-args", expectedList.get(1), paramslist.get(0).getValue()); } @@ -97,7 +97,7 @@ public class OnapCliUtilsTest { String[] args = new String[] { "sample-create", "--bool" }; boolparam.setParameterType(ParameterType.BOOL); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertNotNull(expectedList.get(1), paramslist.get(0).getValue()); @@ -113,7 +113,7 @@ public class OnapCliUtilsTest { String[] args = new String[] { "sample-create", "-b", }; boolparam.setParameterType(ParameterType.BOOL); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertNotNull(expectedList.get(1), paramslist.get(0).getValue()); } @@ -128,7 +128,7 @@ public class OnapCliUtilsTest { String[] args = new String[] { "sample-create", "--text-param" , "text"}; boolparam.setParameterType(ParameterType.TEXT); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertNotNull(expectedList.get(1), paramslist.get(0).getValue()); @@ -144,7 +144,7 @@ public class OnapCliUtilsTest { String[] args = new String[] { "sample-create", "-e" , "text"}; boolparam.setParameterType(ParameterType.TEXT); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertNotNull(expectedList.get(1), paramslist.get(0).getValue()); } @@ -159,7 +159,7 @@ public class OnapCliUtilsTest { File resourcesDirectory = new File("src/test/resources/sampletest.json"); String[] args = new String[] { "sample-create", "-j", "file:" + resourcesDirectory }; jsonparam.setParameterType(ParameterType.JSON); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertNotNull(expectedList.get(1), paramslist.get(0).getValue()); } @@ -174,7 +174,7 @@ public class OnapCliUtilsTest { File resourcesDirectory = new File("src/test/resources/sampletest.json"); String[] args = new String[] { "sample-create", "--json-param", "file:" + resourcesDirectory }; jsonparam.setParameterType(ParameterType.JSON); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertNotNull(expectedList.get(1), paramslist.get(0).getValue()); } @@ -212,7 +212,7 @@ public class OnapCliUtilsTest { String[] args11 = new String[] { "sample-create", "-u", "admin", "-p", "123", "-r", "a@b.com", "-c", "blah", "-l", "10", }; - OnapCliUtils.populateParams(paramslist, Arrays.asList(args11)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args11)); List expectedList = Arrays.asList(args11); @@ -234,7 +234,7 @@ public class OnapCliUtilsTest { paramslist.add(arrayval); arrayval.setParameterType(ParameterType.ARRAY); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertNotNull(expectedList.get(1), paramslist.get(0).getValue()); @@ -250,7 +250,7 @@ public class OnapCliUtilsTest { paramslist.add(param1); param1.setParameterType(ParameterType.MAP); - OnapCliUtils.populateParams(paramslist, + OnapCliArgsParser.populateParams(paramslist, Arrays.asList("show", "--map", "param1=value1", "--map", "param2=value2")); Assert.assertEquals("{\"param1\":\"value1\",\"param2\":\"value2\"}", paramslist.get(0).getValue().toString()); @@ -266,7 +266,7 @@ public class OnapCliUtilsTest { paramslist.add(param1); param1.setParameterType(ParameterType.MAP); - OnapCliUtils.populateParams(paramslist, Arrays.asList("show", "--map", "param1=value1", "--map", "param2")); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList("show", "--map", "param1=value1", "--map", "param2")); Assert.assertEquals("{\"param1\":\"value1\",\"param2\"}", paramslist.get(0).getValue().toString()); } @@ -279,7 +279,7 @@ public class OnapCliUtilsTest { List paramslist = new ArrayList<>(); paramslist.add(param1); param1.setParameterType(ParameterType.MAP); - OnapCliUtils.populateParams(paramslist, Arrays.asList("show", "-o", "param1=value1", "-o", "param2")); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList("show", "-o", "param1=value1", "-o", "param2")); Assert.assertEquals("{\"param1\":\"value1\",\"param2\"}", paramslist.get(0).getValue().toString()); } @@ -292,7 +292,7 @@ public class OnapCliUtilsTest { String[] args = new String[] { "positional-args", "http://localhost:8082/file.txt", "http://localhost:8082/file.txt" }; paramargs.setParameterType(ParameterType.STRING); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertEquals("positional-args", expectedList.get(1), paramslist.get(0).getValue()); } @@ -307,7 +307,7 @@ public class OnapCliUtilsTest { String[] args = new String[] { "sample-create", "-b", "-b", "-h" }; boolparam.setParameterType(ParameterType.BOOL); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertEquals("true", paramslist.get(0).getValue()); } @@ -322,7 +322,7 @@ public class OnapCliUtilsTest { String[] args = new String[] { "sample-create", "--bool", "--bool", "--help" }; boolparam.setParameterType(ParameterType.BOOL); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertEquals("true", paramslist.get(0).getValue()); } @@ -337,7 +337,7 @@ public class OnapCliUtilsTest { File resourcesDirectory = new File("src/test/resources/sampletest.json"); String[] args = new String[] { "sample-create", "--json-param", "file:" + resourcesDirectory, "--json-param" }; jsonparam.setParameterType(ParameterType.JSON); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertEquals("--json-param", paramslist.get(0).getValue()); @@ -353,7 +353,7 @@ public class OnapCliUtilsTest { File resourcesDirectory = new File("src/test/resources/sampletest.json"); String[] args = new String[] { "sample-create", "-j", "file:" + resourcesDirectory, "-j" }; jsonparam.setParameterType(ParameterType.JSON); - OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); + OnapCliArgsParser.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); Assert.assertEquals("--json-param", paramslist.get(0).getValue()); -- cgit 1.2.3-korg