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 --- .../action-library-rest-services/pom.xml | 1 - .../onboarding-rest-war/pom.xml | 1 - .../validation-rest-services/pom.xml | 1 - .../vendor-license-rest-services/pom.xml | 1 - .../vendor-software-products-rest-services/pom.xml | 1 - .../backend/openecomp-sdc-action-manager/pom.xml | 1 - .../pom.xml | 1 - .../openecomp-sdc-vendor-license-manager/pom.xml | 1 - .../openecomp-config-lib/pom.xml | 1 - .../openecomp-nosqldb-core/pom.xml | 1 - openecomp-be/lib/openecomp-heat-lib/pom.xml | 1 - .../openecomp-sdc-enrichment-impl/pom.xml | 1 - .../att-sdc-translator-impl/pom.xml | 6 +- .../BaseResourceTranslationTest.java | 4 +- ...rceTranslationValetGroupAssignmentImplTest.java | 8 +++ .../openecomp-sdc-translator-core/pom.xml | 1 - .../openecomp-sdc-translator-impl/pom.xml | 1 - .../att-sdc-validation-impl/pom.xml | 1 - .../pom.xml | 1 - openecomp-be/pom.xml | 70 +++++++++++++++++++++- 20 files changed, 84 insertions(+), 20 deletions(-) diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml index 1727ba654e..b275c1a3d0 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml @@ -125,7 +125,6 @@ test/core/unittest/offline/** - true diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml index 72d397c90c..eda197c18b 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml @@ -163,7 +163,6 @@ test/core/unittest/offline/** - true buildNumber diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml index cc924966a5..5da8179240 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml @@ -131,7 +131,6 @@ test/core/unittest/offline/** - true diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml index 58b4ace44f..643addc0aa 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml @@ -118,7 +118,6 @@ test/core/unittest/offline/** - true diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml index b779200bc2..0d67b1b1ec 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml @@ -139,7 +139,6 @@ test/core/unittest/offline/** - true diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml index a72fa3edd2..9339a93108 100644 --- a/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml @@ -20,7 +20,6 @@ maven-surefire-plugin 2.12.4 - true diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml index 67a3f7dacc..85b931a833 100644 --- a/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml @@ -21,7 +21,6 @@ maven-surefire-plugin 2.12.4 - true diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml index 4d70a8bd95..127907f029 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml @@ -18,7 +18,6 @@ maven-surefire-plugin 2.12.4 - true diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml index 520b5cf481..4f9364dabb 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml @@ -18,7 +18,6 @@ maven-surefire-plugin 2.12.4 - true diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml index 584befcfc5..8ec98379c6 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml @@ -20,7 +20,6 @@ maven-surefire-plugin 2.12.4 - true diff --git a/openecomp-be/lib/openecomp-heat-lib/pom.xml b/openecomp-be/lib/openecomp-heat-lib/pom.xml index 486c23522b..4ba08e925b 100644 --- a/openecomp-be/lib/openecomp-heat-lib/pom.xml +++ b/openecomp-be/lib/openecomp-heat-lib/pom.xml @@ -71,7 +71,6 @@ maven-surefire-plugin ${mvn.surefire.version} - true false true diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml index 32078aa27d..ae308a0241 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml @@ -114,7 +114,6 @@ maven-surefire-plugin ${mvn.surefire.version} - true false true 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(); diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml index a53699e6cd..f5c8fb0e9e 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml @@ -78,7 +78,6 @@ false true - true diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-impl/pom.xml index a2e05b2056..e89c04c6b0 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-impl/pom.xml @@ -59,7 +59,6 @@ ${project.basedir}/configuration - true diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/pom.xml index 849df4dfea..8208d8bfca 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/pom.xml @@ -84,7 +84,6 @@ false true - true diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml index c1c10d7bb3..8df2c9dfb2 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml @@ -128,7 +128,6 @@ maven-surefire-plugin ${mvn.surefire.version} - true false true diff --git a/openecomp-be/pom.xml b/openecomp-be/pom.xml index f00bce1c25..e09fe8cbed 100644 --- a/openecomp-be/pom.xml +++ b/openecomp-be/pom.xml @@ -128,9 +128,77 @@ report + + post-unit-test + test + + report + + + + + target/jacoco.exec + + target/jacoco-ut + + - + + + org.apache.maven.plugins + maven-antrun-plugin + 1.6 + + + post-integration-test + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.jacoco + org.jacoco.ant + ${jacoco.version} + + + -- cgit 1.2.3-korg