diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-10-04 18:25:24 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-11-20 12:22:36 +0530 |
commit | 864eafac295bb9cc4c0b4315aa7c262eb214ccc6 (patch) | |
tree | 287aa928fa718059199164f6a7019d23642b79ba /main | |
parent | 3387ffb892b85a20ae44ec58a41e1f3f2cb084f0 (diff) |
Remove default_parameter section and use is_includ
Issue-Id: CLI-66
Change-Id: I24a3bc4d133d4d69fd6522091f20f88edd6c2f19
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'main')
5 files changed, 16 insertions, 13 deletions
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 |