From 864eafac295bb9cc4c0b4315aa7c262eb214ccc6 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 4 Oct 2017 18:25:24 +0530 Subject: Remove default_parameter section and use is_includ Issue-Id: CLI-66 Change-Id: I24a3bc4d133d4d69fd6522091f20f88edd6c2f19 Signed-off-by: Kanagaraj Manickam k00365106 --- main/src/main/java/org/onap/cli/main/OnapCli.java | 4 ++-- main/src/test/java/org/onap/cli/main/OnapCliMainTest.java | 2 +- .../test/java/org/onap/cli/main/OnapCommandSampleTest.java | 2 +- .../test/resources/open-cli-schema/sample-create-schema.yaml | 11 ++++++----- main/src/test/resources/sample-test-schema.yaml | 10 ++++++---- 5 files changed, 16 insertions(+), 13 deletions(-) (limited to 'main') diff --git a/main/src/main/java/org/onap/cli/main/OnapCli.java b/main/src/main/java/org/onap/cli/main/OnapCli.java index 4cc2132d..5123a958 100644 --- a/main/src/main/java/org/onap/cli/main/OnapCli.java +++ b/main/src/main/java/org/onap/cli/main/OnapCli.java @@ -348,9 +348,9 @@ public class OnapCli { for (OnapCommandParameter param: cmd.getParameters()) { if (OnapCommandRegistrar.getRegistrar().getParamCache().containsKey( - cmd.getService().getName() + ":" + param.getLongOption())) { + cmd.getInfo().getService() + ":" + param.getLongOption())) { param.setValue(OnapCommandRegistrar.getRegistrar().getParamCache().get( - cmd.getService().getName() + ":" + param.getLongOption())); + cmd.getInfo().getService() + ":" + param.getLongOption())); } else if (OnapCommandRegistrar.getRegistrar().getParamCache().containsKey(param.getLongOption())) { param.setValue(OnapCommandRegistrar.getRegistrar().getParamCache().get(param.getLongOption())); } 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 acf66a52..6eb2e11f 100644 --- a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java +++ b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java @@ -169,7 +169,7 @@ public class OnapCliMainTest { } cli = new OnapCli(new String[] {}); - mockConsole("use cli-1.0"); + mockConsole("use open-cli"); try { cli.handleInteractive(); } catch (Exception e) { diff --git a/main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java b/main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java index b06824b6..b716eece 100644 --- a/main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java +++ b/main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java @@ -24,7 +24,7 @@ import org.onap.cli.fw.error.OnapCommandException; * This command helps to test the Command functionalities. * */ -@OnapCommandSchema(name = "sample-test", version = "cli-1.0", schema = "sample-test-schema.yaml") +@OnapCommandSchema(name = "sample-test", version = "open-cli", schema = "sample-test-schema.yaml") public class OnapCommandSampleTest extends OnapCommand { @Override diff --git a/main/src/test/resources/open-cli-schema/sample-create-schema.yaml b/main/src/test/resources/open-cli-schema/sample-create-schema.yaml index ff24c0aa..3c1dda8d 100644 --- a/main/src/test/resources/open-cli-schema/sample-create-schema.yaml +++ b/main/src/test/resources/open-cli-schema/sample-create-schema.yaml @@ -1,11 +1,12 @@ open_cli_schema_version: 1.0 name: sample-create description: Sample create into Onap -version: cli-1.0 -service: - name: sample - version: v1 - auth: none +info: + product: open-cli + service: test + type: cmd + author: Kanagaraj Manickam mkr1481@gmail.com + parameters: - name: service-name description: Onap service name diff --git a/main/src/test/resources/sample-test-schema.yaml b/main/src/test/resources/sample-test-schema.yaml index 36edc7de..f257bf69 100644 --- a/main/src/test/resources/sample-test-schema.yaml +++ b/main/src/test/resources/sample-test-schema.yaml @@ -1,10 +1,12 @@ open_cli_schema_version: 1.0 name: sample-test description: Onap sample command to test the command features -version: cli-1.0 -service: - name: sample - version: v1 +info: + product: open-cli + service: test + type: cmd + author: Kanagaraj Manickam mkr1481@gmail.com + parameters: - name: bool-param type: bool -- cgit 1.2.3-korg