Package org.apache.felix.ipojo.api

Examples of org.apache.felix.ipojo.api.PrimitiveComponentType.start()


        // Stop cons
        cons.stop();
        assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));

        // Restart cons
        cons.start();
        assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));

    }

    @Test
View Full Code Here


    @Test
    public void createACompositeWithAnInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
        // Define the component types
        PrimitiveComponentType prov = createAProvider();
        prov.start();
        PrimitiveComponentType cons = createAConsumer();

        ServiceReference[] refs = osgiHelper.getServiceReferences(Factory.class.getName(),
                "(component.providedServiceSpecifications=" + Foo.class.getName() + ")");
        assertThat(refs.length, is(not(0)));
View Full Code Here

    @Test
    public void createACompositeWithAnOptionalInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
        // Define the component types
        PrimitiveComponentType prov = createAProvider();
        prov.start();

        CompositeComponentType type = new CompositeComponentType()
                .setBundleContext(context)
                .setComponentTypeName("comp3")
                .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()).setOptional(true));
View Full Code Here

        // Stop prov
        prov.stop();
        assertThat("ci is valid - 1", ci.getState(), is(ComponentInstance.VALID));

        // Restart prov
        prov.start();
        assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));

    }

    @Test
View Full Code Here

        // Stop prov
        prov.stop();
        assertThat("ci is valid - 1", ci.getState(), is(ComponentInstance.VALID));

        // Restart prov
        prov.start();
        prov.createInstance();
        assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));

    }
View Full Code Here

    @Test
    public void createACompositeWithExportingAService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
        // Define the component types
        PrimitiveComponentType prov = createAProvider();
        prov.start();
        PrimitiveComponentType cons = createAConsumer();
        ComponentInstance c = cons.createInstance();

        CompositeComponentType type = new CompositeComponentType()
                .setBundleContext(context)
View Full Code Here

                .setBundleContext(context)
                .setClassName(PlainHelloImpl.class.getName())
                .setValidateMethod("start")
                .setInvalidateMethod("stop");

        x.start();

        assertThat(x, is(notNullValue()));
        assertThat(x.getFactory().getState(), is(Factory.VALID));

        ci = x.createInstance();
View Full Code Here

       // Stop cons
       cons.stop();
       assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));

       // Restart cons
       cons.start();
       assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));

   }

   @Test
View Full Code Here

   @Test
   public void createACompositeWithAnInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
       // Define the component types
       PrimitiveComponentType prov = createAProvider();
       prov.start();
       PrimitiveComponentType cons = createAConsumer();

       ServiceReference[] refs = osgi.getServiceReferences(Factory.class.getName(),
               "(component.providedServiceSpecifications=" + Foo.class.getName() +")");
       assertThat(refs.length, is(not(0)));
View Full Code Here

   @Test
   public void createACompositeWithAnOptionalInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
       // Define the component types
       PrimitiveComponentType prov = createAProvider();
       prov.start();

       CompositeComponentType type = new CompositeComponentType()
           .setBundleContext(context)
           .setComponentTypeName("comp3")
           .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()).setOptional(true));
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.