I am using the below code in my test class , to load all the spring.xml files in classpath and application-content.xml file.
@Override
protected String[] getConfigLocations() {
return new String[] {
"classpath*:META-INF/spring.xml", "application-context.xml"};
}
Is there a way to print path of all the “spring.xml” files in classpath? I have a number of jar files which have spring.xml in them. However some of these might not be required for running the tests. Is there a way to print them (jar files or path) and also remove the spring.xml files that are not required programattically?
Try this:
It’s a bit underhand, and uses the non-public Spring API, but it should work for limited diagnostic purposes.