Package org.apache.felix.ipojo.api

Examples of org.apache.felix.ipojo.api.SingletonComponentType.create()


    public void createAServiceProvider() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
        assertThat(context, is(notNullValue()));
        ComponentInstance ci = null;

        SingletonComponentType type = createAProvider();
        ci = type.create();
        assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(Foo.class
                .getName(), ci.getInstanceName());
        assertThat(ref, is(notNullValue()));
        type.disposeInstance(ci);
View Full Code Here


    @Test
    public void killTheFactory() throws Exception {
        assertThat(context, is(notNullValue()));
        ComponentInstance ci = null;
        SingletonComponentType type = createAProvider();
        ci = type.create();
        assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(Foo.class
                .getName(), ci.getInstanceName());
        assertThat(ref, is(notNullValue()));
        type.stop();
View Full Code Here

    public void createAServiceCons() throws Exception {
        assertThat(context, is(notNullValue()));
        ComponentInstance ci = null;

        SingletonComponentType type = createAConsumer();
        ci = type.create();
        assertThat("Ci is invalid", ci.getState(),
                is(ComponentInstance.INVALID));
        type.stop();
    }
View Full Code Here

    }

    @Test
    public void createBoth() throws Exception {
        SingletonComponentType consFactory = createAConsumer();
        ComponentInstance cons = consFactory.create();
        // cons is invalid
        assertThat("cons is invalid", cons.getState(), is(ComponentInstance.INVALID));

        SingletonComponentType provFactory = createAProvider();
        ComponentInstance prov = provFactory.create();
View Full Code Here

        ComponentInstance cons = consFactory.create();
        // cons is invalid
        assertThat("cons is invalid", cons.getState(), is(ComponentInstance.INVALID));

        SingletonComponentType provFactory = createAProvider();
        ComponentInstance prov = provFactory.create();
        assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
        assertThat("cons is valid", cons.getState(), is(ComponentInstance.VALID));
        consFactory.stop();
        provFactory.stop();
    }
View Full Code Here

    {
        assertThat( context, is( notNullValue() ) );
        ComponentInstance ci = null;

        SingletonComponentType type = createAProvider();
        ci = type.create();
        assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
        ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class
                .getName(), ci.getInstanceName());
        assertThat(ref, is(notNullValue()));
View Full Code Here

    @Test
    public void killTheFactory() throws Exception {
        assertThat( context, is( notNullValue() ) );
        ComponentInstance ci = null;
        SingletonComponentType type = createAProvider();
        ci = type.create();
        assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
        ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class
                .getName(), ci.getInstanceName());
        assertThat(ref, is(notNullValue()));
        type.stop();
View Full Code Here

    public void createAServiceCons() throws Exception {
        assertThat( context, is( notNullValue() ) );
        ComponentInstance ci = null;

        SingletonComponentType type = createAConsumer();
        ci = type.create();
        assertThat("Ci is invalid", ci.getState(),
                is(ComponentInstance.INVALID));

    }
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.