Package org.apache.felix.ipojo.handlers.dependency

Examples of org.apache.felix.ipojo.handlers.dependency.DependencyDescription


        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
        Assert.assertNotNull(d.getDependencies());
        Assert.assertEquals(1, d.getDependencies().length);

        DependencyDescription dep = d.getDependencies()[0];
        Assert.assertEquals(Dependency.RESOLVED, dep.getState());

        Assert.assertEquals(1, dep.getServiceReferences().size());
        ServiceReference r = dep.getServiceReferences().get(0);
        Assert.assertEquals("provider", r.getProperty("factory.name"));
        Assert.assertEquals("2.0", r.getProperty("factory.version"));
    }
View Full Code Here


        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
        Assert.assertNotNull(d.getDependencies());
        Assert.assertEquals(1, d.getDependencies().length);

        DependencyDescription dep = d.getDependencies()[0];
        Assert.assertEquals(Dependency.RESOLVED, dep.getState());

        Assert.assertEquals(1, dep.getServiceReferences().size());
        ServiceReference r = dep.getServiceReferences().get(0);

        Assert.assertEquals("provider", r.getProperty("factory.name"));
        Assert.assertEquals("1.0", r.getProperty("factory.version"));
    }
View Full Code Here

        assertTrue(instance.getState() == ComponentInstance.VALID);
        DependencyHandlerDescription desc = (DependencyHandlerDescription) instance.getInstanceDescription().getHandlerDescription("org.apache.felix" +
                ".ipojo:requires");

        // Only one dependency.
        DependencyDescription dependency = desc.getDependencies()[0];
        assertEquals("(id=2)", dependency.getFilter());
    }
View Full Code Here

        assertTrue(instance.getState() == ComponentInstance.INVALID);
        DependencyHandlerDescription desc = (DependencyHandlerDescription) instance.getInstanceDescription().getHandlerDescription("org.apache.felix" +
                ".ipojo:requires");

        // Only one dependency.
        DependencyDescription dependency = desc.getDependencies()[0];
        assertEquals("(id=${source.id})", dependency.getFilter());

        registration = context.registerService(ContextSource.class.getName(),
                source, null);

        assertTrue(instance.getState() == ComponentInstance.VALID);
        desc = (DependencyHandlerDescription) instance.getInstanceDescription().getHandlerDescription("org.apache.felix" +
                ".ipojo:requires");

        // Only one dependency.
        dependency = desc.getDependencies()[0];
        assertEquals("(id=2)", dependency.getFilter());
    }
View Full Code Here

        source.set("source.id", null);
        assertTrue(instance.getState() == ComponentInstance.INVALID);

        DependencyHandlerDescription desc = (DependencyHandlerDescription) instance.getInstanceDescription()
                .getHandlerDescription("org.apache.felix.ipojo:requires");
        DependencyDescription dependency = desc.getDependencies()[0];
        assertEquals("(id=${source.id})", dependency.getFilter());

        // Register a new source.
        MyContextSource source2 = new MyContextSource();
        source2.set("source.id", 2);
        registration2 = context.registerService(ContextSource.class.getName(),
View Full Code Here

        Architecture arch = (Architecture) osgiHelper.getRawServiceObject(ref);

        System.out.println(arch.getInstanceDescription().getDescription());

        Assert.assertEquals(ComponentInstance.VALID, arch.getInstanceDescription().getState());
        DependencyDescription dd = getDependency(arch, "org.apache.felix.ipojo.runtime.core.components.inheritance.b.IB");

        Assert.assertTrue(!dd.getServiceReferences().isEmpty());

        ServiceReference dref = (ServiceReference) dd.getServiceReferences().get(0);
        Assert.assertEquals(dref.getBundle().getSymbolicName(), "C");

    }
View Full Code Here

        Architecture arch = (Architecture) osgi.getServiceObject(ref);

        System.out.println(arch.getInstanceDescription().getDescription());

        Assert.assertEquals(ComponentInstance.VALID, arch.getInstanceDescription().getState());
        DependencyDescription dd = getDependency(arch, "org.apache.felix.ipojo.tests.inheritance.b.IB");

        Assert.assertTrue(! dd.getServiceReferences().isEmpty());

        ServiceReference dref = (ServiceReference) dd.getServiceReferences().get(0);
        Assert.assertEquals(dref.getBundle().getSymbolicName(), "C");

    }
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.handlers.dependency.DependencyDescription

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.