Package org.apache.felix.karaf.features.internal

Examples of org.apache.felix.karaf.features.internal.RepositoryImpl



public class RepositoryTest extends TestCase {

    public void testLoad() throws Exception {
        RepositoryImpl r = new RepositoryImpl(getClass().getResource("repo1.xml").toURI());
        // Check repo
        URI[] repos = r.getRepositories();
        assertNotNull(repos);
        assertEquals(1, repos.length);
        assertEquals(URI.create("urn:r1"), repos[0]);
        // Check features
        Feature[] features = r.getFeatures();
        assertNotNull(features);
        assertEquals(2, features.length);
        assertNotNull(features[0]);
        assertEquals("f1", features[0].getName());
        assertNotNull(features[0].getConfigurations());
View Full Code Here


        assertEquals("b3", features[1].getBundles().get(0));
    }
   
    public void testShowWrongUriInException() throws Exception {
        String uri = "src/test/resources/org/apache/felix/karaf/shell/features/repo1.xml";
        RepositoryImpl r = new RepositoryImpl(new URI(uri));
        try {
            r.load();
        } catch (Exception e) {
            assertTrue(e.getMessage().contains(uri));
        }
    }
View Full Code Here

     * The Mojo's main method
     */
    public void execute() throws MojoExecutionException, MojoFailureException {
        try {
            prepare();
            Repository repository = new RepositoryImpl(file.toURI());
            analyze(repository);
            validate(repository);
        } catch (Exception e) {
            e.printStackTrace();
            throw new MojoExecutionException(String.format("Unable to validate %s: %s", file.getAbsolutePath(), e.getMessage()), e);
View Full Code Here

        features.add(repository.getFeatures());
       
        // add the repositories from the plugin configuration
  for (String uri : repositories) {
      getLog().info(String.format(" - adding repository from %s", uri));
            Repository dependency = new RepositoryImpl(URI.create(translateFromMaven(uri)));
            features.add(dependency.getFeatures());
            validateBundlesAvailable(dependency);
            analyzeExports(dependency);
        }

        for (URI uri : repository.getRepositories()) {
            Artifact artifact = resolve(uri.toString());
            Repository dependency  = new RepositoryImpl(new File(localRepo.getBasedir(), localRepo.pathOf(artifact)).toURI());
            getLog().info(String.format(" - adding %d known features from %s", dependency.getFeatures().length, uri));
            features.add(dependency.getFeatures());
            // we need to do this to get all the information ready for further processing
            validateBundlesAvailable(dependency);
            analyzeExports(dependency);
        }
View Full Code Here

TOP

Related Classes of org.apache.felix.karaf.features.internal.RepositoryImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.