protected void assertServiceEvent(int type, ServiceReference reference) throws Exception { ServiceEvent event = (ServiceEvent) waitForEvent(serviceEvents, type); log.debug("serviceEvents=" + serviceEvents); assertNotNull("Event not null", event); serviceEvents.remove(event); assertEquals(ConstantsHelper.serviceEvent(type), ConstantsHelper.serviceEvent(event.getType())); assertEquals(reference, event.getSource()); assertEquals(reference, event.getServiceReference()); }
@Override public void serviceChanged(ServiceEvent event) { synchronized (serviceEvents) { log.debug( "ServiceChanged type=" + ConstantsHelper.serviceEvent(event.getType()) + " for " + event); serviceEvents.add(event); serviceEvents.notifyAll(); } }