From: Sandeep J Date: Sun, 9 Sep 2018 20:45:32 +0000 (+0530) Subject: refactored code for TestCompareNodeXml X-Git-Tag: 1.4.0~22 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F65409%2F4;p=appc.git 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 --- 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");