我对Maven和pitest的配置有疑问。

Pitest一代的突变还可以,但他看不到我的测验..

如果您有任何解决方案:D



我有这样的主要来源/src/main/java/com.plugin ..... .java

我有像/src/test/java/com.plugin .... .java的测试源



pom.xml配置:

<plugin>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-maven</artifactId>
            <version>1.1.9</version>
            <configuration>
                <targetClasses>
                    <param>com.plugin.business.centre*</param>
                </targetClasses>
                <targetTests>
                    <param> com.plugin.business.centre*</param>
                </targetTests>
            </configuration>
    </plugin>


在 ..中,他只知道带有自动完成功能的源类,而不知道我的测试类。



[INFO] --- pitest-maven:1.1.9:mutationCoverage (default-cli) @ Polux ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Default limit mutations plugin
[INFO] Found shared classpath plugin : Default mutation engine
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from /Users/Mods/Documents/*****/target/classes
08:35:36 PIT >> INFO : Verbose logging is disabled. If you encounter an problem please enable it before reporting an issue.
08:35:36 PIT >> INFO : MINION : objc[677]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be us
08:35:36 PIT >> INFO : MINION : ed. Which one is undefined.

08:35:37 PIT >> INFO : Sending 0 test classes to minion
08:35:37 PIT >> INFO : Sent tests to minion
08:35:37 PIT >> INFO : MINION : 08:35:37 PIT >> INFO : Checking environment

08:35:37 PIT >> INFO : MINION : 08:35:37 PIT >> INFO : Found  0 tests

08:35:37 PIT >> INFO : MINION : 08:35:37 PIT >> INFO : Dependency analysis reduced number of potential tests by 0

08:35:37 PIT >> INFO : MINION : 08:35:37 PIT >> INFO : 0 tests received

08:35:37 PIT >> INFO : Calculated coverage in 0 seconds.
08:35:37 PIT >> INFO : Created  20 mutation test units

最佳答案

对于遇到相同问题的人:

我遇到了同样的问题,并通过在Pitest之前运行mvn test修复了该问题。

Pitest某种程度上需要至少执行一次这些测试才能找到它们。

10-07 19:43