Package org.apache.felix.ipojo.test.scenarios.eh.service

Examples of org.apache.felix.ipojo.test.scenarios.eh.service.CheckService


        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
        if(refs != null) { sr = refs[0]; }
       
    assertNotNull("Check the check service availability", sr);
   
    CheckService cs = (CheckService) getContext().getService(sr);
    Properties p = cs.getProps();
    assertEquals("Assert 'simple' equality", p.get("Simple"), "simple");
    assertEquals("Assert 'a' equality", p.get("Map1"), "a");
    assertEquals("Assert 'b' equality", p.get("Map2"), "b");
    assertEquals("Assert 'c' equality", p.get("Map3"), "c");
   
View Full Code Here


            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
        if(refs != null) { sr = refs[0]; }
    assertNotNull("Check the check service availability", sr);
   
    CheckService cs = (CheckService) getContext().getService(sr);
    Properties p = cs.getProps();
    assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
    assertEquals("Assert 'a' equality", p.get("Map1"), "a");
    assertEquals("Assert 'b' equality", p.get("Map2"), "b");
    assertEquals("Assert 'c' equality", p.get("Map3"), "c");
   
View Full Code Here

            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
        if(refs != null) { sr = refs[0]; }
        assertNotNull("Check the check service availability", sr);
       
        CheckService cs = (CheckService) getContext().getService(sr);
        Properties p = cs.getProps();
        assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
        assertEquals("Size of p", 3, p.size()); // instance name, simple and changes.
       
        cs = null;
        getContext().ungetService(sr);
View Full Code Here

    ServiceReference sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
    Architecture arch = (Architecture) getContext().getService(sr_arch);
   
    assertEquals("Check instance validity - 0", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
   
    CheckService cs = (CheckService) getContext().getService(sr);
    Properties p = cs.getProps();
    Integer changes = (Integer) p.get("changes");
    assertNotNull("Check changes no null", changes);
    assertEquals("Changes changes 1 ("+changes+")", changes.intValue(), 1);
    assertEquals("Check instance validity - 1", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
    cs.check();
    p = cs.getProps();
    changes = (Integer) p.get("changes");
    assertEquals("Changes changes 2 ("+changes+")", changes.intValue(), 2);
    assertEquals("Check instance validity - 2", arch.getInstanceDescription().getState(), ComponentInstance.INVALID);
    cs.check();
    p = cs.getProps();
    changes = (Integer) p.get("changes");
    assertEquals("Changes changes 3 ("+changes+")", changes.intValue(), 3);
    assertEquals("Check instance validity - 3", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
    cs.check();
    p = cs.getProps();
    changes = (Integer) p.get("changes");
    assertEquals("Changes changes 4 ("+changes+")", changes.intValue(), 4);
    assertEquals("Check instance validity - 4", arch.getInstanceDescription().getState(), ComponentInstance.INVALID);
   
    cs = null;
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.test.scenarios.eh.service.CheckService

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.