Java 坑>&燃气轮机;信息:仆从:下午3:10:40维修站>&燃气轮机;信息:找到0个测试
我正在尝试将PIT测试集成到我的项目中 这是我的pom.xml文件 pom.xmlJava 坑>&燃气轮机;信息:仆从:下午3:10:40维修站>&燃气轮机;信息:找到0个测试,java,maven,mutation-testing,pitest,Java,Maven,Mutation Testing,Pitest,我正在尝试将PIT测试集成到我的项目中 这是我的pom.xml文件 pom.xml <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
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com2.com3.app</groupId>
<artifactId>team-10</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<directory>target</directory>
<testSourceDirectory>test</testSourceDirectory>
<testOutputDirectory>target/classes</testOutputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.4.6</version>
<configuration>
<targetClasses>
<param>com1.com2.com3.impl.app.LsApplication</param>
</targetClasses>
<targetTests>
<param>com1.com2.com3.impl.app.LsApplicationTest</param>
</targetTests>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<myTestSourceDirectory>test</myTestSourceDirectory>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.3</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
</dependency>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>0.7</version>
</dependency>
</dependencies>
</project>
首先,为什么要更改默认值,如源目录等。遵循约定更容易。因此,删除以下内容:
<sourceDirectory>src</sourceDirectory>
<directory>target</directory>
<testSourceDirectory>test</testSourceDirectory>
<testOutputDirectory>target/classes</testOutputDirectory>
以及基于属性的方法:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<myTestSourceDirectory>test</myTestSourceDirectory>
</properties>
这是否意味着您正在使用基于JUnit4的单元测试?如果是这样,您必须添加junit vintage引擎,以便通过junit Jupiter运行基于junit 4的测试。
我强烈建议将所有基于JUnit 4的测试迁移到JUnit Jupiter,然后删除JUnit 4依赖项。首先,为什么要更改默认值,如源目录等。遵循约定会更容易。因此,删除以下内容:
<sourceDirectory>src</sourceDirectory>
<directory>target</directory>
<testSourceDirectory>test</testSourceDirectory>
<testOutputDirectory>target/classes</testOutputDirectory>
以及基于属性的方法:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<myTestSourceDirectory>test</myTestSourceDirectory>
</properties>
这是否意味着您正在使用基于JUnit4的单元测试?如果是这样,您必须添加junit vintage引擎,以便通过junit Jupiter运行基于junit 4的测试。
我强烈建议将所有基于JUnit 4的测试迁移到JUnit Jupiter,然后删除JUnit 4依赖项。我们有非常详细的文档。它包含示例,还链接到我们在GitHub上的集成测试。请在浏览器中打开此链接,如果有不清楚的地方,请随时提问。我们渴望回答这些问题。我们有非常详细的文档。它包含示例,还链接到我们在GitHub上的集成测试。请在浏览器中打开此链接,如果有不清楚的地方,请随时提问。我们很乐意回答这些问题。您好,谢谢您的详细回答。我想你可以告诉我,我对Maven很陌生,我在设置方面有很多问题。为了回答您的一些问题,最初的项目不是Maven结构,不知何故,我的朋友在其中添加了一个pom.xml(使用Junit4),但在我接管之前,它没有配置为默认结构。我一直在谷歌上搜索完全基于我的错误消息的解决方案,我只是不断添加依赖项,只是为了消除错误消息。我认为我读到的帖子没有更新,这就是为什么这些库的版本都很旧的原因。我们实际上是通过IntelliJ的Junit5类路径手动运行应用程序,直到我们必须集成PIT,我们肯定会更喜欢使用使用Junit5和Jdk11的较新和稳定的版本。对于我的情况,你最好的建议是什么?首先改变目录结构并遵循惯例。第二次升级到插件/工具的最新版本。。。并检查普通命令行中的每一步…嗨,谢谢你的详细回答。我想你可以告诉我,我对Maven很陌生,我在设置方面有很多问题。为了回答您的一些问题,最初的项目不是Maven结构,不知何故,我的朋友在其中添加了一个pom.xml(使用Junit4),但在我接管之前,它没有配置为默认结构。我一直在谷歌上搜索完全基于我的错误消息的解决方案,我只是不断添加依赖项,只是为了消除错误消息。我认为我读到的帖子没有更新,这就是为什么这些库的版本都很旧的原因。我们实际上是通过IntelliJ的Junit5类路径手动运行应用程序,直到我们必须集成PIT,我们肯定会更喜欢使用使用Junit5和Jdk11的较新和稳定的版本。对于我的情况,你最好的建议是什么?首先改变目录结构并遵循惯例。第二次升级到插件/工具的最新版本。。。并检查普通命令行上的每个步骤。。。
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>