From 1a4b4030e10b53ffc80d977908cd6097d843f7a8 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Mon, 18 Sep 2017 10:07:17 +0530 Subject: Add exception for profile persist layer CLI-43 Change-Id: I6b2b969cc3a56dbee60d2b9056a6a7f8f793a8b4 Signed-off-by: Kanagaraj Manickam k00365106 --- .../java/org/onap/cli/fw/OnapCommandRegistrarTest.java | 15 ++++++++++++--- .../java/org/onap/cli/fw/error/OnapCommandErrorTest.java | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'framework/src/test/java') 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()); + } } -- cgit 1.2.3-korg