From ddbc82ad15be746b381b1daa2561b818f7450ce7 Mon Sep 17 00:00:00 2001 From: megala21 Date: Fri, 22 Sep 2017 00:58:16 +0530 Subject: [PATCH 1/4] Adding jacoc unit code coverage generation --- .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../org.wso2.carbon.apimgt.handlers/pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 27 ++ .../pom.xml | 27 ++ .../pom.xml | 27 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 27 ++ .../org.wso2.carbon.device.mgt.api/pom.xml | 26 ++ .../org.wso2.carbon.device.mgt.common/pom.xml | 26 ++ .../org.wso2.carbon.device.mgt.core/pom.xml | 26 ++ .../pom.xml | 27 ++ .../pom.xml | 26 ++ .../org.wso2.carbon.email.sender.core/pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../pom.xml | 26 ++ .../org.wso2.carbon.policy.mgt.common/pom.xml | 26 ++ .../org.wso2.carbon.policy.mgt.core/pom.xml | 27 +- components/test-coverage/pom.xml | 357 ++++++++++++++++++ pom.xml | 11 + 32 files changed, 1153 insertions(+), 1 deletion(-) create mode 100644 components/test-coverage/pom.xml diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index 271b2ac433..5500d6be77 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -197,6 +197,32 @@ ${project.artifactId} + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index 994c3f324a..0c1ef31ea5 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -119,6 +119,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index b0a5aafa8e..27ab9ea61a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -97,6 +97,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index 548ab3b8a7..a7482344b9 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -80,6 +80,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index 9c37238609..392ec7d80a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -172,6 +172,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index cde1f98499..81f696d766 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -49,6 +49,33 @@ api#scep-mgt#v1.0 + + org.jacoco + jacoco-maven-plugin + 0.7.8 + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index 257eca9d79..6e95bd25b4 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -49,6 +49,33 @@ api#certificate-mgt#v1.0 + + org.jacoco + jacoco-maven-plugin + 0.7.8 + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index bb24f54ec3..35e0463139 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -119,6 +119,33 @@ + + org.jacoco + jacoco-maven-plugin + 0.7.8 + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index 5da145a5b3..557318b7dc 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -128,6 +128,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index 535987b8bd..638fbc2812 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -94,6 +94,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml index 853348dfcc..ef71e74293 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -145,6 +145,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml index bc197efd9c..aba1a8bc37 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml @@ -141,6 +141,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index f73e92f956..bcb1840d05 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -150,6 +150,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index 40f094b65a..bd66d683f0 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -149,6 +149,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml index d5e4c7c2cb..a49aed6fec 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml @@ -79,6 +79,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index 053289cfad..5eaff66599 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -131,6 +131,33 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index c3d750a87d..c06ceec899 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -49,6 +49,32 @@ api#device-mgt#v1.0 + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index 03b6e25d23..f2adf02c86 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -56,6 +56,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index 71303f0178..bf63179194 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -39,6 +39,32 @@ org.apache.felix maven-scr-plugin + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + org.apache.felix maven-bundle-plugin diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index 93e3c061eb..8cdfc89bf4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -117,6 +117,33 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml index 2e93235a71..4e2b7fba8d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml @@ -75,6 +75,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml index d9154d6c0c..a4fcadbbe8 100644 --- a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml +++ b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml @@ -93,6 +93,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml index 7a8cd5fa7f..b98d8ef482 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml @@ -115,6 +115,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml index 4779b292e1..bfc4c8acab 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml @@ -120,6 +120,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml index b9ea740ec5..f94e55060d 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml @@ -168,6 +168,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml index 99e2a4a7bb..910587aad2 100644 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml @@ -59,6 +59,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml index c507a6a8d4..4cab3c612d 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml @@ -50,6 +50,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml index 2ab26c9779..d1ebc22f8d 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml @@ -43,6 +43,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml index 36d92c717b..0cbdcb3da5 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml @@ -65,6 +65,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml index f8825aba7c..30cfc3a5eb 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml @@ -94,7 +94,32 @@ - + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/test-coverage/pom.xml b/components/test-coverage/pom.xml new file mode 100644 index 0000000000..7545f58784 --- /dev/null +++ b/components/test-coverage/pom.xml @@ -0,0 +1,357 @@ + + + + carbon-devicemgt + org.wso2.carbon.devicemgt + 3.0.113-SNAPSHOT + ../../pom.xml + + 4.0.0 + + test-coverage + + + target + coverage-reports + jacoco-unit.exec + classes + src/main/java + + + certificate-mgt + ${basedir}/../${certificate.mgt}/org.wso2.carbon.certificate.mgt.api + + ${basedir}/../${certificate.mgt}/org.wso2.carbon.certificate.mgt.cert.admin.api + + ${basedir}/../${certificate.mgt}/org.wso2.carbon.certificate.mgt.core + + + device-mgt + ${basedir}/../${device.mgt}/org.wso2.carbon.device.mgt.core + ${basedir}/../${device.mgt}/org.wso2.carbon.device.mgt.common + ${basedir}/../${device.mgt}/org.wso2.carbon.device.mgt.api + ${basedir}/../${device.mgt}/org.wso2.carbon.device.mgt.extensions + + ${basedir}/../${device.mgt}/org.wso2.carbon.device.mgt.analytics.dashboard + + ${basedir}/../${device.mgt}/org.wso2.carbon.device.mgt.analytics.data.publisher + + + ${basedir}/../${device.mgt}/org.wso2.carbon.device.mgt.url.printer + + + + apimgt-extensions + + ${basedir}/../${api.extensions}/org.wso2.carbon.apimgt.application.extension + + + ${basedir}/../${api.extensions}/org.wso2.carbon.apimgt.application.extension.api + + ${basedir}/../${api.extensions}/org.wso2.carbon.apimgt.handlers + + ${basedir}/../${api.extensions}/org.wso2.carbon.apimgt.integration.client + + + ${basedir}/../${api.extensions}/org.wso2.carbon.apimgt.webapp.publisher + + + + device-mgt-extensions + + ${basedir}/../${device.extensions}/org.wso2.carbon.device.mgt.extensions.device.type.deployer + + + ${basedir}/../${device.extensions}/org.wso2.carbon.device.mgt.extensions.pull.notification + + + ${basedir}/../${device.extensions}/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm + + + ${basedir}/../${device.extensions}/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http + + + ${basedir}/../${device.extensions}/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt + + + ${basedir}/../${device.extensions}/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp + + + + ${basedir}/../email-sender/org.wso2.carbon.email.sender.core + + + identity-extensions + + ${basedir}/../${identity.extensions}/org.wso2.carbon.device.mgt.oauth.extensions + + + ${basedir}/../${identity.extensions}/org.wso2.carbon.identity.authenticator.backend.oauth + + + ${basedir}/../${identity.extensions}/org.wso2.carbon.identity.jwt.client.extension + + + + policy-mgt + + ${basedir}/../${policy.mgt}/org.wso2.carbon.complex.policy.decision.point + + ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.decision.point + + + ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.information.point + + ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.mgt.common + ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.mgt.core + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + post-integration-test + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.jacoco + org.jacoco.ant + ${jacoco.ant.verision} + + + ant-contrib + ant-contrib + ${ant.contrib.version} + + + ant + ant + + + + + + + + diff --git a/pom.xml b/pom.xml index 29af9ee490..c8e34d39f9 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,7 @@ features/email-sender features/jwt-client features/device-mgt-extensions + components/test-coverage @@ -1691,6 +1692,11 @@ carbon-p2-plugin ${carbon.p2.plugin.version} + + org.jacoco + jacoco-maven-plugin + ${jacoco.maven.plugin.version} + @@ -1969,6 +1975,11 @@ (1.9,2.0] 3.12.1.GA true + + + 0.7.8 + 0.7.5.201505241946 + 1.0b3 From 57830eb06448e12398b5d6de58a8f19ef93a41e5 Mon Sep 17 00:00:00 2001 From: megala21 Date: Fri, 22 Sep 2017 01:34:44 +0530 Subject: [PATCH 2/4] Finalizing the unit test report generation and fixing the maven warnings in build --- .../pom.xml | 4 - .../org.wso2.carbon.device.mgt.api/pom.xml | 15 - components/test-coverage/pom.xml | 294 +++++++++++++----- .../pom.xml | 26 ++ pom.xml | 25 -- 5 files changed, 240 insertions(+), 124 deletions(-) diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index 638fbc2812..b58f6cd918 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -50,10 +50,6 @@ org.eclipse.osgi org.eclipse.osgi.services - - org.eclipse.osgi - org.eclipse.osgi.services - org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index c06ceec899..0f49928c94 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -203,11 +203,6 @@ org.wso2.carbon.device.mgt.extensions provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.integration.client - provided - org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.core @@ -358,16 +353,6 @@ ${carbon.identity.framework.version} provided - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.datasource.commons - provided - - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.api - provided - org.wso2.carbon.analytics org.wso2.carbon.analytics.dataservice.commons diff --git a/components/test-coverage/pom.xml b/components/test-coverage/pom.xml index 7545f58784..98ec41372b 100644 --- a/components/test-coverage/pom.xml +++ b/components/test-coverage/pom.xml @@ -1,4 +1,22 @@ - + + + @@ -11,7 +29,7 @@ 4.0.0 test-coverage - + WSO2 Carbon - Unit Test Coverage Generation target coverage-reports @@ -87,9 +105,9 @@ ${basedir}/../${identity.extensions}/org.wso2.carbon.device.mgt.oauth.extensions - + ${basedir}/../${identity.extensions}/org.wso2.carbon.identity.authenticator.backend.oauth - + ${basedir}/../${identity.extensions}/org.wso2.carbon.identity.jwt.client.extension @@ -106,6 +124,11 @@ ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.mgt.common ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.mgt.core + + + + ${basedir}/../webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework + @@ -130,6 +153,7 @@ + @@ -152,6 +176,9 @@ + + + @@ -188,98 +215,155 @@ + + + + + + + - + + + - + + + - + + + + - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -294,34 +378,84 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + - - - - - - + diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 07406a0333..b9608b4bf6 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -129,6 +129,32 @@ + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/pom.xml b/pom.xml index c8e34d39f9..82eace8b1e 100644 --- a/pom.xml +++ b/pom.xml @@ -897,11 +897,6 @@ org.wso2.carbon.identity.application.common ${carbon.identity.framework.version} - - org.wso2.carbon.identity - org.wso2.carbon.identity.oauth2.grant.jwt - ${identity.jwt.extension.version} - org.wso2.carbon.identity.framework org.wso2.carbon.user.mgt @@ -1134,16 +1129,6 @@ org.wso2.carbon.application.mgt.stub ${carbon.commons.version} - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.api - ${carbon.analytics.version} - - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.datasource.commons - ${carbon.analytics.version} - org.wso2.carbon.event-processing org.wso2.carbon.event.processor.stub @@ -1374,11 +1359,6 @@ org.wso2.carbon.event.output.adapter.core ${carbon.analytics.common.version} - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.receiver.stub - ${carbon.analytics.common.version} - org.wso2.carbon.analytics org.wso2.carbon.analytics.datasource.commons @@ -1389,11 +1369,6 @@ org.wso2.carbon.analytics.dataservice.commons ${carbon.analytics.version} - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.stream.stub - ${carbon.analytics.common.version} - org.wso2.carbon.analytics-common org.wso2.carbon.event.publisher.stub From 270037a727ed7456419dbea9058f6962eab61fb4 Mon Sep 17 00:00:00 2001 From: megala21 Date: Fri, 22 Sep 2017 01:36:18 +0530 Subject: [PATCH 3/4] Refactoring --- .../certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml | 1 - .../org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml | 1 - .../certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml | 1 - 3 files changed, 3 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index 81f696d766..8e5d55210d 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -52,7 +52,6 @@ org.jacoco jacoco-maven-plugin - 0.7.8 ${basedir}/target/coverage-reports/jacoco-unit.exec diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index 6e95bd25b4..4df49ca205 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -52,7 +52,6 @@ org.jacoco jacoco-maven-plugin - 0.7.8 ${basedir}/target/coverage-reports/jacoco-unit.exec diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index 35e0463139..7bb8308c78 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -122,7 +122,6 @@ org.jacoco jacoco-maven-plugin - 0.7.8 ${basedir}/target/coverage-reports/jacoco-unit.exec From 635f40ce2f097a6f4796c3202e34435c0edffe17 Mon Sep 17 00:00:00 2001 From: megala21 Date: Fri, 22 Sep 2017 09:22:40 +0530 Subject: [PATCH 4/4] Refactoring --- components/test-coverage/pom.xml | 219 +++++++++++++++++-------------- 1 file changed, 121 insertions(+), 98 deletions(-) diff --git a/components/test-coverage/pom.xml b/components/test-coverage/pom.xml index 98ec41372b..bd2e5e90a1 100644 --- a/components/test-coverage/pom.xml +++ b/components/test-coverage/pom.xml @@ -41,9 +41,11 @@ certificate-mgt ${basedir}/../${certificate.mgt}/org.wso2.carbon.certificate.mgt.api - ${basedir}/../${certificate.mgt}/org.wso2.carbon.certificate.mgt.cert.admin.api + ${basedir}/../${certificate.mgt}/org.wso2.carbon.certificate.mgt.cert.admin.api + - ${basedir}/../${certificate.mgt}/org.wso2.carbon.certificate.mgt.core + ${basedir}/../${certificate.mgt}/org.wso2.carbon.certificate.mgt.core + device-mgt @@ -98,7 +100,7 @@ - ${basedir}/../email-sender/org.wso2.carbon.email.sender.core + ${basedir}/../email-sender/org.wso2.carbon.email.sender.core identity-extensions @@ -115,15 +117,16 @@ policy-mgt - ${basedir}/../${policy.mgt}/org.wso2.carbon.complex.policy.decision.point + ${basedir}/../${policy.mgt}/org.wso2.carbon.complex.policy.decision.point + ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.decision.point - ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.information.point + ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.information.point - ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.mgt.common - ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.mgt.core + ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.mgt.common + ${basedir}/../${policy.mgt}/org.wso2.carbon.policy.mgt.core @@ -146,22 +149,27 @@ + classpathref="maven.plugin.classpath"/> - - - - - + + + + + - + - + @@ -176,22 +184,24 @@ - + - + - + - + - + @@ -199,48 +209,49 @@ - + - + - + - - - + - + - + - + - + - + - + - + @@ -248,218 +259,230 @@ - + - + - + - + - + - - - + - + - + - + - + - + - + - + - + - + - - - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - + - - + - + - + - + - + - + - + - + - + - + - - - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + +