Spring整合Junit

导入坐标


@RunWith:把原有的main方法替换成spring提供的

@ContextConfiguration:告知spring的运行器,是用注解配置类还是xml配置文件

属性:classes:指定注解类所在的位置。              locations:指定xml的文件配置,加上class:path关键字,表示类路径下

你可能感兴趣的:(Spring整合Junit)