【发布时间】:2011-03-16 05:10:44
【问题描述】:
我的代码有效,但在下面一行的 Junit 模拟测试中失败。
ApplicationContext ctx = new ClassPathXmlApplicationContext("../MyFile.xml");
我该如何解决这个问题?
添加@ContextConfiguration 还是有其他方法?
"ApplicationContext ctx = new ClassPathXmlApplicationContext("../MyFile.xml");"此行在普通方法中不在测试类中
【问题讨论】:
-
“fail”有点不具体——你说的“fail”是什么意思,例如,引发了哪个异常。
标签: java spring junit junit4 spring-test