New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
activejdbc with JaCoCo and sonarqube include coverage of static methods #849
Comments
We do have some projects using JaCoCo successfully. Can you provide stack traces, any other evidence? Best if you create a small app that highlights your issue. |
@garcimouche do you have any more input? If not, will be rejecting this |
@ipolevoy Would you mind to share a working pom-file with jacoco and javalite? I am struggling with the exact same problem as reported by @garcimouche Running the tests and generating the Jacoco reports works fine, but importing them to SonarQube fails. (Haven't looked up the second problem with the generation of "static methods on my Model that I don't necessarily cover with my integration tests") I am using ActiveJDBC/ActiveWeb 2.3 with jacoco-maven-plugin v0.8.5-SNAPSHOT and maven-surefire-plugin v2.22.2 <plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5-SNAPSHOT</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal> <!-- Am I missing a goal here which makes everything work? -->
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<reportFormat>brief</reportFormat>
<trimStackTrace>true</trimStackTrace>
<useFile>false</useFile>
<includes>
<include>**/*Spec*.java</include>
<include>**/*Test*.java</include>
</includes>
</configuration>
</plugin> Running
Having a look at the xml-reports, it seems that all ActiveJDBC-related model functions are added and referenced under jacoco.xml excerpt [Click to expand]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.1//EN" "report.dtd">
<report name="MyApp">
<sessioninfo id="4Y16Q72-6788a2bc" start="1566537101920" dump="1566537108447" />
<package name="app/models">
<class name="app/models/Client" sourcefilename="Client.java">
<method name="<init>" desc="()V" line="20">
<counter type="INSTRUCTION" missed="0" covered="3" />
<counter type="LINE" missed="0" covered="1" />
<counter type="COMPLEXITY" missed="0" covered="1" />
<counter type="METHOD" missed="0" covered="1" />
</method>
<method name="setScopes" desc="(Ljava/lang/Object;)V" line="23">
<counter type="INSTRUCTION" missed="15" covered="0" />
<counter type="LINE" missed="4" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="getClientScopes" desc="()Ljava/util/List;" line="30">
<counter type="INSTRUCTION" missed="6" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="getScopes" desc="()Ljava/util/List;" line="34">
<counter type="INSTRUCTION" missed="49" covered="0" />
<counter type="BRANCH" missed="10" covered="0" />
<counter type="LINE" missed="12" covered="0" />
<counter type="COMPLEXITY" missed="6" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="getClaims" desc="()Ljava/util/Map;" line="55">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="authenticate" desc="(Ljava/lang/String;)Z" line="65">
<counter type="INSTRUCTION" missed="18" covered="0" />
<counter type="LINE" missed="4" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="getDepartment" desc="()Lapp/models/Department;" line="73">
<counter type="INSTRUCTION" missed="15" covered="0" />
<counter type="BRANCH" missed="2" covered="0" />
<counter type="LINE" missed="4" covered="0" />
<counter type="COMPLEXITY" missed="2" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="getGroups" desc="()Ljava/util/List;" line="81">
<counter type="INSTRUCTION" missed="12" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="storeNew" desc="(Ljava/util/Map;)Lapp/models/Client;" line="85">
<counter type="INSTRUCTION" missed="97" covered="0" />
<counter type="BRANCH" missed="6" covered="0" />
<counter type="LINE" missed="20" covered="0" />
<counter type="COMPLEXITY" missed="4" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="updateExisting" desc="(Lapp/models/Client;Ljava/util/Map;)Lapp/models/Client;" line="117">
<counter type="INSTRUCTION" missed="38" covered="0" />
<counter type="BRANCH" missed="8" covered="0" />
<counter type="LINE" missed="9" covered="0" />
<counter type="COMPLEXITY" missed="5" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="getMetaModel" desc="()Lorg/javalite/activejdbc/MetaModel;" line="168">
<counter type="INSTRUCTION" missed="0" covered="3" />
<counter type="LINE" missed="0" covered="1" />
<counter type="COMPLEXITY" missed="0" covered="1" />
<counter type="METHOD" missed="0" covered="1" />
</method>
<method name="metaModel" desc="()Lorg/javalite/activejdbc/MetaModel;" line="177">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="findOrCreateIt" desc="([Ljava/lang/Object;)Lorg/javalite/activejdbc/Model;" line="211">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="findOrInit" desc="([Ljava/lang/Object;)Lorg/javalite/activejdbc/Model;" line="224">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="attributes" desc="()Ljava/util/List;" line="422">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="attributeNames" desc="()Ljava/util/Set;" line="430">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="associations" desc="()Ljava/util/List;" line="438">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="delete" desc="(Ljava/lang/String;[Ljava/lang/Object;)I" line="782">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="exists" desc="(Ljava/lang/Object;)Z" line="792">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="deleteAll" desc="()I" line="810">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="update" desc="(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)I" line="831">
<counter type="INSTRUCTION" missed="6" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="updateAll" desc="(Ljava/lang/String;[Ljava/lang/Object;)I" line="850">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="validateNumericalityOf" desc="([Ljava/lang/String;)Lorg/javalite/activejdbc/validation/NumericValidationBuilder;" line="1952">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="addValidator" desc="(Lorg/javalite/activejdbc/validation/Validator;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="1961">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="addScope" desc="(Ljava/lang/String;Ljava/lang/String;)V" line="1971">
<counter type="INSTRUCTION" missed="6" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="removeValidator" desc="(Lorg/javalite/activejdbc/validation/Validator;)V" line="1993">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="getValidators" desc="(Ljava/lang/Class;)Ljava/util/List;" line="1998">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="validateRegexpOf" desc="(Ljava/lang/String;Ljava/lang/String;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="2008">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="validateEmailOf" desc="(Ljava/lang/String;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="2017">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="validateRange" desc="(Ljava/lang/String;Ljava/lang/Number;Ljava/lang/Number;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="2029">
<counter type="INSTRUCTION" missed="6" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="validatePresenceOf" desc="([Ljava/lang/String;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="2038">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="validateWith" desc="(Lorg/javalite/activejdbc/validation/Validator;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="2047">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="convertWith" desc="(Lorg/javalite/activejdbc/validation/Converter;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="2058">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="convertWith" desc="(Lorg/javalite/activejdbc/conversion/Converter;[Ljava/lang/String;)V" line="2068">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="convertDate" desc="(Ljava/lang/String;Ljava/lang/String;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="2082">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="convertTimestamp" desc="(Ljava/lang/String;Ljava/lang/String;)Lorg/javalite/activejdbc/validation/ValidationBuilder;" line="2096">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="dateFormat" desc="(Ljava/lang/String;[Ljava/lang/String;)V" line="2127">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="dateFormat" desc="(Ljava/text/DateFormat;[Ljava/lang/String;)V" line="2140">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="timestampFormat" desc="(Ljava/lang/String;[Ljava/lang/String;)V" line="2171">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="timestampFormat" desc="(Ljava/text/DateFormat;[Ljava/lang/String;)V" line="2184">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="blankToNull" desc="([Ljava/lang/String;)V" line="2194">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="zeroToNull" desc="([Ljava/lang/String;)V" line="2204">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="belongsTo" desc="(Ljava/lang/Class;)Z" line="2208">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="addCallbacks" desc="([Lorg/javalite/activejdbc/CallbackListener;)V" line="2216">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="callbackWith" desc="([Lorg/javalite/activejdbc/CallbackListener;)V" line="2225">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="create" desc="([Ljava/lang/Object;)Lorg/javalite/activejdbc/Model;" line="2307">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="createIt" desc="([Ljava/lang/Object;)Lorg/javalite/activejdbc/Model;" line="2349">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="findById" desc="(Ljava/lang/Object;)Lorg/javalite/activejdbc/Model;" line="2353">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="findByCompositeKeys" desc="([Ljava/lang/Object;)Lorg/javalite/activejdbc/Model;" line="2364">
<counter type="INSTRUCTION" missed="4" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="where" desc="(Ljava/lang/String;[Ljava/lang/Object;)Lorg/javalite/activejdbc/LazyList;" line="2399">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="scopes" desc="([Ljava/lang/String;)Lorg/javalite/activejdbc/ScopeBuilder;" line="2415">
<counter type="INSTRUCTION" missed="6" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="scope" desc="(Ljava/lang/String;)Lorg/javalite/activejdbc/ScopeBuilder;" line="2430">
<counter type="INSTRUCTION" missed="11" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="find" desc="(Ljava/lang/String;[Ljava/lang/Object;)Lorg/javalite/activejdbc/LazyList;" line="2444">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="findFirst" desc="(Ljava/lang/String;[Ljava/lang/Object;)Lorg/javalite/activejdbc/Model;" line="2462">
<counter type="INSTRUCTION" missed="0" covered="5" />
<counter type="LINE" missed="0" covered="1" />
<counter type="COMPLEXITY" missed="0" covered="1" />
<counter type="METHOD" missed="0" covered="1" />
</method>
<method name="first" desc="(Ljava/lang/String;[Ljava/lang/Object;)Lorg/javalite/activejdbc/Model;" line="2491">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="find" desc="(Ljava/lang/String;Lorg/javalite/activejdbc/ModelListener;)V" line="2503">
<counter type="INSTRUCTION" missed="7" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="findWith" desc="(Lorg/javalite/activejdbc/ModelListener;Ljava/lang/String;[Ljava/lang/Object;)V" line="2514">
<counter type="INSTRUCTION" missed="6" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="findBySQL" desc="(Ljava/lang/String;[Ljava/lang/Object;)Lorg/javalite/activejdbc/LazyList;" line="2531">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="findAll" desc="()Lorg/javalite/activejdbc/LazyList;" line="2540">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="count" desc="()Ljava/lang/Long;" line="2767">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="count" desc="(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Long;" line="2778">
<counter type="INSTRUCTION" missed="5" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="modelClass" desc="()Ljava/lang/Class;">
<counter type="INSTRUCTION" missed="0" covered="2" />
<counter type="COMPLEXITY" missed="0" covered="1" />
<counter type="METHOD" missed="0" covered="1" />
</method>
<method name="getTableName" desc="()Ljava/lang/String;" line="2941">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="isCached" desc="()Z" line="3082">
<counter type="INSTRUCTION" missed="8" covered="0" />
<counter type="BRANCH" missed="2" covered="0" />
<counter type="LINE" missed="1" covered="0" />
<counter type="COMPLEXITY" missed="2" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<method name="purgeCache" desc="()V" line="3090">
<counter type="INSTRUCTION" missed="3" covered="0" />
<counter type="LINE" missed="2" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
<counter type="INSTRUCTION" missed="491" covered="13" />
<counter type="BRANCH" missed="28" covered="0" />
<counter type="LINE" missed="122" covered="3" />
<counter type="COMPLEXITY" missed="75" covered="4" />
<counter type="METHOD" missed="61" covered="4" />
<counter type="CLASS" missed="0" covered="1" />
</class>
<sourcefile name="Client.java">
<line nr="20" mi="0" ci="3" mb="0" cb="0" />
<line nr="23" mi="8" ci="0" mb="0" cb="0" />
<line nr="24" mi="1" ci="0" mb="0" cb="0" />
<line nr="26" mi="5" ci="0" mb="0" cb="0" />
<line nr="27" mi="1" ci="0" mb="0" cb="0" />
<line nr="30" mi="6" ci="0" mb="0" cb="0" />
<line nr="34" mi="6" ci="0" mb="0" cb="0" />
<line nr="35" mi="4" ci="0" mb="0" cb="0" />
<line nr="37" mi="2" ci="0" mb="2" cb="0" />
<line nr="39" mi="10" ci="0" mb="2" cb="0" />
<line nr="40" mi="3" ci="0" mb="0" cb="0" />
<line nr="41" mi="2" ci="0" mb="2" cb="0" />
<line nr="42" mi="10" ci="0" mb="2" cb="0" />
<line nr="43" mi="4" ci="0" mb="2" cb="0" />
<line nr="44" mi="4" ci="0" mb="0" cb="0" />
<line nr="46" mi="1" ci="0" mb="0" cb="0" />
<line nr="48" mi="1" ci="0" mb="0" cb="0" />
<line nr="50" mi="2" ci="0" mb="0" cb="0" />
<line nr="55" mi="4" ci="0" mb="0" cb="0" />
<line nr="65" mi="4" ci="0" mb="0" cb="0" />
<line nr="66" mi="4" ci="0" mb="0" cb="0" />
<line nr="67" mi="4" ci="0" mb="0" cb="0" />
<line nr="69" mi="6" ci="0" mb="0" cb="0" />
<line nr="73" mi="5" ci="0" mb="0" cb="0" />
<line nr="74" mi="6" ci="0" mb="2" cb="0" />
<line nr="75" mi="2" ci="0" mb="0" cb="0" />
<line nr="77" mi="2" ci="0" mb="0" cb="0" />
<line nr="81" mi="12" ci="0" mb="0" cb="0" />
<line nr="85" mi="4" ci="0" mb="0" cb="0" />
<line nr="86" mi="4" ci="0" mb="0" cb="0" />
<line nr="88" mi="3" ci="0" mb="0" cb="0" />
<line nr="89" mi="8" ci="0" mb="0" cb="0" />
<line nr="90" mi="2" ci="0" mb="0" cb="0" />
<line nr="92" mi="4" ci="0" mb="2" cb="0" />
<line nr="93" mi="5" ci="0" mb="0" cb="0" />
<line nr="94" mi="17" ci="0" mb="0" cb="0" />
<line nr="97" mi="4" ci="0" mb="0" cb="0" />
<line nr="98" mi="7" ci="0" mb="0" cb="0" />
<line nr="99" mi="5" ci="0" mb="0" cb="0" />
<line nr="100" mi="5" ci="0" mb="0" cb="0" />
<line nr="101" mi="5" ci="0" mb="0" cb="0" />
<line nr="102" mi="7" ci="0" mb="0" cb="0" />
<line nr="103" mi="5" ci="0" mb="0" cb="0" />
<line nr="105" mi="3" ci="0" mb="2" cb="0" />
<line nr="106" mi="2" ci="0" mb="0" cb="0" />
<line nr="109" mi="2" ci="0" mb="2" cb="0" />
<line nr="110" mi="3" ci="0" mb="0" cb="0" />
<line nr="113" mi="2" ci="0" mb="0" cb="0" />
<line nr="117" mi="4" ci="0" mb="2" cb="0" />
<line nr="118" mi="7" ci="0" mb="0" cb="0" />
<line nr="120" mi="4" ci="0" mb="2" cb="0" />
<line nr="121" mi="7" ci="0" mb="0" cb="0" />
<line nr="123" mi="4" ci="0" mb="2" cb="0" />
<line nr="124" mi="5" ci="0" mb="0" cb="0" />
<line nr="126" mi="3" ci="0" mb="2" cb="0" />
<line nr="127" mi="2" ci="0" mb="0" cb="0" />
<line nr="129" mi="2" ci="0" mb="0" cb="0" />
<line nr="168" mi="0" ci="3" mb="0" cb="0" />
<line nr="177" mi="3" ci="0" mb="0" cb="0" />
<line nr="211" mi="4" ci="0" mb="0" cb="0" />
<line nr="224" mi="4" ci="0" mb="0" cb="0" />
<line nr="422" mi="3" ci="0" mb="0" cb="0" />
<line nr="430" mi="3" ci="0" mb="0" cb="0" />
<line nr="438" mi="3" ci="0" mb="0" cb="0" />
<line nr="782" mi="5" ci="0" mb="0" cb="0" />
<line nr="792" mi="4" ci="0" mb="0" cb="0" />
<line nr="810" mi="3" ci="0" mb="0" cb="0" />
<line nr="831" mi="6" ci="0" mb="0" cb="0" />
<line nr="850" mi="5" ci="0" mb="0" cb="0" />
<line nr="1952" mi="4" ci="0" mb="0" cb="0" />
<line nr="1961" mi="4" ci="0" mb="0" cb="0" />
<line nr="1971" mi="5" ci="0" mb="0" cb="0" />
<line nr="1972" mi="1" ci="0" mb="0" cb="0" />
<line nr="1993" mi="3" ci="0" mb="0" cb="0" />
<line nr="1994" mi="1" ci="0" mb="0" cb="0" />
<line nr="1998" mi="3" ci="0" mb="0" cb="0" />
<line nr="2008" mi="5" ci="0" mb="0" cb="0" />
<line nr="2017" mi="4" ci="0" mb="0" cb="0" />
<line nr="2029" mi="6" ci="0" mb="0" cb="0" />
<line nr="2038" mi="4" ci="0" mb="0" cb="0" />
<line nr="2047" mi="4" ci="0" mb="0" cb="0" />
<line nr="2058" mi="4" ci="0" mb="0" cb="0" />
<line nr="2068" mi="4" ci="0" mb="0" cb="0" />
<line nr="2069" mi="1" ci="0" mb="0" cb="0" />
<line nr="2082" mi="5" ci="0" mb="0" cb="0" />
<line nr="2096" mi="5" ci="0" mb="0" cb="0" />
<line nr="2127" mi="4" ci="0" mb="0" cb="0" />
<line nr="2128" mi="1" ci="0" mb="0" cb="0" />
<line nr="2140" mi="4" ci="0" mb="0" cb="0" />
<line nr="2141" mi="1" ci="0" mb="0" cb="0" />
<line nr="2171" mi="4" ci="0" mb="0" cb="0" />
<line nr="2172" mi="1" ci="0" mb="0" cb="0" />
<line nr="2184" mi="4" ci="0" mb="0" cb="0" />
<line nr="2185" mi="1" ci="0" mb="0" cb="0" />
<line nr="2194" mi="3" ci="0" mb="0" cb="0" />
<line nr="2195" mi="1" ci="0" mb="0" cb="0" />
<line nr="2204" mi="3" ci="0" mb="0" cb="0" />
<line nr="2205" mi="1" ci="0" mb="0" cb="0" />
<line nr="2208" mi="4" ci="0" mb="0" cb="0" />
<line nr="2216" mi="3" ci="0" mb="0" cb="0" />
<line nr="2217" mi="1" ci="0" mb="0" cb="0" />
<line nr="2225" mi="3" ci="0" mb="0" cb="0" />
<line nr="2226" mi="1" ci="0" mb="0" cb="0" />
<line nr="2307" mi="4" ci="0" mb="0" cb="0" />
<line nr="2349" mi="4" ci="0" mb="0" cb="0" />
<line nr="2353" mi="4" ci="0" mb="0" cb="0" />
<line nr="2364" mi="4" ci="0" mb="0" cb="0" />
<line nr="2399" mi="5" ci="0" mb="0" cb="0" />
<line nr="2415" mi="6" ci="0" mb="0" cb="0" />
<line nr="2430" mi="11" ci="0" mb="0" cb="0" />
<line nr="2444" mi="5" ci="0" mb="0" cb="0" />
<line nr="2462" mi="0" ci="5" mb="0" cb="0" />
<line nr="2491" mi="5" ci="0" mb="0" cb="0" />
<line nr="2503" mi="6" ci="0" mb="0" cb="0" />
<line nr="2504" mi="1" ci="0" mb="0" cb="0" />
<line nr="2514" mi="5" ci="0" mb="0" cb="0" />
<line nr="2515" mi="1" ci="0" mb="0" cb="0" />
<line nr="2531" mi="5" ci="0" mb="0" cb="0" />
<line nr="2540" mi="3" ci="0" mb="0" cb="0" />
<line nr="2767" mi="3" ci="0" mb="0" cb="0" />
<line nr="2778" mi="5" ci="0" mb="0" cb="0" />
<line nr="2941" mi="3" ci="0" mb="0" cb="0" />
<line nr="3082" mi="8" ci="0" mb="2" cb="0" />
<line nr="3090" mi="2" ci="0" mb="0" cb="0" />
<line nr="3091" mi="1" ci="0" mb="0" cb="0" />
<counter type="INSTRUCTION" missed="491" covered="13" />
<counter type="BRANCH" missed="28" covered="0" />
<counter type="LINE" missed="122" covered="3" />
<counter type="COMPLEXITY" missed="75" covered="4" />
<counter type="METHOD" missed="61" covered="4" />
<counter type="CLASS" missed="0" covered="1" />
</sourcefile>
</package>
</report> I am not quite sure if this problem has to be solved by Jacoco, ActiveJDBC or even SonarQube? |
here is a simple example of using ActiveJDBC and JaCoCo: https://github.com/javalite/simple-example/tree/jacoco please, see the last two commits. In order to generate the report, you would simply:
because JaCoCo is wired to the test phase. The coverage reports will be generated in ... but coverage is terrible! Let's see why: so, all these methods in Person class are not even defined there! They are moved from the super class during instrumentation! This means that while you can look at the model reports, they are skewed. So, I of adding new feature to JaCoCo to be able to skip certain methods form its reporting to get rid of this issue. All other classes will be covered properly. Thoughts? |
https://www.rainerhahnekamp.com/en/ignoring-lombok-code-in-jacoco/ There seems to be a generic solution now in JaCoCo with the .Generated mechanism: |
@garcimouche this is great, I will look into it! |
I opened a new issue: #887. Once completed, we will be able to run JaCoCo with true reports. We started to work with sonarqube on our current commercial projects, but that work is not complete yet (however, we did not get an exception above). As we gain more info, I will post it here. |
@ipolevoy , could you deploy the latest Java8 snapshot containing PR #998 to https://oss.sonatype.org/content/repositories/snapshots/? @garcimouche could test this snapshot with SonarQube. |
@cschabl this is deployed, please see: https://travis-ci.org/javalite/javalite/jobs/646200614 |
@garcimouche let us know how it goes with the test |
I have tested with snapshot 20200212.172437-19 and it does not work. I am not sure if I specifically have to use 20200207.002448-17 in which case I dont know how to pick this specific timestamp. |
@garcimouche , not sure exactly how you selected that specific version, but here is what works for me: I delete all local installations of JavaLite:
As I run any Maven command after, it should pull the latest snapshot from Sonatype. Also, ensure you are on the https://github.com/javalite/javalite/tree/java8 branch, since the master is for Java 11. |
Sorry it is working fine. I was using jacoco 0.8.0 on my previous attempt. We need to have jacoco version 0.8.3 at minimum. |
@garcimouche this is great! We will just need this to be part of documentation. Can you also check the master branch 3.0-SNAPSHOT on Java 11? |
@garcimouche ping ... |
Igor, i will try to test the master branch when i find some times. Thank you |
Frank, appreciate! |
Tested with master branch java 11 and it is working fine. Thank you. Do you want me to close? |
awesome, closing. You could close too! |
Activejdbc instrumentation does not seems to work very well with JaCoCo. Activejdbc is generating numerous static methods on my Model that I don't necessarily cover with my integration tests. In that case JaCoCo reports methods as not covered (similar problematic with Lombok instrumentation solved like this).
Another instrumentation issue relates to sonarqube. The analysis seems to fail on the coverage report:
Line 167 is out of range in the file model/src/main/java/com/franck/product/ref/ProductDetail.java (lines: 39)
ProductDetail
is an activejdbc Model class. It seems that sonarqube takes the original non enhanced source file along with the jaCoCo report which itself acts on the enhanced binary.The text was updated successfully, but these errors were encountered: