Maven项目使用Junit
1、创建一个Maven项目
2、进入:http://www.mvnrepository.com/artifact/junit/junit/4.12
拷贝:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
3、放进Maven项目里的pom.xml文件里去:
<dependencies>
</span><dependency>
</span><groupId>junit</groupId>
</span><artifactId>junit</artifactId>
</span><version>4.12</version>
</span></dependency>
</dependencies>
4、创建一个Junit测试类:
5、右键Run As JUnit Test:
本文详细介绍了如何在Maven项目中引入JUnit测试框架,并创建测试类进行单元测试的方法。
434

被折叠的 条评论
为什么被折叠?



