assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
// Check service providing
ServiceReference cs_ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), instance.getInstanceName());
assertNotNull("Check CheckService availability", cs_ref);
CheckService cs = (CheckService) osgiHelper.getRawServiceObject(cs_ref);
assertTrue("check CheckService invocation", cs.check());
assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
// Check int property
Integer index = (Integer) (cs.getProps().get("int"));
assertEquals("Check int property - 1 (" + index + ")", index.intValue(), 1);
fooProvider.stop();
//id_dep = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
fooProvider.start();
// Check instance validity
//id_dep = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
// Check service providing
cs_ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), instance.getInstanceName());
assertNotNull("Check CheckService availability", cs_ref);
cs = (CheckService) osgiHelper.getRawServiceObject(cs_ref);
assertTrue("check CheckService invocation", cs.check());
// Check int property
index = (Integer) (cs.getProps().get("int"));
assertEquals("Check int property - 2 (" + index + ")", index.intValue(), 3);
assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
}