Ant:找不到我的@ContextConfiguration
我们有一个 Spring 3 MVC 应用程序和用于 spring 控制器的 JUnit 测试用例。 Junit版本是4.8.1,支持ContextConfiguration注释。
以下是我在测试存根中添加上下文配置的方法
@ContextConfiguration(locations = "file:WebContent/WEB-INF/myappconfig.xml")
,我能够在本地运行 junit,但是当我尝试使用 ant 构建脚本运行它时,它会抛出错误 java.lang.IllegalStateException: Failed to load ApplicationContext
我尝试将 classpath 元素设置为 WebContent,然后设置为 web-inf,但没有任何效果。
We have a Spring 3 MVC application and JUnit test cases for spring controllers. The Junit version is 4.8.1 which supports ContextConfiguration annotation.
Here is how I am adding context configuration in my test stub
@ContextConfiguration(locations = "file:WebContent/WEB-INF/myappconfig.xml")
I am able to run the junits locally, but when I am trying to run this with my ant build script, it throws an error java.lang.IllegalStateException: Failed to load ApplicationContext
I tried to set classpath element to the WebContent, then upto web-inf, nothing works out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我正在使用
,我的 application-test.xml 位于 main/resources 下
i'm using
and my application-test.xml resides under main/resources