Search in sources :

Example 71 with FeaturesService

use of org.apache.karaf.features.FeaturesService in project ddf by codice.

the class ApplicationConfigInstallerTest method testFileNotValid.

/**
     * Tests that when a file is not found, the post install start and post
     * install stop features are NOT called.
     */
@Test
public void testFileNotValid() throws Exception {
    FeaturesService featuresService = mock(FeaturesService.class);
    ApplicationConfigInstaller configInstaller = getApplicationConfigInstaller(BAD_FILE, null, featuresService, START_FEATURE, STOP_FEATURE);
    configInstaller.run();
    // verify the post start and post stop features were not called
    verify(featuresService, never()).installFeature(anyString(), any(EnumSet.class));
    verify(featuresService, never()).uninstallFeature(anyString());
}
Also used : EnumSet(java.util.EnumSet) FeaturesService(org.apache.karaf.features.FeaturesService) Test(org.junit.Test)

Aggregations

FeaturesService (org.apache.karaf.features.FeaturesService)71 Test (org.junit.Test)61 ApplicationService (org.codice.ddf.admin.application.service.ApplicationService)51 HashSet (java.util.HashSet)48 Repository (org.apache.karaf.features.Repository)43 Feature (org.apache.karaf.features.Feature)29 Application (org.codice.ddf.admin.application.service.Application)19 Mockito.anyString (org.mockito.Mockito.anyString)13 Logger (org.slf4j.Logger)12 Appender (ch.qos.logback.core.Appender)10 URI (java.net.URI)10 ArgumentMatcher (org.mockito.ArgumentMatcher)10 ApplicationServiceException (org.codice.ddf.admin.application.service.ApplicationServiceException)9 EnumSet (java.util.EnumSet)6 Bundle (org.osgi.framework.Bundle)6 URL (java.net.URL)5 ArrayList (java.util.ArrayList)4 BundleInfo (org.apache.karaf.features.BundleInfo)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 IOException (java.io.IOException)2