protected static ApplicationContext createFactory(String configFile, boolean contextResourceSupport) {
// 如果!contextResourceSupport,则appcontext返回的resource将被转换成非ContextResource对象,
// 用于测试preloaded resource loader。
if (contextResourceSupport) {
return new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, configFile)));
} else {
return new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, configFile))) {
@Override
public Resource[] getResources(String locationPattern) throws IOException {
Resource[] resources = super.getResources(locationPattern);
if (!isEmptyArray(resources)) {