首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

Maven项目使用hamcrest失误

2013-11-29 
Maven项目使用hamcrest出错在使用Maven项目进行测试中,因为要引入Hamcrest的一些东西,所以需要使用如下imp

Maven项目使用hamcrest出错
在使用Maven项目进行测试中,
因为要引入Hamcrest的一些东西,所以需要使用如下import 代码:

import static org.hamcrest.Matchers.*

pom已经引入了 junit 4.11
但是这个引入就是报错,后来走官网才发现,还需要引入 hamcrest-library
<dependency><groupId>org.hamcrest</groupId><artifactId>hamcrest-library</artifactId><version>${hamcrest.version}</version><scope>test</scope></dependency>

引入后,使用就没有问题了。
assertThat( mapVar1, is(mapVar2)); 

热点排行