0
我使用下面的代碼爲我的春行家應用程序的JUnit測試春天的JUnit文件加載問題
private static BeanFactory servicefactory = null;
private static BookingProcessService bookingProcessService;
@BeforeClass
public static void setUpBeforeClass() throws Exception{
try{
String[] configFiles = {"applicationcontext-Service.xml","applicationcontext-Hibernate.xml","applicationContext-dao.xml"};
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(configFiles);
servicefactory = (BeanFactory) appContext;
bookingProcessService = (BookingProcessService) servicefactory.getBean("bookingProcessService");
}catch (Exception e){
e.printStackTrace();
}
}
雖然使用Maven構建我的項目,我得到一個名爲bookingProcessBusiness一些errors.The豆不創建可能是因爲彈簧配置文件沒有正確加載。
有人可以幫我嗎?