ResourceRegistry implements IResourceRegistry { public ResourceRegistry(IResourceRuntimeConfig config) { m_config = config; } ResourceRegistry(IResourceRuntimeConfig config); @Override IResourceRuntimeConfig getConfig(); @Override IResourceFactory<IResource> getDefaultResourceFactory(); @Override IResourceHandler getDefaultResourceHandler(); @Override IResourceResolver getDefaultResourceResolver(String namespace); @Override IDeferProcessor getDeferProcessor(); @Override IResourceErrorHandler getErrorHandler(); @Override IExpressionEvaluator getExpressionEvaluator(String elType); @Override ILibraryVersionProvider getLibraryVersionProvider(); @Override IResourceResolver getResolver(String type, String namespace); @Override List<String> getResourceExtensions(String resType); @Override IResourceFactory<? extends IResource> getResourceFactory(String type, String extension); @Override IResourceHandler getResourceHandler(String type); @Override IResourceLoader getResourceLoader(String namespace); @Override String getResourceMimeType(String ext); @Override IResourceOptimizer getResourceOptimizer(String type); @Override String getResourceType(String extension); @Override Set<String> getResourceTypes(); @Override IResourceTagRenderer getTagRenderer(String resourceType); @Override ITemplateProcessor getTemplateProcessor(String extName); @Override IResourceTokenStorage getTokenStorage(); @Override void registerExpressionEvaluator(String elType, IExpressionEvaluator evaluator); @Override void registerMimeTypes(String resourceType, String mimeType, List<String> exts); @Override void registerResolver(String type, String namespace, IResourceResolver resolver); @Override void registerResourceFactory(String type, String extension, IResourceFactory<? extends IResource> factory); @Override void registerResourceHandler(String type, IResourceHandler handler); @Override void registerResourceLoader(String namespace, IResourceLoader loader); @Override void registerResourceOptimizer(String type, IResourceOptimizer optimizer); @Override synchronized void registerTagRenderer(String resourceType, IResourceTagRenderer renderer); @Override void registerTemplateProcessor(String extName, ITemplateProcessor processor); @Override void setDefaultResourceFactory(IResourceFactory<IResource> defaultFactory); @Override void setDefaultResourceHandler(IResourceHandler defaultResolverHandler); @Override void setDefaultResourceResolver(String namespace, IResourceResolver resolver); @Override void setDeferProcessor(IDeferProcessor deferProcessor); @Override void setErrorHandler(IResourceErrorHandler handler); @Override void setLibraryVersionProvider(ILibraryVersionProvider provider); @Override void setTokenStorage(IResourceTokenStorage tokenStorage); @Override IExternalResourceResolver getExternalResourceResolver(String type); @Override void registerExternalResourceResolver(String type, IExternalResourceResolver resolver); @Override boolean ignoreWhitespaces();  }
@Test public void testResourceRegistry() { ResourceRuntimeConfig cfg = new ResourceRuntimeConfig("/ResourceRegistryTest", new File("warRoot")); ResourceRegistry registry = new ResourceRegistry(cfg); Assert.assertNull(registry.getDefaultResourceFactory()); Assert.assertNull(registry.getDefaultResourceHandler()); Assert.assertNull(registry.getDefaultResourceResolver("local")); Assert.assertNull(registry.getResourceExtensions("js")); Assert.assertTrue(registry.getResourceTypes().isEmpty()); registry.registerResourceHandler("js", new DefaultResourceHandler()); registry.registerResourceLoader("local", new LocalResourceLoader(cfg)); Assert.assertTrue(registry.getResourceHandler("js") instanceof DefaultResourceHandler); Assert.assertTrue(registry.getResourceLoader("local") instanceof LocalResourceLoader); registry.registerResolver("js", "shared", new SharedResourceResolver()); registry.registerExpressionEvaluator("test", new ResourceELEvaluator()); }