SharedResourceLoader extends BaseResourceLoader implements IResourceLoader { @Override public Map<String, List<IResource>> loadResources() { Map<String, List<IResource>> map = new HashMap<String, List<IResource>>(); String[] resourceBases = new String[] { "META-INF/resources", "META-INF/tags" }; Set<String> m_resourceTypes = getConfig().getRegistry().getResourceTypes(); List<String> allExts = new ArrayList<String>(); for (String type : m_resourceTypes) { List<String> exts = getConfig().getRegistry().getResourceExtensions(type); allExts.addAll(exts); } List<SharedResource> sharedResources = listSharedResources(resourceBases, allExts); for (SharedResource resource : sharedResources) { Map<String, URL> urls = resource.getFiles(); IResourceLibrary library = resource.getLibrary(); createResources(urls, library, map); } return map; } SharedResourceLoader(IResourceRuntimeConfig config); @Override Map<String, List<IResource>> loadResources();  }
@Test public void testLoadResources() throws IOException { IResourceRuntimeConfig config = ResourceRuntimeContext.ctx().getConfig(); File file = new File("warRoot/WEB-INF/lib/SharedResourceTest-0.0.1-SNAPSHOT.jar!/META-INF/resources"); @SuppressWarnings("deprecation") String urlStr = file.toURL().toString(); URL url = new URL("jar", null, urlStr); config.setAppClassLoader(new MockClassLoader(url)); Assert.assertFalse(config.loadResource("shared", false).isEmpty()); }