@Test public void shouldReturnEmptyStatusIfManagerUnavailable() { PlatformStatus status = platformStatusProxy.getCurrentStatus(); assertNotNull(status); assertNotNull(status.getStartedBundles()); assertTrue(status.getStartedBundles().isEmpty()); assertNotNull(status.getBundleErrorsByBundle()); assertTrue(status.getBundleErrorsByBundle().isEmpty()); assertNotNull(status.getContextErrorsByBundle()); assertTrue(status.getContextErrorsByBundle().isEmpty()); }
public PlatformStatus getCurrentStatus() { Object mgr = getStatusManager(); if (mgr == null) { LOGGER.debug("Status manager unavailable"); return new PlatformStatus(); } else { try { Object status = MethodUtils.invokeExactMethod(mgr, "getCurrentStatus", new Object[0]); return convertStatusBetweenClassLoaders(status); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new StatusProxyException("Unable to retrieve status from the manager instance", e); } } }
PlatformStatusProxy { public PlatformStatus getCurrentStatus() { Object mgr = getStatusManager(); if (mgr == null) { LOGGER.debug("Status manager unavailable"); return new PlatformStatus(); } else { try { Object status = MethodUtils.invokeExactMethod(mgr, "getCurrentStatus", new Object[0]); return convertStatusBetweenClassLoaders(status); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new StatusProxyException("Unable to retrieve status from the manager instance", e); } } } }
PlatformStatusProxy { public PlatformStatus getCurrentStatus() { Object mgr = getStatusManager(); if (mgr == null) { LOGGER.debug("Status manager unavailable"); return new PlatformStatus(); } else { try { Object status = MethodUtils.invokeExactMethod(mgr, "getCurrentStatus", new Object[0]); return convertStatusBetweenClassLoaders(status); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new StatusProxyException("Unable to retrieve status from the manager instance", e); } } } PlatformStatusProxy(BundleContext bundleContext); }
PlatformStatusProxy { public PlatformStatus getCurrentStatus() { Object mgr = getStatusManager(); if (mgr == null) { LOGGER.debug("Status manager unavailable"); return new PlatformStatus(); } else { try { Object status = MethodUtils.invokeExactMethod(mgr, "getCurrentStatus", new Object[0]); return convertStatusBetweenClassLoaders(status); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new StatusProxyException("Unable to retrieve status from the manager instance", e); } } } PlatformStatusProxy(BundleContext bundleContext); PlatformStatus getCurrentStatus(); }
PlatformStatusProxy { public PlatformStatus getCurrentStatus() { Object mgr = getStatusManager(); if (mgr == null) { LOGGER.debug("Status manager unavailable"); return new PlatformStatus(); } else { try { Object status = MethodUtils.invokeExactMethod(mgr, "getCurrentStatus", new Object[0]); return convertStatusBetweenClassLoaders(status); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new StatusProxyException("Unable to retrieve status from the manager instance", e); } } } PlatformStatusProxy(BundleContext bundleContext); PlatformStatus getCurrentStatus();  }