Package org.apache.felix.bundlerepository

Examples of org.apache.felix.bundlerepository.Resolver.resolve()


        repoAdmin.addRepository(getClass().getResource("/repo_for_optional_resources.xml"));

        Resolver resolver = repoAdmin.resolver();
        resolver.add(repoAdmin.getHelper().requirement("bundle", "(symbolicname=res1)"));

        assertTrue(resolver.resolve());
        assertEquals(1, resolver.getRequiredResources().length);
        assertEquals(2, resolver.getOptionalResources().length);
    }

    public void testMandatoryPackages() throws Exception
View Full Code Here


        RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
        repoAdmin.addRepository(getClass().getResource("/repo_for_mandatory.xml"));

        Resolver resolver = repoAdmin.resolver();
        resolver.add(repoAdmin.getHelper().requirement("bundle", "(symbolicname=res2)"));
        assertFalse(resolver.resolve());

        resolver = repoAdmin.resolver();
        resolver.add(repoAdmin.getHelper().requirement("bundle", "(symbolicname=res3)"));
        assertTrue(resolver.resolve());
View Full Code Here

        resolver.add(repoAdmin.getHelper().requirement("bundle", "(symbolicname=res2)"));
        assertFalse(resolver.resolve());

        resolver = repoAdmin.resolver();
        resolver.add(repoAdmin.getHelper().requirement("bundle", "(symbolicname=res3)"));
        assertTrue(resolver.resolve());

        resolver = repoAdmin.resolver();
        resolver.add(repoAdmin.getHelper().requirement("bundle", "(symbolicname=res4)"));
        assertFalse(resolver.resolve());
View Full Code Here

        resolver.add(repoAdmin.getHelper().requirement("bundle", "(symbolicname=res3)"));
        assertTrue(resolver.resolve());

        resolver = repoAdmin.resolver();
        resolver.add(repoAdmin.getHelper().requirement("bundle", "(symbolicname=res4)"));
        assertFalse(resolver.resolve());

    }

    public static void main(String[] args) throws Exception
    {
View Full Code Here

      /*
       * calculate the transitive dependencies to satisfy requirements of the resource being deployed
       */
      resolver.add(this.resource);
      resolver.resolve();

      /*
       * If we can not resolve the resource requirements, just give up
       */
      if (resolver.getUnsatisfiedRequirements().length > 0) {
View Full Code Here

        Resource[] discoverResources = repoAdmin.discoverResources("(symbolicname=org.apache.felix.test*)");
        assertNotNull(discoverResources);
        assertEquals(1, discoverResources.length);

        resolver.add(discoverResources[0]);
        assertTrue(resolver.resolve());
    }

    public void testPullParser() throws Exception
    {
        URL url = getClass().getResource("/repo_for_resolvertest.xml");
View Full Code Here

        Resource[] discoverResources = repoAdmin.discoverResources("(symbolicname=org.apache.felix.test*)");
        assertNotNull(discoverResources);
        assertEquals(1, discoverResources.length);

        resolver.add(discoverResources[0]);
        assertTrue(resolver.resolve());
    }

    public void testPerfs() throws Exception
    {
        for (int i = 0; i < 10; i++) {
View Full Code Here

        Resource[] discoverResources = repoAdmin.discoverResources("(symbolicname=org.apache.felix.test*)");
        assertNotNull(discoverResources);
        assertEquals(1, discoverResources.length);

        resolver.add(discoverResources[0]);
        assertTrue(resolver.resolve());
    }

    public void testMatchingReq() throws Exception
    {
        RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
View Full Code Here

        RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
        repoAdmin.addRepository(getClass().getResource("/repo_for_resolvertest.xml"));

        Resolver resolver = repoAdmin.resolver();
        resolver.add(repoAdmin.getHelper().requirement("package", "(package=org.apache.felix.test.osgi)"));
        assertTrue(resolver.resolve());
    }

    public void testResolveInterrupt() throws Exception
    {
        RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
View Full Code Here

        resolver.add(repoAdmin.getHelper().requirement("package", "(package=org.apache.felix.test.osgi)"));

        Thread.currentThread().interrupt();
        try
        {
            resolver.resolve();
            fail("An excepiton should have been thrown");
        }
        catch (org.apache.felix.bundlerepository.InterruptedResolutionException e)
        {
            // ok
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.