Author: veithen
Date: Sun Jan 21 16:41:45 2018
New Revision: 1821809

URL: http://svn.apache.org/viewvc?rev=1821809&view=rev
Log:
Add JaCoCo instrumentation.

Added:
    axis/axis2/java/core/trunk/code-coverage/   (with props)
    axis/axis2/java/core/trunk/code-coverage/pom.xml   (with props)
Modified:
    axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml
    axis/axis2/java/core/trunk/modules/integration/pom.xml
    axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml
    axis/axis2/java/core/trunk/modules/jaxws/pom.xml
    
axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
    axis/axis2/java/core/trunk/modules/metadata/pom.xml
    axis/axis2/java/core/trunk/modules/saaj/pom.xml
    axis/axis2/java/core/trunk/modules/transport/jms/pom.xml
    axis/axis2/java/core/trunk/modules/transport/mail/pom.xml
    axis/axis2/java/core/trunk/pom.xml

Propchange: axis/axis2/java/core/trunk/code-coverage/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jan 21 16:41:45 2018
@@ -0,0 +1,3 @@
+.project
+.settings
+target

Added: axis/axis2/java/core/trunk/code-coverage/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/code-coverage/pom.xml?rev=1821809&view=auto
==============================================================================
--- axis/axis2/java/core/trunk/code-coverage/pom.xml (added)
+++ axis/axis2/java/core/trunk/code-coverage/pom.xml Sun Jan 21 16:41:45 2018
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements. See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership. The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied. See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.axis2</groupId>
+        <artifactId>axis2</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>code-coverage</artifactId>
+    <packaging>pom</packaging>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-adb-codegen</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-adb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-adb-tests</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-clustering</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-codegen</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-fastinfoset</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-integration</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-java2wsdl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-jaxbri-codegen</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-jaxws</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-jaxws-integration</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-jibx</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-json</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-kernel</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-metadata</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-mtompolicy</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-saaj</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-transport-base</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-transport-http</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-transport-http-hc3</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-transport-jms</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-transport-local</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-transport-mail</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-transport-tcp</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-transport-udp</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-xmlbeans</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jaxbri-tests</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>osgi-tests</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>webapp-tests</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.github.veithen.phos</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.2</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>aggregate-report</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

Propchange: axis/axis2/java/core/trunk/code-coverage/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml Sun Jan 21 16:41:45 
2018
@@ -246,7 +246,7 @@
                          because the test server doesn't shut down properly :-(
                          Should be removed if possible -->
                     <forkMode>pertest</forkMode>
-                    <argLine>-Xms256m -Xmx512m</argLine>
+                    <argLine>${argLine} -Xms256m -Xmx512m</argLine>
                     <!-- Enable the next 2 lines if you want to attach a 
debugger
                    <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
                     <includes>

Modified: axis/axis2/java/core/trunk/modules/integration/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/integration/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/integration/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/integration/pom.xml Sun Jan 21 16:41:45 
2018
@@ -538,7 +538,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <inherited>true</inherited>
                 <configuration>
-                    <argLine>-Xms256m -Xmx512m</argLine>
+                    <argLine>${argLine} -Xms256m -Xmx512m</argLine>
                     <!-- Enable the next 2 lines if you want to attach a 
debugger
                  <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
                     <includes>

Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml Sun Jan 21 
16:41:45 2018
@@ -1376,7 +1376,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <inherited>true</inherited>
                 <configuration>
-                    <argLine>-Xms256m -Xmx512m 
-Xbootclasspath/p:${jaxws.bootclasspath}</argLine>
+                    <argLine>${argLine} -Xms256m -Xmx512m 
-Xbootclasspath/p:${jaxws.bootclasspath}</argLine>
                     <!-- Enable the next 2 lines if you want to attach a 
debugger
                     <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
                     <includes>

Modified: axis/axis2/java/core/trunk/modules/jaxws/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/jaxws/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/jaxws/pom.xml Sun Jan 21 16:41:45 2018
@@ -362,7 +362,7 @@
                 <inherited>true</inherited>
                 <configuration>
                     <forkMode>once</forkMode>
-                    <argLine>-Xms256m -Xmx512m 
-Xbootclasspath/p:${jaxws.bootclasspath}</argLine>
+                    <argLine>${argLine} -Xms256m -Xmx512m 
-Xbootclasspath/p:${jaxws.bootclasspath}</argLine>
                     <!-- Enable the next 2 lines if you want to attach a 
debugger
                     <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
                     <includes>

Modified: 
axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
 Sun Jan 21 16:41:45 2018
