AbstractTransactionalDataSourceSpringContextTests使用spring集成测试时候可以通过以下方式载入WEB-INF下的配置文件:
Java代码
protected String[] getConfigLocations() { return new String[] { "file:WebRoot/WEB-INF/applicationContext.xml"}; } protected String[] getConfigLocations() { return new String[] { "file:WebRoot/WEB-INF/applicationContext.xml"}; }
其中file:表示相对于项目根目录