summaryrefslogtreecommitdiffstats
path: root/framework/src/test/java
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-18 10:07:17 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-18 10:08:04 +0530
commit1a4b4030e10b53ffc80d977908cd6097d843f7a8 (patch)
treeb441fe2781e685264cab85e9dd376741cfd6af4b /framework/src/test/java
parent81d56617f980394d45be5fee716c507eeea739f2 (diff)
Add exception for profile persist layer
CLI-43 Change-Id: I6b2b969cc3a56dbee60d2b9056a6a7f8f793a8b4 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/test/java')
-rw-r--r--framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java15
-rw-r--r--framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java15
2 files changed, 27 insertions, 3 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java b/framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java
index ecbbf972..d123a875 100644
--- a/framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java
@@ -141,15 +141,24 @@ public class OnapCommandRegistrarTest {
}
@Test
- public void testParamCache() throws OnapCommandException {
+ public void testCoverageScope() throws OnapCommandException {
+ OnapCommandRegistrar.getRegistrar().setProfile("test");
OnapCommandRegistrar.getRegistrar().addParamCache("a", "b");
OnapCommandRegistrar.getRegistrar().getParamCache();
- OnapCommandRegistrar.getRegistrar().getAvailableProductVersions();
+ OnapCommandRegistrar.getRegistrar().removeParamCache("a");
+
OnapCommandRegistrar.getRegistrar().setDevMode(true);
OnapCommandRegistrar.getRegistrar().isDevMode();
+
OnapCommandRegistrar.getRegistrar().isInteractiveMode();
- OnapCommandRegistrar.getRegistrar().getEnabledProductVersion();
+ OnapCommandRegistrar.getRegistrar().setInteractiveMode(false);
+
OnapCommandRegistrar.getRegistrar().setEnabledProductVersion("cli-1.0");
+ OnapCommandRegistrar.getRegistrar().getEnabledProductVersion();
+ OnapCommandRegistrar.getRegistrar().getAvailableProductVersions();
+ OnapCommandRegistrar.getRegistrar().listCommandsForEnabledProductVersion();
+
+ OnapCommandRegistrar.getRegistrar().listCommandInfo();
}
}
diff --git a/framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java b/framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java
index 20402b0d..dd42cdc5 100644
--- a/framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java
@@ -269,4 +269,19 @@ public class OnapCommandErrorTest {
assertEquals("0x0013::Command does not support the output format Format", failed.getMessage());
}
+
+ @Test
+ public void onapProfilePersistTest() {
+ OnapCommandPersistProfileFailed failed = new OnapCommandPersistProfileFailed("error");
+
+ assertEquals("0x1302::Failed to persist profile details, error", failed.getMessage());
+ }
+
+
+ @Test
+ public void onapProfileLoadTest() {
+ OnapCommandLoadProfileFailed failed = new OnapCommandLoadProfileFailed("error");
+
+ assertEquals("0x1301::Failed to load profile details, error", failed.getMessage());
+ }
}