From 99043712640be0ffc317f95d0630b2119998cb2b Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Mon, 10 Sep 2018 02:15:32 +0530 Subject: refactored code for TestCompareNodeXml added object creation to setup method using before annotation Issue-ID: APPC-1086 Change-Id: If0e0c438a4e31751ae17db6ee557b2a2adb55036 Signed-off-by: Sandeep J --- .../sdnc/config/audit/node/TestCompareNodeXml.java | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'appc-config/appc-config-audit') diff --git a/appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeXml.java b/appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeXml.java index 7ea938148..808706e5e 100644 --- a/appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeXml.java +++ b/appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeXml.java @@ -6,6 +6,8 @@ * ================================================================================ * Copyright (C) 2017 Amdocs * ============================================================================= + * Modifications Copyright (C) 2018 IBM. + * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,23 +27,31 @@ package org.onap.sdnc.config.audit.node; import java.io.IOException; import java.util.HashMap; -import org.junit.Test; -import org.onap.sdnc.config.audit.node.CompareNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.junit.Before; +import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestCompareNodeXml { private static final Logger log = LoggerFactory.getLogger(TestCompareNodeXml.class); - + private CompareNode cmp ; + private HashMap testMap; + private SvcLogicContext ctx; + + @Before + public void setUp() + { + cmp = new CompareNode(); + ctx = new SvcLogicContext(); + testMap = new HashMap(); + } + @Test public void TestCompareExtactXML() throws SvcLogicException { log.debug("TestCompareNode.TestCompareExtactXML()"); - SvcLogicContext ctx = new SvcLogicContext(); - HashMap testMap = new HashMap(); - CompareNode cmp = new CompareNode(); String s = " "; String t = " "; testMap.put("compareDataType", "RESTCONF-XML"); @@ -55,9 +65,6 @@ public class TestCompareNodeXml { @Test public void TestCompareforAttributeOrder() throws IOException, SvcLogicException { log.debug("TestCompareNode.TestCompareforAttributeOrder()"); - SvcLogicContext ctx = new SvcLogicContext(); - HashMap testMap = new HashMap(); - CompareNode cmp = new CompareNode(); testMap.put("compareDataType", "XML"); testMap.put("sourceData", "2true5060true5060"); @@ -70,9 +77,6 @@ public class TestCompareNodeXml { @Test public void TestCompareForComments() throws SvcLogicException { log.debug("TestCompareNode.TestCompareForComments()"); - SvcLogicContext ctx = new SvcLogicContext(); - HashMap testMap = new HashMap(); - CompareNode cmp = new CompareNode(); testMap.put("compareDataType", "XML"); testMap.put("sourceData", "2"); testMap.put("targetData", "2"); -- cgit 1.2.3-korg