diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-09-18 10:07:17 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-09-18 10:08:04 +0530 |
commit | 1a4b4030e10b53ffc80d977908cd6097d843f7a8 (patch) | |
tree | b441fe2781e685264cab85e9dd376741cfd6af4b /framework/src/test/java/org | |
parent | 81d56617f980394d45be5fee716c507eeea739f2 (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/org')
-rw-r--r-- | framework/src/test/java/org/onap/cli/fw/OnapCommandRegistrarTest.java | 15 | ||||
-rw-r--r-- | framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java | 15 |
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()); + } } |