@Test public void verifyExtensionsAreSortedAlphabeticallyById() throws Exception { UIExtension uix3 = mock(UIExtension.class, "uix3"); when(uix3.getId()).thenReturn("id3"); when(uix3.getExtensionPointId()).thenReturn("epId"); epExtensions.add(uix3); UIExtension uix1 = mock(UIExtension.class, "uix1"); when(uix1.getId()).thenReturn("id1"); when(uix1.getExtensionPointId()).thenReturn("epId"); epExtensions.add(uix1); UIExtension uix2 = mock(UIExtension.class, "uix2"); when(uix2.getId()).thenReturn("id2"); when(uix2.getExtensionPointId()).thenReturn("epId"); epExtensions.add(uix2); when(contextComponentManager.getInstance(UIExtensionManager.class, "epId")) .thenThrow(new ComponentLookupException("No specific manager for extension point epId")); when(uiExtensionManager.get("epId")).thenReturn(epExtensions); when(contextComponentManager.getInstance(UIExtensionFilter.class, "sortById")).thenReturn(new SortByIdFilter()); HashMap<String, String> filters = new HashMap<String, String>(); filters.put("sortById", ""); UIExtensionScriptService service = (UIExtensionScriptService) componentManager.getComponentUnderTest(); List<UIExtension> extensions = service.getExtensions("epId", filters); Assert.assertEquals("id1", extensions.get(0).getId()); Assert.assertEquals("id2", extensions.get(1).getId()); Assert.assertEquals("id3", extensions.get(2).getId()); }
public List<UIExtension> getExtensions(String extensionPointId) { UIExtensionManager manager = this.uiExtensionManager; ComponentManager componentManager = contextComponentManagerProvider.get(); if (componentManager.hasComponent(UIExtensionManager.class, extensionPointId)) { try { manager = componentManager.getInstance(UIExtensionManager.class, extensionPointId); } catch (ComponentLookupException e) { this.logger.error("Failed to initialize UI extension manager", e); } } return manager.get(extensionPointId); }
UIExtensionScriptService implements ScriptService { public List<UIExtension> getExtensions(String extensionPointId) { UIExtensionManager manager = this.uiExtensionManager; ComponentManager componentManager = contextComponentManagerProvider.get(); if (componentManager.hasComponent(UIExtensionManager.class, extensionPointId)) { try { manager = componentManager.getInstance(UIExtensionManager.class, extensionPointId); } catch (ComponentLookupException e) { this.logger.error("Failed to initialize UI extension manager", e); } } return manager.get(extensionPointId); } }
UIExtensionScriptService implements ScriptService { public List<UIExtension> getExtensions(String extensionPointId) { UIExtensionManager manager = this.uiExtensionManager; ComponentManager componentManager = contextComponentManagerProvider.get(); if (componentManager.hasComponent(UIExtensionManager.class, extensionPointId)) { try { manager = componentManager.getInstance(UIExtensionManager.class, extensionPointId); } catch (ComponentLookupException e) { this.logger.error("Failed to initialize UI extension manager", e); } } return manager.get(extensionPointId); }  }
UIExtensionScriptService implements ScriptService { public List<UIExtension> getExtensions(String extensionPointId) { UIExtensionManager manager = this.uiExtensionManager; ComponentManager componentManager = contextComponentManagerProvider.get(); if (componentManager.hasComponent(UIExtensionManager.class, extensionPointId)) { try { manager = componentManager.getInstance(UIExtensionManager.class, extensionPointId); } catch (ComponentLookupException e) { this.logger.error("Failed to initialize UI extension manager", e); } } return manager.get(extensionPointId); }  List<UIExtension> getExtensions(String extensionPointId); List<UIExtension> getExtensions(String extensionPointId, Map<String, String> filters); }
UIExtensionScriptService implements ScriptService { public List<UIExtension> getExtensions(String extensionPointId) { UIExtensionManager manager = this.uiExtensionManager; ComponentManager componentManager = contextComponentManagerProvider.get(); if (componentManager.hasComponent(UIExtensionManager.class, extensionPointId)) { try { manager = componentManager.getInstance(UIExtensionManager.class, extensionPointId); } catch (ComponentLookupException e) { this.logger.error("Failed to initialize UI extension manager", e); } } return manager.get(extensionPointId); }  List<UIExtension> getExtensions(String extensionPointId); List<UIExtension> getExtensions(String extensionPointId, Map<String, String> filters);  }