傻傻の  

spring自带的测试注解


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

public class TestUserDaoImpl extends AbstractJUnit4SpringContextTests{

  @Autowired
  UserDao userDao;

  //TODO

}

 

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

posted on 2017-09-12 03:29  傻傻の  阅读(247)  评论(0)    收藏  举报