版权声明:转载请注明出处 https://blog.csdn.net/pangel18/article/details/83618111
maven项目内配置evosuite插件来自动生成test suite
参考
1 安装IDEA插件
IDEA插件
插件提供了图形界面,如果不使用插件用命令行也可以。
2.1 添加evosuite插件
<plugin>
<groupId>org.evosuite.plugins</groupId>
<artifactId>evosuite-maven-plugin</artifactId>
<version>1.0.6</version>
</plugin>
2.2 添加evosuite库
<pluginRepositories>
<pluginRepository>
<id>EvoSuite</id>
<name>EvoSuite Repository</name>
<url>http://www.evosuite.org/m2</url>
</pluginRepository>
</pluginRepositories>
运行mvn evosuite:help会自动下载evosuite插件,并检测是否配置成功,若成功会显示BUILE SUCCESS
3 生成test suite
使用第1步安装的插件或者命令行生成test suite。
mvn -DmemorylnMB=2000 -Dcores=2 evosuite:generate evosuite:export test
4 添加依赖
<dependency>
<groupId>org.evosuite</groupId>
<artifactId>evosuite-standalone-runtime</artifactId>
<version>1.0.6</version>
<scope>test</scope>
</dependency>
5 运行test suite
mvn test