Added sonar converage for mdsal. 76/2076/2
authorEd Warnicke <eaw@cisco.com>
Tue, 22 Oct 2013 14:31:32 +0000 (09:31 -0500)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 22 Oct 2013 18:49:53 +0000 (18:49 +0000)
Change-Id: Iebf580b59a5a03ff104adcc88cf6b9c162acb854
Signed-off-by: Ed Warnicke <eaw@cisco.com>
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-binding-it/pom.xml

index c5ffe43..093cdaf 100644 (file)
         <osgi.core.version>5.0.0</osgi.core.version>
         <junit.version>4.8.1</junit.version>
         <xtend.version>2.4.3</xtend.version>
+        <jacoco.version>0.5.3.201107060350</jacoco.version>
+        <!-- Sonar properties using jacoco to retrieve integration test results -->
+        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+        <!-- Sonar properties using jacoco to retrieve integration test results -->
+        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
+        <sonar.jacoco.Reportpath>target/jacoco.exec</sonar.jacoco.Reportpath>
+        <sonar.jacoco.itReportPath>target/jacoco-it.exec</sonar.jacoco.itReportPath>
+        <sonar.host.url>https://sonar.opendaylight.org/</sonar.host.url>
+        <sonar.branch>${user.name}-private-view</sonar.branch>
+        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+        <sonar.language>java</sonar.language>
     </properties>
 
     <pluginRepositories>
                         </filesets>
                     </configuration>
                 </plugin>
+                <plugin>
+                    <groupId>org.jacoco</groupId>
+                    <artifactId>jacoco-maven-plugin</artifactId>
+                    <version>${jacoco.version}</version>
+                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <configuration>
+                  <includes>org.opendaylight.controller.*</includes>
+                </configuration>
+                <executions>
+                  <execution>
+                    <id>pre-test</id>
+                    <goals>
+                      <goal>prepare-agent</goal>
+                    </goals>
+                  </execution>
+                  <execution>
+                    <id>post-test</id>
+                    <phase>test</phase>
+                    <goals>
+                      <goal>report</goal>
+                    </goals>
+                  </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
     <reporting>
index e5d9ba9..e4afc81 100644 (file)
@@ -16,6 +16,9 @@
   <properties>
     <exam.version>3.0.0</exam.version>
     <url.version>1.5.0</url.version>
+    <!-- Sonar jacoco plugin to get integration test coverage info -->
+    <sonar.jacoco.reportPath>../sal-binding-broker/target/jacoco.exec</sonar.jacoco.reportPath>
+    <sonar.jacoco.itReportPath>../sal-binding-broker/target/jacoco-it.exec</sonar.jacoco.itReportPath>
   </properties>
 
   <build>
@@ -36,7 +39,7 @@
     </plugins>
     <pluginManagement>
       <plugins>
-        <!--This plugin's configuration is used to store Eclipse m2e settings 
+        <!--This plugin's configuration is used to store Eclipse m2e settings
           only. It has no influence on the Maven build itself. -->
         <plugin>
           <groupId>org.eclipse.m2e</groupId>
             </lifecycleMappingMetadata>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.jacoco</groupId>
+          <artifactId>jacoco-maven-plugin</artifactId>
+          <version>${jacoco.version}</version>
+          <configuration>
+            <destFile>../sal-binding-broker/target/jacoco-it.exec</destFile>
+            <includes>org.opendaylight.controller.*</includes>
+          </configuration>
+          <executions>
+            <execution>
+              <id>pre-test</id>
+              <goals>
+                <goal>prepare-agent</goal>
+              </goals>
+            </execution>
+            <execution>
+              <id>post-test</id>
+              <configuration>
+                <skip>true</skip>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
       </plugins>
     </pluginManagement>
   </build>