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

Examples of org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper


public class CallbacksTest extends OSGiTestCase {

    IPOJOHelper helper;

    public void setUp() {
        helper = new IPOJOHelper(this);
    }
View Full Code Here


    private Factory pi4, pi5, pi6, pi7;
   
    private IPOJOHelper helper;
   
    public void setUp() {
        helper = new IPOJOHelper(this);
        pi4 = helper.getFactory("PS-PI4");
        pi5 = helper.getFactory("PS-PI5");
        pi6 = helper.getFactory("PS-PI6");
        pi7 = helper.getFactory("PS-PI7");
    }
View Full Code Here

    private IPOJOHelper helper;
    private ComponentInstance cons1, cons2, prov;
    private ComponentInstance cons3, prov2;

    public void setUp() {
        helper = new IPOJOHelper(this);
        cons1 = helper.createComponentInstance("PSS-Cons");
        assertEquals("cons1 invalid", ComponentInstance.INVALID, cons1.getState());
        cons2 = helper.createComponentInstance("PSS-Cons");
        assertEquals("cons2 invalid", ComponentInstance.INVALID, cons2.getState());
        prov = helper.createComponentInstance("PSS-FooProviderType-Instance");
View Full Code Here

import org.osgi.framework.ServiceReference;

public class NullCheck extends OSGiTestCase {
   
    public void testNull() {
        IPOJOHelper helper = new IPOJOHelper(this);
       
        String factName = "PS-Null";
        String compName = "NullCheck";
        ServiceReference ref = null;
       
        // Check that no Foo Service are available
        ref = getServiceReference(FooService.class.getName());
        assertNull("FS already available", ref);
   
        // 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);
       
        // Check service properties
        assertNull(ref.getProperty("prop1"));
        assertNotNull(ref.getProperty("prop2"));
       
        // Test foo invocation
        FooService fs = (FooService) getServiceObject(ref);
        assertTrue("FooService invocation failed", fs.foo());
       
        ref = getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");
        // Check service properties
        assertNotNull(ref.getProperty("prop1"));
        assertNull(ref.getProperty("prop2"));

       
        helper.dispose();

       
        // Check that there is no more FooService
        ref = getServiceReference(FooService.class.getName(), null);
       
View Full Code Here

    PrimitiveManipulationTestService prim;
    IPOJOHelper helper;
   
    public void setUp() {
        helper = new IPOJOHelper(this);
        ComponentInstance instance = helper.createComponentInstance("ManipulationPrimitives-PrimitiveManipulationTesterA");
        assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
        ServiceReference ref = helper.getServiceReferenceByName(PrimitiveManipulationTestService.class.getName(), instance.getInstanceName());
        assertNotNull("Check prim availability", ref);
        prim = (PrimitiveManipulationTestService) getServiceObject(ref);
View Full Code Here

    IPOJOHelper helper;
    ComponentInstance dynInstance;
    ComponentInstance dpInstance;
   
    public void setUp() {
        helper = new IPOJOHelper(this);
        dynInstance = helper.createComponentInstance(dynamic, (Properties) null);
        dpInstance = helper.createComponentInstance(dynamicpriority, (Properties) null);
    }
View Full Code Here

  PrimitiveManipulationTestService prim;
 
  IPOJOHelper helper;
 
  public void setUp() {
      helper = new IPOJOHelper(this);
      ComponentInstance instance = helper.createComponentInstance("ManipulationPrimitives-PrimitiveManipulationTester");
    assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
    prim = (PrimitiveManipulationTestService) getServiceObject(PrimitiveManipulationTestService.class.getName(), "(instance.name=" + instance.getInstanceName() + ")");
    assertNotNull("Check prim availability", prim);
  }
View Full Code Here

    private IPOJOHelper helper;
    private ComponentInstance cons1, cons2, prov;
    private ComponentInstance cons3, prov2;

    public void setUp() {
        helper = new IPOJOHelper(this);
        cons1 = helper.createComponentInstance("PSS-Cons");
        assertEquals("cons1 invalid", ComponentInstance.INVALID, cons1.getState());
        cons2 = helper.createComponentInstance("PSS-Cons");
        assertEquals("cons2 invalid", ComponentInstance.INVALID, cons2.getState());
        prov = helper.createComponentInstance("PSS-FooProviderType-Custom");
View Full Code Here

    private Architecture lazzyArchSingM;
    private Architecture lazzyArchSevM;

    public void setUp() {
        helper = new IPOJOHelper(this);

        String factName = "ManipulationCreation-FooProviderType-1";
        String compName = "FooProvider-1";
        ci_lazzy = helper.createComponentInstance(factName ,compName);
View Full Code Here

public class ProvidedServiceArchitectureTest extends OSGiTestCase {
 
    private IPOJOHelper helper;
   
    public void setUp() {
        helper = new IPOJOHelper(this);
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper

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.