Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Annotations and Cobertura: how to exclude the generated classes
    primarykey
    data
    text
    <p>We're using Android Annotations, Cobertura, and maven. Cobertura is pulling in the _ classes for unit test coverage. How can we exclude them?</p> <p>I tried adding the following to my pom but it only worked halfway. The classes no longer show in the report but line and branch coverage for that package shows &lt;5% when the coverage for the base classes in that package are at 100%.</p> <pre><code>&lt;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"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.hps.prosper.android&lt;/groupId&gt; &lt;artifactId&gt;TabletCore&lt;/artifactId&gt; &lt;version&gt;0.2.0-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;apk&lt;/packaging&gt; &lt;name&gt;Prosper-TabletCore&lt;/name&gt; &lt;properties&gt; &lt;stomp.version&gt;0.2.0-SNAPSHOT&lt;/stomp.version&gt; &lt;java.version&gt;1.6&lt;/java.version&gt; &lt;/properties&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;junit&lt;/groupId&gt; &lt;artifactId&gt;junit-dep&lt;/artifactId&gt; &lt;version&gt;4.10&lt;/version&gt; &lt;exclusions&gt; &lt;exclusion&gt; &lt;groupId&gt;org.hamcrest&lt;/groupId&gt; &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;/exclusions&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.pivotallabs&lt;/groupId&gt; &lt;artifactId&gt;robolectric&lt;/artifactId&gt; &lt;version&gt;1.2&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.googlecode.androidannotations&lt;/groupId&gt; &lt;artifactId&gt;androidannotations&lt;/artifactId&gt; &lt;version&gt;2.7.1&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.googlecode.androidannotations&lt;/groupId&gt; &lt;artifactId&gt;androidannotations-api&lt;/artifactId&gt; &lt;version&gt;2.7.1&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;build&gt; &lt;finalName&gt;${project.artifactId}&lt;/finalName&gt; &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt; &lt;testSourceDirectory&gt;test&lt;/testSourceDirectory&gt; &lt;resources&gt; &lt;!-- filter manifest and put filtered file in target/filtered-manifest/ --&gt; &lt;resource&gt; &lt;directory&gt;${project.basedir}&lt;/directory&gt; &lt;targetPath&gt;${project.build.directory}&lt;/targetPath&gt; &lt;includes&gt; &lt;include&gt;AndroidManifest.xml&lt;/include&gt; &lt;include&gt;res/**/*&lt;/include&gt; &lt;/includes&gt; &lt;/resource&gt; &lt;/resources&gt; &lt;pluginManagement&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt; &lt;version&gt;2.5.2&lt;/version&gt; &lt;configuration&gt; &lt;instrumentation&gt; &lt;ignores&gt; &lt;ignore&gt;com.hps.prosper.android.tabletcore.library.entity.*&lt;/ignore&gt; &lt;ignore&gt;com.hps.prosper.android.tabletcore&lt;/ignore&gt; &lt;ignore&gt;com.hps.prosper.android.contexts.*&lt;/ignore&gt; &lt;/ignores&gt; &lt;excludes&gt; &lt;exclude&gt;com/hps/prosper/android/tabletcore/library/entity/**/*.class&lt;/exclude&gt; &lt;ignore&gt;com/hps/prosper/android/tabletcore/*.class&lt;/ignore&gt; &lt;/excludes&gt; &lt;/instrumentation&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;goals&gt; &lt;goal&gt;clean&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt; &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt; &lt;version&gt;3.5.0&lt;/version&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt; &lt;version&gt;3.2&lt;/version&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/pluginManagement&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt; &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;run&gt; &lt;debug&gt;true&lt;/debug&gt; &lt;/run&gt; &lt;sdk&gt; &lt;platform&gt;12&lt;/platform&gt; &lt;/sdk&gt; &lt;emulator&gt; &lt;avd&gt;16&lt;/avd&gt; &lt;/emulator&gt; &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt; &lt;version&gt;3.2&lt;/version&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;version&gt;2.5.1&lt;/version&gt; &lt;configuration&gt; &lt;source&gt;1.6&lt;/source&gt; &lt;target&gt;1.6&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/project&gt; </code></pre> <p>I'm generating coverage reports at the command line:</p> <pre><code>mvn clean test -Ucobertura:cobertura </code></pre> <p>We also use Jenkins, but I'm just interested in the local reports for now. Once those are working right I'll test it on our build server and enlist some local gurus if needed.</p> <p>If it's not possible, how can I add the source folder for the _ classes so I can at least click through and see where the holes are?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload