Package org.apache.felix.ipojo.runtime.core.services

Examples of org.apache.felix.ipojo.runtime.core.services.Toto


        assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
        refToto = ipojoHelper.getServiceReferenceByName(Toto.class.getName(), "ff");
        refTata = ipojoHelper.getServiceReferenceByName(Tata.class.getName(), "ff");
        assertNotNull("Assert toto service - 3", refToto);
        assertNotNull("Assert tata service - 3", refTata);
        Toto toto = (Toto) getContext().getService(refToto);
        Tata tata = (Tata) getContext().getService(refTata);

        invokeAll(tata);
        invokeToto(toto);

        // Check toto
        Properties props = toto.getProps();
        Integer toto_0 = (Integer) props.get("toto");
        Integer toto_2 = (Integer) props.get("toto_2");
        Integer toto_3 = (Integer) props.get("toto_3");
        Integer toto_4 = (Integer) props.get("toto_4");
        Integer toto_1 = (Integer) props.get("toto1");
        assertEquals("Assert toto - 3 (" + toto_0.intValue() + ")", toto_0.intValue(), 1);
        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
        assertEquals("Assert toto1 - 3 (" + toto_1.intValue() + ")", toto_1.intValue(), 1);
        //Check tata
        props = tata.getPropsTata();
        Integer tata_0 = (Integer) props.get("tata");
        assertEquals("Assert tata - 3", tata_0.intValue(), 1);

        getContext().ungetService(refToto);
        getContext().ungetService(refTata);
        toto = null;
        tata = null;

        // Start a second import
        totoProv2.start();
        assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
        refToto = ipojoHelper.getServiceReferenceByName(Toto.class.getName(), "ff");
        refTata = ipojoHelper.getServiceReferenceByName(Tata.class.getName(), "ff");
        assertNotNull("Assert toto service - 4", refToto);
        assertNotNull("Assert tata service - 4", refTata);

        toto = (Toto) getContext().getService(refToto);
        tata = (Tata) getContext().getService(refTata);
        invokeAll(tata);
        invokeToto(toto);

        // Check toto
        props = toto.getProps();
        toto_0 = (Integer) props.get("toto");
        toto_2 = (Integer) props.get("toto_2");
        toto_3 = (Integer) props.get("toto_3");
        toto_4 = (Integer) props.get("toto_4");
        toto_1 = (Integer) props.get("toto1");
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.runtime.core.services.Toto

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.