Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 4d51faa

Browse files
committed
Added Jacoco plugin to record coverage metrics
1 parent 32bb7a2 commit 4d51faa

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

pom.xml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@
9797
<version.maven.failsafe.plugin>2.19.1</version.maven.failsafe.plugin>
9898
<version.maven.pmd.plugin>3.6</version.maven.pmd.plugin>
9999
<version.maven.checkstyle.plugin>2.17</version.maven.checkstyle.plugin>
100+
<version.maven.gpg.plugin>1.6</version.maven.gpg.plugin>
101+
<version.maven.nexus.staging.plugin> 1.6.7</version.maven.nexus.staging.plugin>
100102

101103
<version.findbugs.maven.plugin>3.0.3</version.findbugs.maven.plugin>
102-
<version.cobertura.maven.plugin>2.7</version.cobertura.maven.plugin>
103104
<version.license.maven.plugin>1.8</version.license.maven.plugin>
104-
<version.maven.gpg.plugin>1.6</version.maven.gpg.plugin>
105-
<version.maven.nexus.staging.plugin> 1.6.7</version.maven.nexus.staging.plugin>
105+
<version.jacoco.maven.plugin>0.7.6.201602180812</version.jacoco.maven.plugin>
106106

107107
</properties>
108108

@@ -287,6 +287,13 @@
287287
<groupId>org.apache.maven.plugins</groupId>
288288
<artifactId>maven-failsafe-plugin</artifactId>
289289
</plugin>
290+
291+
<plugin>
292+
<!-- record coverage metrics -->
293+
<groupId>org.jacoco</groupId>
294+
<artifactId>jacoco-maven-plugin</artifactId>
295+
</plugin>
296+
290297
</plugins>
291298
<pluginManagement>
292299
<plugins>
@@ -519,22 +526,29 @@
519526
<xmlOutput>true</xmlOutput>
520527
</configuration>
521528
</plugin>
529+
522530
<plugin>
523-
<groupId>org.codehaus.mojo</groupId>
524-
<artifactId>cobertura-maven-plugin</artifactId>
525-
<version>${version.cobertura.maven.plugin}</version>
526-
<configuration>
527-
<instrumentation>
528-
<excludes>
529-
<exclude>**/*Test.class</exclude>
530-
</excludes>
531-
</instrumentation>
532-
</configuration>
531+
<groupId>org.jacoco</groupId>
532+
<artifactId>jacoco-maven-plugin</artifactId>
533+
<version>${version.jacoco.maven.plugin}</version>
533534
<executions>
534535
<execution>
535536
<goals>
536-
<goal>clean</goal>
537-
<goal>cobertura</goal>
537+
<goal>prepare-agent</goal>
538+
</goals>
539+
</execution>
540+
<execution>
541+
<id>record-unit-test-coverage</id>
542+
<phase>test</phase>
543+
<goals>
544+
<goal>report</goal>
545+
</goals>
546+
</execution>
547+
<execution>
548+
<id>record-int-test-coverage</id>
549+
<phase>integration-test</phase>
550+
<goals>
551+
<goal>report</goal>
538552
</goals>
539553
</execution>
540554
</executions>

webtester-support-junit4/src/test/java/info/novatec/testit/webtester/junit/utils/ReflectionUtilsTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ public final void testGetAllFieldsOfClassHierarchy() throws Exception {
2121

2222
Set<Field> fields = ReflectionUtils.getAllFieldsOfClassHierarchy(Child.class);
2323

24-
assertThat(fields).hasSize(3);
25-
assertThat(fields).containsOnly(childField, fatherField, grandfatherField);
24+
assertThat(fields).contains(childField, fatherField, grandfatherField);
2625

2726
}
2827

0 commit comments

Comments
 (0)