Spring整合JUnit4测试,使用注解引入一个或多个配置文件

来源:互联网 发布:开淘宝店后要怎么操作 编辑:程序博客网 时间:2024/05/21 09:47

一般情况下:

[html] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. @ContextConfiguration(Locations="../applicationContext.xml")   

多个文件时,可用{;}

[html] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. @ContextConfiguration(locations = { "classpath*:/spring1.xml", "classpath*:/spring2.xml" })   
1 0