码迷,mamicode.com
首页 > 编程语言 > 详细

spring自带测试配置

时间:2017-09-12 09:58:42      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:runner   bst   .class   autowired   contex   test   with   col   rac   

spring自带的测试注解


@ContextConfiguration(locations="classpath:applicationContext.xml")
@RunWith(SpringJUnit4ClassRunner.class)

public class TestUserDaoImpl extends AbstractJUnit4SpringContextTests{

  @Autowired
  UserDao userDao;

  //TODO

}

 

classpath:applicationContext.xml---为你当前配置的.XML文件名

spring自带测试配置

标签:runner   bst   .class   autowired   contex   test   with   col   rac   

原文地址:http://www.cnblogs.com/jeanpwest/p/7508168.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!