Package org.apache.felix.ipojo.junit4osgi.helpers

Examples of org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper.createComponentInstance()


public class DuplicateMethod extends OSGiTestCase {
   
   
    public void testDuplicateMethod() {
        IPOJOHelper helper = new IPOJOHelper(this);
        helper.createComponentInstance("plopimpl", "plop");
        ServiceReference ref = helper.getServiceReferenceByName(Plop.class.getName(), "plop");
        assertNotNull("Check plop", ref);
        Plop plop = (Plop) getServiceObject(ref);
        Object o = plop.getPlop();
        assertEquals("Check result", "plop", o);
View Full Code Here


        conf.put(Constants.SERVICE_DESCRIPTION, "description");
        conf.put(Constants.SERVICE_RANKING, "10");
        conf.put(Constants.SERVICE_VENDOR, "ASF");
        conf.put(Constants.SERVICE_PID, "my.pid");
       
        helper.createComponentInstance(factName, compName, conf);
       
        // Get a FooService provider
        ref = getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");

        assertNotNull("FS not available", ref);
View Full Code Here

    // Get the factory to create a component instance
    Factory fact = helper.getFactory(factName);
    assertNotNull("Cannot find the factory FooProvider-1", fact);

    helper.createComponentInstance(factName, compName);

    // Get a FooService provider
    ref = getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");

    assertNotNull("FS not available", ref);
View Full Code Here

  }

  public void testWhenNoInterface() {
    IPOJOHelper helper = new IPOJOHelper(this);
    String factoryName = "org.apache.felix.ipojo.test.scenarios.component.SimpleClass";
    ComponentInstance ci = helper.createComponentInstance(factoryName);
    waitForService(SimpleClass.class.getName(), null, 5000);
    SimpleClass simple = (SimpleClass) getServiceObject(SimpleClass.class.getName(), null);
    assertEquals("Hello", simple.hello());
    ci.dispose();
  }
View Full Code Here

        // Get the factory to create a component instance
        Factory fact = helper.getFactory(factName);
        assertNotNull("Cannot find the factory FooProvider-1", fact);
       
        // Don't give any configuration so, properties are null.
        helper.createComponentInstance(factName, compName);
       
        // Get a FooService provider
        ref = getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");

        assertNotNull("FS not available", ref);
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.