aboutsummaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-03-08 14:59:03 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-03-08 15:11:10 +0530
commitce812a8f9e6123ea329d994e588b41f92fb80501 (patch)
treec7d5603f077dd974fa4bf19af052b14295309d08 /framework
parenta5058c11b6876b8ac3152052b22372488e7b5073 (diff)
Debug option is not working
Issue-ID: CLI-98 Change-Id: I02ebf70aed60bb9b172e798cd6d5479bb331b630 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java8
-rw-r--r--framework/src/test/java/org/onap/cli/cmd/sample/OnapCommandSampleTest.java26
2 files changed, 17 insertions, 17 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java
index 8db3ab79..29a29ce3 100644
--- a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java
+++ b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java
@@ -197,14 +197,14 @@ public abstract class OnapCommand {
LOG.info("INPUT: " + paramMap);
// -h or --help is always higher precedence !, user can set this value to get help message
- if (OnapCommandConstants.BOOLEAN_TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_HELP).getValue())) {
+ if ((Boolean)(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_HELP).getValue())) {
this.cmdResult.setType(OnapCommandResultType.TEXT);
this.cmdResult.setOutput(this.printHelp());
return this.cmdResult;
}
// -v or --version is next higher precedence !, user can set this value to get help message
- if (OnapCommandConstants.BOOLEAN_TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_VERSION).getValue())) {
+ if ((Boolean)(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_VERSION).getValue())) {
this.cmdResult.setType(OnapCommandResultType.TEXT);
this.cmdResult.setOutput(this.printVersion());
return this.cmdResult;
@@ -220,12 +220,12 @@ public abstract class OnapCommand {
this.cmdResult.setScope(OnapCommandResultAttributeScope.LONG);
}
// --no-title
- if (OnapCommandConstants.BOOLEAN_TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_NO_TITLE).getValue())) {
+ if ((Boolean)paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_NO_TITLE).getValue()) {
this.cmdResult.setIncludeTitle(false);
}
// --debug
- if (OnapCommandConstants.BOOLEAN_TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_DEBUG).getValue())) {
+ if ((Boolean)(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_DEBUG).getValue())) {
this.cmdResult.setDebug(true);
}
diff --git a/framework/src/test/java/org/onap/cli/cmd/sample/OnapCommandSampleTest.java b/framework/src/test/java/org/onap/cli/cmd/sample/OnapCommandSampleTest.java
index a83cda52..4009dcb0 100644
--- a/framework/src/test/java/org/onap/cli/cmd/sample/OnapCommandSampleTest.java
+++ b/framework/src/test/java/org/onap/cli/cmd/sample/OnapCommandSampleTest.java
@@ -45,11 +45,11 @@ public class OnapCommandSampleTest {
Set<OnapCommandParameter> parameters = new HashSet();
OnapCommandParameter v = new OnapCommandParameter();
v.setName(OnapCommandConstants.DEFAULT_PARAMETER_VERSION);
- v.setValue("true");
+ v.setValue(true);
parameters.add(v);
OnapCommandParameter h = new OnapCommandParameter();
h.setName(OnapCommandConstants.DEFAULT_PARAMETER_HELP);
- h.setValue("false");
+ h.setValue(false);
parameters.add(h);
sample.setParameters(parameters);
sample.execute();
@@ -64,7 +64,7 @@ public class OnapCommandSampleTest {
Set<OnapCommandParameter> parameters = new HashSet();
OnapCommandParameter v = new OnapCommandParameter();
v.setName(OnapCommandConstants.DEFAULT_PARAMETER_HELP);
- v.setValue("true");
+ v.setValue(true);
v.setParameterType(OnapCommandParameterType.BOOL);
parameters.add(v);
sample.setParameters(parameters);
@@ -81,11 +81,11 @@ public class OnapCommandSampleTest {
Set<OnapCommandParameter> parameters = new HashSet();
OnapCommandParameter v = new OnapCommandParameter();
v.setName(OnapCommandConstants.DEFAULT_PARAMETER_VERSION);
- v.setValue("false");
+ v.setValue(false);
parameters.add(v);
OnapCommandParameter h = new OnapCommandParameter();
h.setName(OnapCommandConstants.DEFAULT_PARAMETER_HELP);
- h.setValue("false");
+ h.setValue(false);
parameters.add(h);
OnapCommandParameter f = new OnapCommandParameter();
f.setName(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_FORMAT);
@@ -93,15 +93,15 @@ public class OnapCommandSampleTest {
parameters.add(f);
OnapCommandParameter l = new OnapCommandParameter();
l.setName(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_ATTR_LONG);
- l.setValue("true");
+ l.setValue(true);
parameters.add(l);
OnapCommandParameter t = new OnapCommandParameter();
t.setName(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_NO_TITLE);
- t.setValue("true");
+ t.setValue(true);
parameters.add(t);
OnapCommandParameter d = new OnapCommandParameter();
d.setName(OnapCommandConstants.DEFAULT_PARAMETER_DEBUG);
- d.setValue("true");
+ d.setValue(true);
parameters.add(d);
sample.setParameters(parameters);
@@ -128,11 +128,11 @@ public class OnapCommandSampleTest {
Set<OnapCommandParameter> parameters = new HashSet();
OnapCommandParameter v = new OnapCommandParameter();
v.setName(OnapCommandConstants.DEFAULT_PARAMETER_VERSION);
- v.setValue("false");
+ v.setValue(false);
parameters.add(v);
OnapCommandParameter h = new OnapCommandParameter();
h.setName(OnapCommandConstants.DEFAULT_PARAMETER_HELP);
- h.setValue("false");
+ h.setValue(false);
parameters.add(h);
OnapCommandParameter f = new OnapCommandParameter();
f.setName(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_FORMAT);
@@ -140,15 +140,15 @@ public class OnapCommandSampleTest {
parameters.add(f);
OnapCommandParameter l = new OnapCommandParameter();
l.setName(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_ATTR_LONG);
- l.setValue("true");
+ l.setValue(true);
parameters.add(l);
OnapCommandParameter t = new OnapCommandParameter();
t.setName(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_NO_TITLE);
- t.setValue("true");
+ t.setValue(true);
parameters.add(t);
OnapCommandParameter d = new OnapCommandParameter();
d.setName(OnapCommandConstants.DEFAULT_PARAMETER_DEBUG);
- d.setValue("true");
+ d.setValue(true);
parameters.add(d);
sample.setParameters(parameters);
sample.execute();