@Test public void testGetAvailableMeasurementHandlersWithException() throws ComponentLookupException { ComponentManager cm = this.mocker.getInstance(ComponentManager.class, "context"); when(cm.getInstanceList(MeasurementHandler.class)).thenThrow(new ComponentLookupException("")); List<MeasurementHandler> response = this.mocker.getComponentUnderTest().getAvailableMeasurementHandlers(); Assert.assertNotNull(response); Assert.assertTrue(response.isEmpty()); }
public List<MeasurementHandler> getAvailableMeasurementHandlers() { try { List<MeasurementHandler> result = this.componentManager.get().getInstanceList(MeasurementHandler.class); if (result == null) { result = Collections.emptyList(); } Collections.sort(result, MeasurementSorter.instance); return result; } catch (ComponentLookupException ex) { this.logger.warn("Failed to list available measurements", ex); return Collections.emptyList(); } }
MeasurementsScriptService implements ScriptService { public List<MeasurementHandler> getAvailableMeasurementHandlers() { try { List<MeasurementHandler> result = this.componentManager.get().getInstanceList(MeasurementHandler.class); if (result == null) { result = Collections.emptyList(); } Collections.sort(result, MeasurementSorter.instance); return result; } catch (ComponentLookupException ex) { this.logger.warn("Failed to list available measurements", ex); return Collections.emptyList(); } } }
MeasurementsScriptService implements ScriptService { public List<MeasurementHandler> getAvailableMeasurementHandlers() { try { List<MeasurementHandler> result = this.componentManager.get().getInstanceList(MeasurementHandler.class); if (result == null) { result = Collections.emptyList(); } Collections.sort(result, MeasurementSorter.instance); return result; } catch (ComponentLookupException ex) { this.logger.warn("Failed to list available measurements", ex); return Collections.emptyList(); } }  }
MeasurementsScriptService implements ScriptService { public List<MeasurementHandler> getAvailableMeasurementHandlers() { try { List<MeasurementHandler> result = this.componentManager.get().getInstanceList(MeasurementHandler.class); if (result == null) { result = Collections.emptyList(); } Collections.sort(result, MeasurementSorter.instance); return result; } catch (ComponentLookupException ex) { this.logger.warn("Failed to list available measurements", ex); return Collections.emptyList(); } }  MeasurementHandler get(String measurementType); List<MeasurementHandler> getAvailableMeasurementHandlers(); Set<String> getAvailableMeasurementNames(); String getFuzzyValue(int percentile); String getFuzzyValue(double deviation); }
MeasurementsScriptService implements ScriptService { public List<MeasurementHandler> getAvailableMeasurementHandlers() { try { List<MeasurementHandler> result = this.componentManager.get().getInstanceList(MeasurementHandler.class); if (result == null) { result = Collections.emptyList(); } Collections.sort(result, MeasurementSorter.instance); return result; } catch (ComponentLookupException ex) { this.logger.warn("Failed to list available measurements", ex); return Collections.emptyList(); } }  MeasurementHandler get(String measurementType); List<MeasurementHandler> getAvailableMeasurementHandlers(); Set<String> getAvailableMeasurementNames(); String getFuzzyValue(int percentile); String getFuzzyValue(double deviation);  }