@@ -23,7 +23,9 @@ import junit.framework.TestCase;
 import org.apache.axis2.context.MessageContext;
 
 import java.lang.reflect.Field;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
 public class MessageContextChangeTest extends TestCase {
     private FieldDescription[] knownList = {
@@ -127,7 +129,15 @@ public class MessageContextChangeTest ex
 
         Class mcClass = mc.getClass();
 
-        Field [] fields = mcClass.getDeclaredFields();
+        List<Field> fieldList = new ArrayList<>();
+        for (Field field : mcClass.getDeclaredFields()) {
+            // Ignore fields added by instrumentation (such as JaCoCo)
+            if (!field.getName().startsWith("$")) {
+                fieldList.add(field);
+            }
+        }
+        Field[] fields = fieldList.toArray(new Field[fieldList.size()]);
+
         int numberFields = fields.length;
 
         int numberKnownFields = knownList.length;

Modified: axis/axis2/java/core/trunk/modules/metadata/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/metadata/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/metadata/pom.xml Sun Jan 21 16:41:45 2018
@@ -260,7 +260,7 @@
                 <inherited>true</inherited>
                 <configuration>
                     <argLine>
-                        -Xbootclasspath/p:${jaxws.bootclasspath}
+                        ${argLine} -Xbootclasspath/p:${jaxws.bootclasspath}
                     </argLine>
                     <includes>
                         <include>**/*Tests.java</include>

Modified: axis/axis2/java/core/trunk/modules/saaj/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/saaj/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/saaj/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/saaj/pom.xml Sun Jan 21 16:41:45 2018
@@ -183,7 +183,7 @@
                         presence of jaxp-ri on the classpath.
                       * Please leave this on a single line. Adding a newline 
between the two
                         options causes a build failure. -->
-                    <argLine>-Xbootclasspath/p:${surefire.bootclasspath} 
-Dcom.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration=com.sun.org.apache.xerces.internal.parsers.XIncludeParserConfiguration</argLine>
+                    <argLine>${argLine} 
-Xbootclasspath/p:${surefire.bootclasspath} 
-Dcom.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration=com.sun.org.apache.xerces.internal.parsers.XIncludeParserConfiguration</argLine>
                     <systemProperties>
                         <!-- Prevent Mac OS X from showing an icon in the dock 
during the test run -->
                         <property>

Modified: axis/axis2/java/core/trunk/modules/transport/jms/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/jms/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/transport/jms/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/transport/jms/pom.xml Sun Jan 21 
16:41:45 2018
@@ -75,7 +75,7 @@
                             <value>file:../../log4j.properties</value>
                         </property>
                     </systemProperties>
-                    <argLine>-javaagent:target/lib/aspectjweaver.jar -Xms64m 
-Xmx128m</argLine>
+                    <argLine>${argLine} 
-javaagent:target/lib/aspectjweaver.jar -Xms64m -Xmx128m</argLine>
                 </configuration>
             </plugin>
             <plugin>

Modified: axis/axis2/java/core/trunk/modules/transport/mail/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/mail/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/transport/mail/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/transport/mail/pom.xml Sun Jan 21 
16:41:45 2018
@@ -100,7 +100,7 @@
               <value>target/cobertura.ser</value>
             </property>
           </systemProperties>
-          <argLine>-javaagent:target/lib/aspectjweaver.jar -Xms64m 
-Xmx128m</argLine>
+          <argLine>${argLine} -javaagent:target/lib/aspectjweaver.jar -Xms64m 
-Xmx128m</argLine>
         </configuration>
       </plugin>
     </plugins>

Modified: axis/axis2/java/core/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/pom.xml?rev=1821809&r1=1821808&r2=1821809&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/pom.xml (original)
+++ axis/axis2/java/core/trunk/pom.xml Sun Jan 21 16:41:45 2018
@@ -104,6 +104,7 @@
         <module>modules/samples</module>
         <module>databinding-tests</module>
         <module>systests</module>
+        <module>code-coverage</module>
     </modules>
     <profiles>
         <profile>
@@ -1398,6 +1399,24 @@
                 </executions>
             </plugin>
             <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.8.0</version>
+                <executions>
+                    <execution>
+                        <id>prepare-agent</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                        <configuration>
+                            <includes>
+                                <include>org.apache.axis2.*</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <!-- Make test execution deterministic -->
@@ -1425,6 +1444,18 @@
                 </configuration>
             </plugin>
             <plugin>
+                <groupId>com.github.veithen.phos</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.2</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>install-data-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <!-- Always build source JARs -->
                 <artifactId>maven-source-plugin</artifactId>
                 <executions>


Reply via email to