随笔分类 - 单元测试
摘要:一般情况下: @ContextConfiguration(Locations="../applicationContext.xml") 多个文件时,可用{} @ContextConfiguration(locations = { "classpath*:/spring1.xml", "classpa
阅读全文
摘要:阅读目录 > 基本的搭建 > 常见的用法 如果我们需要对我们的Service方法作单元测试,恰好又是用Spring作为IOC容器的,我们可以这么配置Junit加载Spring容器,方便做单元测试。 > 基本的搭建 (1)引入所需的包 (2)写测试类 测试类中要设置加载哪些Spring的配置(我这里是
阅读全文