aboutsummaryrefslogtreecommitdiffstats
path: root/appc-config/appc-config-audit/provider/src/test/java/org/openecomp/sdnc/config/audit/node/TestCompareNodeCli.java
diff options
context:
space:
mode:
authorChaturvedi, Anand (ac204h) <ac204h@att.com>2017-08-31 19:07:53 -0400
committerSkip Wonnell <skip@att.com>2017-09-01 15:03:06 +0000
commit48f77d60c3a7a9fcfb6f13b6da1fa48b7dd4ff34 (patch)
tree836b254a38a37d5a61e7e5411ed7cf2ea713e6c8 /appc-config/appc-config-audit/provider/src/test/java/org/openecomp/sdnc/config/audit/node/TestCompareNodeCli.java
parent58a7196916567cfd46f8fd984ac924ea480ac0f3 (diff)
[JunitCases]for config audit and config generator.
Issue-ID: APPC-168 Change-Id: Ie6f5e13b63f3162530d71c60cf352a8bfcddf4ff Signed-off-by: Chaturvedi, Anand (ac204h) <ac204h@att.com>
Diffstat (limited to 'appc-config/appc-config-audit/provider/src/test/java/org/openecomp/sdnc/config/audit/node/TestCompareNodeCli.java')
-rw-r--r--appc-config/appc-config-audit/provider/src/test/java/org/openecomp/sdnc/config/audit/node/TestCompareNodeCli.java94
1 files changed, 32 insertions, 62 deletions
diff --git a/appc-config/appc-config-audit/provider/src/test/java/org/openecomp/sdnc/config/audit/node/TestCompareNodeCli.java b/appc-config/appc-config-audit/provider/src/test/java/org/openecomp/sdnc/config/audit/node/TestCompareNodeCli.java
index ad1112ffc..337bc6508 100644
--- a/appc-config/appc-config-audit/provider/src/test/java/org/openecomp/sdnc/config/audit/node/TestCompareNodeCli.java
+++ b/appc-config/appc-config-audit/provider/src/test/java/org/openecomp/sdnc/config/audit/node/TestCompareNodeCli.java
@@ -30,71 +30,41 @@ import org.slf4j.LoggerFactory;
import org.openecomp.sdnc.sli.SvcLogicContext;
import org.openecomp.sdnc.sli.SvcLogicException;
-public class TestCompareNodeCli
-{
-private static final Logger log = LoggerFactory.getLogger(TestCompareNodeCli.class);
-
+public class TestCompareNodeCli {
+ private static final Logger log = LoggerFactory.getLogger(TestCompareNodeCli.class);
-//@Test
- public void TestCompareCliForSamePayload()
- {
- SvcLogicContext ctx = new SvcLogicContext();
- HashMap<String, String> testMap = new HashMap<String, String>();
- CompareNode cmp = new CompareNode();
- try
- {
- testMap.put("compareDataType", "Cli");
- testMap.put("sourceData", "This is a Text Configuration of Device");
- testMap.put("targetData", "This is a Text Configuration of Device");
- cmp.compare(testMap, ctx);
- assert(ctx.getAttribute("STATUS").equals("SUCCESS"));
- }
- catch (SvcLogicException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ @Test
+ public void TestCompareCliForSamePayload() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+ HashMap<String, String> testMap = new HashMap<String, String>();
+ CompareNode cmp = new CompareNode();
+ testMap.put("compareDataType", "Cli");
+ testMap.put("sourceData", "This is a Text Configuration of Device");
+ testMap.put("targetData", "This is a Text Configuration of Device");
+ cmp.compare(testMap, ctx);
+ assert (ctx.getAttribute("STATUS").equals("SUCCESS"));
}
- //@Test
- public void TestCompareCliFordifferentPayload()
- {
- SvcLogicContext ctx = new SvcLogicContext();
- HashMap<String, String> testMap = new HashMap<String, String>();
- CompareNode cmp = new CompareNode();
- try
- {
- testMap.put("compareDataType", "Cli");
- testMap.put("sourceData", "This is a Text Negative test Configuration of Device");
- testMap.put("targetData", "This is a Text Configuration of Device");
- cmp.compare(testMap, ctx);
- assert(ctx.getAttribute("STATUS").equals("FAILURE"));
- }
- catch (SvcLogicException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ @Test
+ public void TestCompareCliFordifferentPayload() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+ HashMap<String, String> testMap = new HashMap<String, String>();
+ CompareNode cmp = new CompareNode();
+ testMap.put("compareDataType", "Cli");
+ testMap.put("sourceData", "This is a Text Negative test Configuration of Device");
+ testMap.put("targetData", "This is a Text Configuration of Device");
+ cmp.compare(testMap, ctx);
+ assert (ctx.getAttribute("STATUS").equals("FAILURE"));
}
-
- //@Test
- public void TestCompareForMissingInput()
- {
- SvcLogicContext ctx = new SvcLogicContext();
- HashMap<String, String> testMap = new HashMap<String, String>();
- CompareNode cmp = new CompareNode();
- try
- {
- // testMap.put("compareDataType", "Cli"); Missing compareDataType from the input
- testMap.put("sourceData", "This is a Text Negative test Configuration of Device");
- testMap.put("targetData.configuration-data", "This is a Text Configuration of Device");
- cmp.compare(testMap, ctx);
- assert(ctx.getAttribute("STATUS").equals("FAILURE"));
- }
- catch (SvcLogicException e)
- {
- assert(ctx.getAttribute("STATUS").equals("FAILURE"));
- }
+
+ @Test
+ public void TestCompareForMissingInput() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+ HashMap<String, String> testMap = new HashMap<String, String>();
+ CompareNode cmp = new CompareNode();
+ testMap.put("sourceData", "This is a Text Negative test Configuration of Device");
+ testMap.put("targetData.configuration-data", "This is a Text Configuration of Device");
+ cmp.compare(testMap, ctx);
+ assert (ctx.getAttribute("STATUS").equals("FAILURE"));
}
-
}