3
我有一个基于maven的Spring 3.0项目。 Web应用程序的Spring配置文件位于/<proj>/src/main/webapp/WEB-INF/spring/webmvc-config.xml
。如何在Spring JUnit中测试WEB-INF/spring/webmvc-config.xml配置正确
现在我想要有一个JUnit测试来检查上下文是否可以启动。但我没有知道如何以正确的方式在@ContextConfiguration
标记中指定该文件的位置。
我做:
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional()
@ContextConfiguration({
"classpath:META-INF/spring/application-context.xml",
"file:src/main/webapp/WEB-INF/spring/webmvc-config.xml",
})
public class SpringMvcContextTest {
但我敢肯定,我不应该指的是行家src
目录。