} catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
if(refs != null) { sr = refs[0]; }
assertNotNull("Check the check service availability", sr);
ServiceReference sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
Architecture arch = (Architecture) getContext().getService(sr_arch);
assertEquals("Check validity", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
// Kill the handler factory
HandlerManagerFactory f = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "check");
f.stop();
sr = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "HandlerTest-1");
assertNull("Check the check service unavailability", sr);
sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
assertNull("Check the architecture unavailability", sr_arch);
// The instance is disposed, restart the handler
f.start();
Properties props = new Properties();
props.put("instance.name","HandlerTest-1");
props.put("csh.simple", "simple");
Properties p = new Properties();
p.put("a", "a");
p.put("b", "b");
p.put("c", "c");
props.put("csh.map", p);
instance = Utils.getComponentInstance(getContext(), "HANDLER-HandlerTester", props);
sr = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "HandlerTest-1");
assertNotNull("Check the check service availability - 2", sr);
sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
arch = (Architecture) getContext().getService(sr_arch);
assertEquals("Check validity - 2", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
}