From: Sam Hague Date: Sat, 3 Oct 2015 01:20:10 +0000 (-0400) Subject: Fix sonar integration test reporting X-Git-Tag: release/beryllium~309^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=51b3076c693a664b52fdfba0da5ec5486d97e51f;p=ovsdb.git Fix sonar integration test reporting Change-Id: Icb238c6442a8d15ae144d6e9abbaabf9fd011570 Signed-off-by: Sam Hague --- diff --git a/commons/it/pom.xml b/commons/it/pom.xml new file mode 100644 index 000000000..4063868bd --- /dev/null +++ b/commons/it/pom.xml @@ -0,0 +1,121 @@ + + + + 4.0.0 + + + org.opendaylight.controller + mdsal-it-parent + 1.3.0-SNAPSHOT + + + + org.opendaylight.ovsdb + it + 1.2.1-SNAPSHOT + pom + The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation. + https://wiki.opendaylight.org/view/OVSDB_Integration:Main + + + Eclipse Public License v1.0 + http://www.eclipse.org/legal/epl-v10.html + + + + + Sam Hague + shague@gmail.com + https://github.com/shague + + + + scm:git:ssh://git.opendaylight.org:29418/ovsdb.git + scm:git:ssh://git.opendaylight.org:29418/ovsdb.git + HEAD + https://wiki.opendaylight.org/view/OVSDB_Integration:Main + + + + 3.1.1 + + + + + default + + true + + + true + + + + integrationtest + + false + + + false + + + + + + + + org.codehaus.sonar-plugins.java + sonar-jacoco-listeners + ${sonar-jacoco-listeners.version} + test + + + + + + + + org.jacoco + jacoco-maven-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + listener + org.sonar.java.jacoco.JUnitListener + + + + + + maven-antrun-plugin + + + prep-jacoco-agent + pre-integration-test + + run + + + + + + + + + + + + diff --git a/commons/pom.xml b/commons/pom.xml index 376aba2ad..c65880fc0 100644 --- a/commons/pom.xml +++ b/commons/pom.xml @@ -49,5 +49,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html parent + it diff --git a/library/impl/pom.xml b/library/impl/pom.xml index 04e0b5e49..8112ddc1b 100644 --- a/library/impl/pom.xml +++ b/library/impl/pom.xml @@ -20,6 +20,9 @@ and is available at http://www.eclipse.org/legal/epl-v10.html library 1.2.1-SNAPSHOT bundle + + ../it/target/jacoco-it.exec + com.fasterxml.jackson.core @@ -75,6 +78,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html mockito-all test + + org.codehaus.sonar-plugins.java + sonar-jacoco-listeners + ${sonar-jacoco-listeners.version} + test + @@ -89,13 +98,17 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.apache.maven.plugins maven-checkstyle-plugin - - org.apache.maven.plugins - maven-failsafe-plugin - org.apache.maven.plugins maven-surefire-plugin + + + + listener + org.sonar.java.jacoco.JUnitListener + + + org.jacoco diff --git a/library/it/pom.xml b/library/it/pom.xml index dbf32fbc3..6c01407b5 100644 --- a/library/it/pom.xml +++ b/library/it/pom.xml @@ -10,17 +10,17 @@ and is available at http://www.eclipse.org/legal/epl-v10.html - org.opendaylight.controller - mdsal-it-parent - 1.3.0-SNAPSHOT - + org.opendaylight.ovsdb + it + 1.2.1-SNAPSHOT + ../../commons/it 4.0.0 org.opendaylight.ovsdb library-it 1.2.1-SNAPSHOT - bundle + jar org.opendaylight.ovsdb @@ -59,27 +59,24 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ${project.version} test + + org.codehaus.sonar-plugins.java + sonar-jacoco-listeners + test + - - - default - - true - - - true - - - - integrationtest - - false - - - false - - - + + + + org.jacoco + jacoco-maven-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + \ No newline at end of file diff --git a/library/it/src/test/java/org/opendaylight/ovsdb/lib/it/LibraryIntegrationTestBase.java b/library/it/src/test/java/org/opendaylight/ovsdb/lib/it/LibraryIntegrationTestBase.java index f46b5d609..8718eea18 100644 --- a/library/it/src/test/java/org/opendaylight/ovsdb/lib/it/LibraryIntegrationTestBase.java +++ b/library/it/src/test/java/org/opendaylight/ovsdb/lib/it/LibraryIntegrationTestBase.java @@ -11,7 +11,9 @@ package org.opendaylight.ovsdb.lib.it; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.maven; import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperties; +import static org.ops4j.pax.exam.CoreOptions.vmOption; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase; import org.ops4j.pax.exam.Configuration; @@ -53,12 +55,22 @@ public abstract class LibraryIntegrationTestBase extends AbstractMdsalTestBase { public Option[] config() { Option[] parentOptions = super.config(); Option[] propertiesOptions = getPropertiesOptions(); - Option[] options = new Option[parentOptions.length + propertiesOptions.length]; + Option[] otherOptions = getOtherOptions(); + Option[] options = new Option[parentOptions.length + propertiesOptions.length + otherOptions.length]; System.arraycopy(parentOptions, 0, options, 0, parentOptions.length); System.arraycopy(propertiesOptions, 0, options, parentOptions.length, propertiesOptions.length); + System.arraycopy(otherOptions, 0, options, parentOptions.length + propertiesOptions.length, + otherOptions.length); return options; } + private Option[] getOtherOptions() { + return new Option[] { + vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"), + keepRuntimeFolder() + }; + } + public Option[] getPropertiesOptions() { return new Option[] { propagateSystemProperties( diff --git a/openstack/net-virt-it/pom.xml b/openstack/net-virt-it/pom.xml index bbfbcd62c..d1381cdd0 100644 --- a/openstack/net-virt-it/pom.xml +++ b/openstack/net-virt-it/pom.xml @@ -9,10 +9,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html - org.opendaylight.controller - mdsal-it-parent - 1.3.0-SNAPSHOT - + org.opendaylight.ovsdb + it + 1.2.1-SNAPSHOT + ../../commons/it 4.0.0 org.opendaylight.ovsdb @@ -40,11 +40,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html HEAD https://wiki.opendaylight.org/view/OVSDB_Integration:Main - - 2.4 - ${env.PWD} - ${root.directory}/target/code-coverage/jacoco-it.exec - @@ -136,7 +131,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.codehaus.sonar-plugins.java sonar-jacoco-listeners - ${sonar-jacoco-listeners.version} test @@ -149,33 +143,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html + + org.jacoco + jacoco-maven-plugin + org.apache.maven.plugins maven-failsafe-plugin - - - - - - listener - org.sonar.java.jacoco.JUnitListener - - - - - - - - - integration-test - verify - - - ${project.build.directory}/surefire-reports - ${skip.integrationtest} - - - @@ -204,65 +178,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html **/yang/ --> - - org.jacoco - jacoco-maven-plugin - - - prepare-ut-agent - - prepare-agent - - - ${sonar.jacoco.reportPath} - - - - prepare-it-agent - - prepare-agent-integration - - - true - ${sonar.jacoco.itReportPath} - - - - default-report - - report - - - ${sonar.jacoco.reportPath} - - - - default-report-integration - - report-integration - - - ${sonar.jacoco.itReportPath} - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - - - listener - org.sonar.java.jacoco.JUnitListener - - - - - - diff --git a/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java b/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java index 9d8cab55e..43fbb78ef 100644 --- a/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java +++ b/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java @@ -10,6 +10,7 @@ package org.opendaylight.ovsdb.openstack.netvirt.it; import static org.junit.Assert.fail; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.maven; +import static org.ops4j.pax.exam.CoreOptions.vmOption; import static org.ops4j.pax.exam.CoreOptions.when; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; @@ -114,12 +115,22 @@ public class NetvirtIT extends AbstractMdsalTestBase { // Works only if we don't specify the feature repo and name getLoggingOption()}; Option[] propertyOptions = getPropertiesOptions(); - Option[] combinedOptions = new Option[options.length + propertyOptions.length]; + Option[] otherOptions = getOtherOptions(); + Option[] combinedOptions = new Option[options.length + propertyOptions.length + otherOptions.length]; System.arraycopy(options, 0, combinedOptions, 0, options.length); System.arraycopy(propertyOptions, 0, combinedOptions, options.length, propertyOptions.length); + System.arraycopy(otherOptions, 0, combinedOptions, options.length + propertyOptions.length, + otherOptions.length); return combinedOptions; } + private Option[] getOtherOptions() { + return new Option[] { + vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"), + keepRuntimeFolder() + }; + } + @Override public String getKarafDistro() { return maven() diff --git a/openstack/net-virt-providers/pom.xml b/openstack/net-virt-providers/pom.xml index db41788e9..ceb03c033 100644 --- a/openstack/net-virt-providers/pom.xml +++ b/openstack/net-virt-providers/pom.xml @@ -44,6 +44,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html + 0.10.0-SNAPSHOT 0.6.0-SNAPSHOT 0.2.0-SNAPSHOT 0.2.0-SNAPSHOT @@ -51,10 +52,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html 1.2.1-SNAPSHOT 1.2.1-SNAPSHOT 1.5.2 - 2.4 - 0.10.0-SNAPSHOT - ${env.PWD} - ${root.directory}/target/code-coverage/jacoco-it.exec + ../net-virt-it/target/jacoco-it.exec @@ -272,80 +270,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.apache.maven.plugins maven-checkstyle-plugin - - org.apache.maven.plugins - maven-failsafe-plugin - - - - - - listener - org.sonar.java.jacoco.JUnitListener - - - - - - org.apache.maven.plugins maven-surefire-plugin - - listener org.sonar.java.jacoco.JUnitListener - - org.jacoco jacoco-maven-plugin - - - prepare-ut-agent - - prepare-agent - - - ${sonar.jacoco.reportPath} - - - - prepare-it-agent - - prepare-agent-integration - - - true - ${sonar.jacoco.itReportPath} - - - - default-report - - report - - - ${sonar.jacoco.reportPath} - - - - default-report-integration - - report-integration - - - ${sonar.jacoco.itReportPath} - - - diff --git a/openstack/net-virt-sfc/impl/pom.xml b/openstack/net-virt-sfc/impl/pom.xml index 9c8652e73..2bcd2aac4 100644 --- a/openstack/net-virt-sfc/impl/pom.xml +++ b/openstack/net-virt-sfc/impl/pom.xml @@ -23,6 +23,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html openstack.net-virt-sfc-impl 1.0.0-SNAPSHOT bundle + + + ../it/target/jacoco-it.exec + + ${project.groupId} @@ -36,12 +41,37 @@ and is available at http://www.eclipse.org/legal/epl-v10.html junit test - org.mockito mockito-all test + + org.codehaus.sonar-plugins.java + sonar-jacoco-listeners + ${sonar-jacoco-listeners.version} + test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + listener + org.sonar.java.jacoco.JUnitListener + + + + + + org.jacoco + jacoco-maven-plugin + + + diff --git a/openstack/net-virt-sfc/it/pom.xml b/openstack/net-virt-sfc/it/pom.xml index cba80a2a1..1a0ade182 100644 --- a/openstack/net-virt-sfc/it/pom.xml +++ b/openstack/net-virt-sfc/it/pom.xml @@ -12,20 +12,19 @@ and is available at http://www.eclipse.org/legal/epl-v10.html xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.opendaylight.controller - mdsal-it-parent - 1.3.0-SNAPSHOT - + org.opendaylight.ovsdb + it + 1.2.1-SNAPSHOT + ../../../commons/it 4.0.0 org.opendaylight.ovsdb openstack.net-virt-sfc-it 1.0.0-SNAPSHOT - bundle + jar - false org.opendaylight.ovsdb openstack.net-virt-sfc-karaf 1.0.0-SNAPSHOT @@ -60,4 +59,17 @@ and is available at http://www.eclipse.org/legal/epl-v10.html + + + + + org.jacoco + jacoco-maven-plugin + + + maven-failsafe-plugin + + + + diff --git a/openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java b/openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java index d8a5a849f..86cec607f 100644 --- a/openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java +++ b/openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java @@ -9,12 +9,15 @@ package org.opendaylight.ovsdb.openstack.netvirt.sfc; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.maven; +import static org.ops4j.pax.exam.CoreOptions.vmOption; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; +import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase; +import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel; @@ -54,6 +57,24 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase { return "odl-ovsdb-sfc-ui"; } + @Configuration + @Override + public Option[] config() { + Option[] parentOptions = super.config(); + Option[] otherOptions = getOtherOptions(); + Option[] options = new Option[parentOptions.length + otherOptions.length]; + System.arraycopy(parentOptions, 0, options, 0, parentOptions.length); + System.arraycopy(otherOptions, 0, options, parentOptions.length, otherOptions.length); + return options; + } + + private Option[] getOtherOptions() { + return new Option[] { + vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"), + keepRuntimeFolder() + }; + } + @Override public Option getLoggingOption() { Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG, diff --git a/openstack/net-virt/pom.xml b/openstack/net-virt/pom.xml index f80c2c9d1..3fa44351f 100644 --- a/openstack/net-virt/pom.xml +++ b/openstack/net-virt/pom.xml @@ -49,9 +49,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html 1.2.1-SNAPSHOT 1.2.1-SNAPSHOT 1.5.2 - 2.4 - ${env.PWD} - ${root.directory}/target/code-coverage/jacoco-it.exec + ../net-virt-it/target/jacoco-it.exec @@ -227,81 +225,22 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.apache.maven.plugins maven-checkstyle-plugin - - org.apache.maven.plugins - maven-failsafe-plugin - - - - - - listener - org.sonar.java.jacoco.JUnitListener - - - - - - org.apache.maven.plugins maven-surefire-plugin - - listener org.sonar.java.jacoco.JUnitListener - - org.jacoco jacoco-maven-plugin - - - prepare-ut-agent - - prepare-agent - - - ${sonar.jacoco.reportPath} - - - - prepare-it-agent - - prepare-agent-integration - - - true - ${sonar.jacoco.itReportPath} - - - - default-report - - report - - - ${sonar.jacoco.reportPath} - - - - default-report-integration - - report-integration - - - ${sonar.jacoco.itReportPath} - - - - + diff --git a/southbound/southbound-impl/pom.xml b/southbound/southbound-impl/pom.xml index 8796ccf3f..342d8c80d 100644 --- a/southbound/southbound-impl/pom.xml +++ b/southbound/southbound-impl/pom.xml @@ -44,6 +44,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html 1.5.2 + ../southbound-it/target/jacoco-it.exec @@ -87,6 +88,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ${powermock.version} test + + org.codehaus.sonar-plugins.java + sonar-jacoco-listeners + ${sonar-jacoco-listeners.version} + test + @@ -112,49 +119,22 @@ and is available at http://www.eclipse.org/legal/epl-v10.html **/yang/ + + org.apache.maven.plugins + maven-surefire-plugin + + + + listener + org.sonar.java.jacoco.JUnitListener + + + + org.jacoco jacoco-maven-plugin - - - prepare-ut-agent - - prepare-agent - - - ${sonar.jacoco.reportPath} - - - - prepare-it-agent - - prepare-agent-integration - - - ${sonar.jacoco.itReportPath} - - - - default-report - - report - - - ${sonar.jacoco.reportPath} - - - - default-report-integration - - report-integration - - - ${sonar.jacoco.itReportPath} - - - - diff --git a/southbound/southbound-it/pom.xml b/southbound/southbound-it/pom.xml index 677e9f64b..88387769a 100644 --- a/southbound/southbound-it/pom.xml +++ b/southbound/southbound-it/pom.xml @@ -9,10 +9,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html - org.opendaylight.controller - mdsal-it-parent - 1.3.0-SNAPSHOT - + org.opendaylight.ovsdb + it + 1.2.1-SNAPSHOT + ../../commons/it 4.0.0 org.opendaylight.ovsdb @@ -40,11 +40,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html HEAD https://wiki.opendaylight.org/view/OVSDB_Integration:Main - - 2.4 - ${env.PWD} - ${root.directory}/target/code-coverage/jacoco-it.exec - @@ -140,7 +135,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.codehaus.sonar-plugins.java sonar-jacoco-listeners - ${sonar-jacoco-listeners.version} test @@ -154,48 +148,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html - org.apache.maven.plugins - maven-failsafe-plugin - - - - - - listener - org.sonar.java.jacoco.JUnitListener - - - - - - - - - integration-test - verify - - - ${project.build.directory}/surefire-reports - ${skip.integrationtest} - - - + org.jacoco + jacoco-maven-plugin org.apache.maven.plugins - maven-surefire-plugin - - - - - - listener - org.sonar.java.jacoco.JUnitListener - - - - - + maven-failsafe-plugin @@ -224,68 +182,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html **/yang/ - - org.jacoco - jacoco-maven-plugin - - - prepare-ut-agent - - prepare-agent - - - ${sonar.jacoco.reportPath} - - - - prepare-it-agent - - prepare-agent-integration - - - ${sonar.jacoco.itReportPath} - - - - default-report - - report - - - ${sonar.jacoco.reportPath} - - - - default-report-integration - - report-integration - - - ${sonar.jacoco.itReportPath} - - - - - - - default - - true - - - true - - - - integrationtest - - false - - - false - - - diff --git a/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java b/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java index ce39400cd..49bcc54bc 100644 --- a/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java +++ b/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java @@ -11,6 +11,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.maven; +import static org.ops4j.pax.exam.CoreOptions.vmOption; import static org.ops4j.pax.exam.CoreOptions.when; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; @@ -158,12 +159,22 @@ public class SouthboundIT extends AbstractMdsalTestBase { // Works only if we don't specify the feature repo and name getLoggingOption()}; Option[] propertyOptions = getPropertiesOptions(); - Option[] combinedOptions = new Option[options.length + propertyOptions.length]; + Option[] otherOptions = getOtherOptions(); + Option[] combinedOptions = new Option[options.length + propertyOptions.length + otherOptions.length]; System.arraycopy(options, 0, combinedOptions, 0, options.length); System.arraycopy(propertyOptions, 0, combinedOptions, options.length, propertyOptions.length); + System.arraycopy(otherOptions, 0, combinedOptions, options.length + propertyOptions.length, + otherOptions.length); return combinedOptions; } + private Option[] getOtherOptions() { + return new Option[] { + vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"), + keepRuntimeFolder() + }; + } + @Override public String getKarafDistro() { return maven()