Czy ktoś był w stanie uzyskać test jednostkowy testów JMockit i Powermock pracujących w JaCoCo z Maven?Pokrycie testowe dla testów jednostkowych Powermock i JMockit
Mam istniejący zestaw testowy testów jednostkowych Powermock, który chciałbym stopniowo migrować do JMockit. Ale muszę mieć możliwość obejrzenia testów wszystkich testów jednostkowych w jednym raporcie, najlepiej w sonarze.
ja dostawałem JMockit i Powermock Testy działa razem z Surefire/JaCoCo umieszczając JaCoCo w trybie „offline” (inaczej miałem problem, gdy jeden z agentów nie była zakończona pod koniec testów, a następnie mvn wyczyść nie można usunąć wygenerowanego celu \ surefire \ surefirebooter2967126910681005991.jar przy następnym uruchomieniu). Ale nie wygenerowano pokrycia dla testów JMockit.
Proszę napisać kilka fragmentów swojej pom, jeśli to działa.
To właśnie mój pom wygląda (nota wtyczki murowany jest congigured z reuseForks = false obejścia wyciek pamięci PermGen w Powermock, jest to jeden z głównych powodów do migracji do JMockit)
<profile>
<!-- use this profile to perform Sonar analysis -->
<id>sonar</id>
<properties>
<sonar.language>java</sonar.language>
<!-- Tells Sonar to use the generated test coverage report -->
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<!-- Tells Sonar to use JaCoCo as the code coverage tool -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.java.codeCoveragePlugin>jacoco</sonar.java.codeCoveragePlugin>
</properties>
<build>
<plugins>
<!-- surefire (junit) plugin config with JaCoCo listener -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<!-- note: use single JVM to append to JaCoCo coverage file -->
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<argLine>-XX:MaxPermSize=256m </argLine>
<systemPropertyVariables>
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>
</configuration>
</plugin>
<!-- JaCoCo (Sonar) plugin config-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.3.201306030806</version>
<executions>
<execution>
<id>instrument</id>
<phase>process-classes</phase>
<goals>
<goal>instrument</goal>
</goals>
</execution>
<execution>
<id>restore</id>
<phase>site</phase>
<goals>
<goal>restore-instrumented-classes</goal>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
<configuration>
<append>true</append>
</configuration>
</plugin>
</plugins>
</build>
</profile>