I have a maven based Spring 3.0 project. The Spring configuration file for the web application is located at /<proj>/src/main/webapp/WEB-INF/spring/webmvc-config.xml.
Now I want to have a JUnit test that checks if the context can be started. But I did not knwo how to specify the location of that file in the @ContextConfiguration tag in a maven correct way.
I am doing:
@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 {
But I am pretty sure that I should not refer to the maven src directory.
If you are on
mavenwhy don’t you chooseresourcedirectory for this, and useclasspah:file.xml