public void stopFeature(boolean wait, String... featureNames) throws Exception { for (String featureName : featureNames) { getFeaturesService().uninstallFeature(featureName, EnumSet.of(NoAutoRefreshBundles)); } if (wait) { waitForAllBundles(); } }
public void startFeature(boolean wait, String... featureNames) throws Exception { for (String featureName : featureNames) { FeatureState state = getFeaturesService().getState(featureName); if (FeatureState.Installed != state) { getFeaturesService().installFeature(featureName, EnumSet.of(NoAutoRefreshBundles)); } } if (wait) { waitForAllBundles(); } }
public void waitForRequiredApps(String... appNames) throws InterruptedException { ApplicationService appService = getApplicationService(); if (appNames.length > 0) { for (String appName : appNames) { try { Application app = appService.getApplication(appName); if (app != null) { ApplicationStatus status = appService.getApplicationStatus(app); if (ACTIVE != status.getState()) { appService.startApplication(appName); } } else { throw new ApplicationServiceException( "Unable to determine Application for [" + appName + "]."); } } catch (ApplicationServiceException e) { fail("Failed to start boot feature: " + e.getMessage()); } waitForAllBundles(); } } }