@Test public void testExecute() { Result result = healthCheck.execute(); String resultLog = "ResultLog: [INFO All bundles are considered active]"; assertEquals("Result [status=" + Result.Status.OK + ", resultLog=" + resultLog + "]", result.toString()); assertEquals("Status should be OK", Result.Status.OK, result.getStatus()); assertEquals("Result should be ok", true, result.isOk()); }
@Override public Result execute() { FormattingResultLog resultLog = new FormattingResultLog(); int inactiveBundles = 0; Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { if ((!isActiveBundle(bundle)) && !isIgnoredBundle(bundle)) { inactiveBundles++; resultLog.warn("Bundle {} is not active. It is in state {}.", bundle.getSymbolicName(), bundle.getState()); } } if (ignoredBundles != null) { resultLog.debug("The following bundles will be ignored: {}", Arrays.toString(ignoredBundles)); } if (inactiveBundles > 0) { resultLog.warn("There are {} inactive Bundles", inactiveBundles); } else { resultLog.info("All bundles are considered active"); } return new Result(resultLog); }
ActiveBundleHealthCheck implements HealthCheck { @Override public Result execute() { FormattingResultLog resultLog = new FormattingResultLog(); int inactiveBundles = 0; Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { if ((!isActiveBundle(bundle)) && !isIgnoredBundle(bundle)) { inactiveBundles++; resultLog.warn("Bundle {} is not active. It is in state {}.", bundle.getSymbolicName(), bundle.getState()); } } if (ignoredBundles != null) { resultLog.debug("The following bundles will be ignored: {}", Arrays.toString(ignoredBundles)); } if (inactiveBundles > 0) { resultLog.warn("There are {} inactive Bundles", inactiveBundles); } else { resultLog.info("All bundles are considered active"); } return new Result(resultLog); } }
ActiveBundleHealthCheck implements HealthCheck { @Override public Result execute() { FormattingResultLog resultLog = new FormattingResultLog(); int inactiveBundles = 0; Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { if ((!isActiveBundle(bundle)) && !isIgnoredBundle(bundle)) { inactiveBundles++; resultLog.warn("Bundle {} is not active. It is in state {}.", bundle.getSymbolicName(), bundle.getState()); } } if (ignoredBundles != null) { resultLog.debug("The following bundles will be ignored: {}", Arrays.toString(ignoredBundles)); } if (inactiveBundles > 0) { resultLog.warn("There are {} inactive Bundles", inactiveBundles); } else { resultLog.info("All bundles are considered active"); } return new Result(resultLog); }  }
ActiveBundleHealthCheck implements HealthCheck { @Override public Result execute() { FormattingResultLog resultLog = new FormattingResultLog(); int inactiveBundles = 0; Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { if ((!isActiveBundle(bundle)) && !isIgnoredBundle(bundle)) { inactiveBundles++; resultLog.warn("Bundle {} is not active. It is in state {}.", bundle.getSymbolicName(), bundle.getState()); } } if (ignoredBundles != null) { resultLog.debug("The following bundles will be ignored: {}", Arrays.toString(ignoredBundles)); } if (inactiveBundles > 0) { resultLog.warn("There are {} inactive Bundles", inactiveBundles); } else { resultLog.info("All bundles are considered active"); } return new Result(resultLog); }  @Override Result execute(); }
ActiveBundleHealthCheck implements HealthCheck { @Override public Result execute() { FormattingResultLog resultLog = new FormattingResultLog(); int inactiveBundles = 0; Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { if ((!isActiveBundle(bundle)) && !isIgnoredBundle(bundle)) { inactiveBundles++; resultLog.warn("Bundle {} is not active. It is in state {}.", bundle.getSymbolicName(), bundle.getState()); } } if (ignoredBundles != null) { resultLog.debug("The following bundles will be ignored: {}", Arrays.toString(ignoredBundles)); } if (inactiveBundles > 0) { resultLog.warn("There are {} inactive Bundles", inactiveBundles); } else { resultLog.info("All bundles are considered active"); } return new Result(resultLog); }  @Override Result execute();  }