Package org.apache.felix.ipojo.test.composite.service

Examples of org.apache.felix.ipojo.test.composite.service.FooService.foo()


    sc = Utils.getServiceContext(import1);
    refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
    assertNotNull("Test foo availability inside the composite - 3", refs);
    assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
    fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
   
    foo1.dispose();
    // No provider -> Invalid
    assertTrue("Test component invalidity - 3", import1.getState() == ComponentInstance.INVALID);
View Full Code Here


    ServiceContext sc = Utils.getServiceContext(import2);
    ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
    assertNotNull("Test foo availability inside the composite - 1", refs);
    assertEquals("Test foo availability inside the composite - 1.2", refs.length, 2);
    FooService fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
    fs = (FooService) sc.getService(refs[1]);
    assertTrue("Test foo invocation (2)", fs.foo());
    sc.ungetService(refs[1]);
   
View Full Code Here

    assertEquals("Test foo availability inside the composite - 1.2", refs.length, 2);
    FooService fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
    fs = (FooService) sc.getService(refs[1]);
    assertTrue("Test foo invocation (2)", fs.foo());
    sc.ungetService(refs[1]);
   
    foo1.stop();
    assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
    sc = Utils.getServiceContext(import2);
View Full Code Here

    sc = Utils.getServiceContext(import2);
    refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
    assertNotNull("Test foo availability inside the composite - 1", refs);
    assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
    fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
   
    // Stop the second provider
    foo2.stop();   
    assertTrue("Test component invalidity - 2", import2.getState() == ComponentInstance.INVALID);
View Full Code Here

    sc = Utils.getServiceContext(import2);
    refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
    assertNotNull("Test foo availability inside the composite - 3", refs);
    assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
    fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
  }
 
  public void testSimple2() {
    import2.start();
View Full Code Here

    ServiceContext sc = Utils.getServiceContext(import2);
    ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
    assertNotNull("Test foo availability inside the composite - 1", refs);
    assertEquals("Test foo availability inside the composite - 1.2", refs.length, 2);
    FooService fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
    fs = (FooService) sc.getService(refs[1]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[1]);
   
View Full Code Here

    assertEquals("Test foo availability inside the composite - 1.2", refs.length, 2);
    FooService fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
    fs = (FooService) sc.getService(refs[1]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[1]);
   
    foo2.stop();
    assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
    sc = Utils.getServiceContext(import2);
View Full Code Here

    sc = Utils.getServiceContext(import2);
    refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
    assertNotNull("Test foo availability inside the composite - 1", refs);
    assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
    fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
   
    // Stop the second provider
    foo1.stop();   
    assertTrue("Test component invalidity - 2", import2.getState() == ComponentInstance.INVALID);
View Full Code Here

    sc = Utils.getServiceContext(import2);
    refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
    assertNotNull("Test foo availability inside the composite - 3", refs);
    assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
    fs = (FooService) sc.getService(refs[0]);
    assertTrue("Test foo invocation", fs.foo());
    sc.ungetService(refs[0]);
  }
 
 
View Full Code Here

    assertTrue("Check invocation", bs.foo());
    getContext().ungetService(ref);
    ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "mon_coeur");
    assertNotNull("Check ref 2 ",ref);
    FooService fs = (FooService) getContext().getService(ref);
    assertTrue("Check invocation", fs.foo());
    getContext().ungetService(ref);
    ci.dispose();
  }
 
  public void testAPI2() {
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.