Spring整合JUnit4測試,使用註解引入一個或多個配置文件

一般情況下:

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

多個文件時,可用{;}

[html] view plain copy
 在CODE上查看代碼片派生到我的代碼片
  1. @ContextConfiguration(locations = { "classpath*:/spring1.xml", "classpath*:/spring2.xml" })   
發佈了54 篇原創文章 · 獲贊 40 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章