Search in sources :

Example 26 with RepositoryImpl

use of org.apache.karaf.features.internal.service.RepositoryImpl in project ddf by codice.

the class ApplicationImplTest method testGetURI.

/**
     * Tests the {@link ApplicationImpl#getURI()} method
     *
     * @throws Exception
     */
@Test
public void testGetURI() throws Exception {
    URI testURI = getClass().getClassLoader().getResource(FILE_MAIN_FEATURE).toURI();
    RepositoryImpl repo1 = new RepositoryImpl(testURI);
    repo1.load();
    Application testApp1 = new ApplicationImpl(repo1);
    assertEquals(testURI, testApp1.getURI());
}
Also used : RepositoryImpl(org.apache.karaf.features.internal.service.RepositoryImpl) URI(java.net.URI) Application(org.codice.ddf.admin.application.service.Application) Test(org.junit.Test)

Example 27 with RepositoryImpl

use of org.apache.karaf.features.internal.service.RepositoryImpl in project ddf by codice.

the class ApplicationNodeImplTest method testHashCode.

/**
     * Tests the {@link ApplicationNodeImpl#hashCode()} method
     */
@Test
public void testHashCode() {
    try {
        Repository testRepo = new RepositoryImpl(ApplicationNodeImpl.class.getClassLoader().getResource(FEATURES_FILE_NAME).toURI());
        Application testApp = new ApplicationImpl(testRepo);
        ApplicationNode testNode = new ApplicationNodeImpl(testApp);
        assertEquals(testApp.hashCode(), testNode.hashCode());
    } catch (Exception e) {
        LOGGER.info("Exception: ", e);
        fail();
    }
}
Also used : Repository(org.apache.karaf.features.Repository) RepositoryImpl(org.apache.karaf.features.internal.service.RepositoryImpl) ApplicationNode(org.codice.ddf.admin.application.service.ApplicationNode) Application(org.codice.ddf.admin.application.service.Application) Test(org.junit.Test)

Aggregations

RepositoryImpl (org.apache.karaf.features.internal.service.RepositoryImpl)27 Test (org.junit.Test)18 HashMap (java.util.HashMap)12 Set (java.util.Set)12 TestDownloadManager (org.apache.karaf.features.internal.support.TestDownloadManager)12 MapUtils.addToMapSet (org.apache.karaf.features.internal.util.MapUtils.addToMapSet)12 Application (org.codice.ddf.admin.application.service.Application)7 URI (java.net.URI)5 Feature (org.apache.karaf.features.Feature)2 ArrayList (java.util.ArrayList)1 Hashtable (java.util.Hashtable)1 Properties (java.util.Properties)1 Repository (org.apache.karaf.features.Repository)1 FeatureResource (org.apache.karaf.features.internal.resolver.FeatureResource)1 FeatureConfigInstaller (org.apache.karaf.features.internal.service.FeatureConfigInstaller)1 ApplicationNode (org.codice.ddf.admin.application.service.ApplicationNode)1 Resource (org.osgi.resource.Resource)1 Configuration (org.osgi.service.cm.Configuration)1 ConfigurationAdmin (org.osgi.service.cm.ConfigurationAdmin)1