junit的使用

junit需要的jar包:


<dependency>

      <groupId>junit</groupId>

      <artifactId>junit</artifactId>

      <version>4.12</version>

      <scope>test</scope>

</dependency>

编写测试用例进行测试的时候,出现如下异常

解决此问题的方法为,添加此 hamcrest-core-1.3包.pox.xml文件中添加:

<dependency>
    <groupId>org.hamcrest</groupId>
    <artifactId>hamcrest-core</artifactId>
    <version>1.3</version>
    <scope>test</scope>    
</dependency>
扫描二维码关注公众号,回复: 1006192 查看本文章

猜你喜欢

转载自my.oschina.net/u/3316877/blog/1476606