From ed640f61e44fa70e54032480a34fcf877a2eed48 Mon Sep 17 00:00:00 2001 From: shrikantawachar Date: Thu, 5 Oct 2017 19:18:38 +0530 Subject: Code coverage using JaCoCO Adding JaCoCo configuration to have code coverage Change-Id: Ie42702b31bab8cd612d3516ab9eb4f3a2b7d8c16 Issue-ID: SDC-437 Signed-off-by: shrikantawachar --- .../openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml | 6 +++++- .../impl/resourcetranslation/BaseResourceTranslationTest.java | 4 ++-- .../ResourceTranslationValetGroupAssignmentImplTest.java | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl') diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml index a324ee0b06..12fd1179c5 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/pom.xml @@ -20,6 +20,11 @@ logback-classic ${logback.version} + junit junit @@ -63,7 +68,6 @@ ${mvn.surefire.version} false - true diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java index 05bc7cb5f1..0009388ad3 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java @@ -88,7 +88,7 @@ public class BaseResourceTranslationTest { private final String MANIFEST_NAME = SdcCommon.MANIFEST_NAME; private String validationFilename = "validationOutput.json"; - private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + //private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); @Before public void setUp() throws IOException { @@ -290,7 +290,7 @@ public class BaseResourceTranslationTest { } } catch (Exception e) { - log.debug("",e); + //log.debug("",e); Assert.fail(e.getMessage()); } return serviceTemplateMap; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImplTest.java index 758e262b98..9c9998fbea 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImplTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImplTest.java @@ -24,6 +24,7 @@ import org.junit.Before; import org.junit.Test; import java.io.IOException; +//import org.apache.log4j.Logger; public class ResourceTranslationValetGroupAssignmentImplTest extends BaseResourceTranslationTest { @@ -73,6 +74,13 @@ public class ResourceTranslationValetGroupAssignmentImplTest "/mock/services/heattotosca/attValetGroupAssignment/complexOnlyGroup/inputfiles"; outputFilesPath = "/mock/services/heattotosca/attValetGroupAssignment/complexOnlyGroup/expectedoutputfiles"; + +/* String[] loggers = { "org.apache.commons.dbcp2"}; + for (String logger : loggers) { + org.apache.log4j.Logger logSuppress = org.apache.log4j.Logger.getLogger(logger); + logSuppress.setLevel(org.apache.log4j.Level.OFF); + }*/ + initTranslatorAndTranslate(); testTranslation(); validateComputeTemplateConsolidationData(); -- cgit 1.2.3-korg