use of org.motechproject.event.listener.OtherSampleEventListener in project motech by motech.
the class EventListenerRegistryTest method testRemovingListenerPreservesOtherListeners.
@Test
public void testRemovingListenerPreservesOtherListeners() {
List<String> et = new ArrayList<String>();
et.add("org.motechproject.server.someevent");
EventListener sel = new SampleEventListener();
EventListener se2 = new OtherSampleEventListener();
registry.registerListener(sel, et);
registry.registerListener(se2, et);
Set<EventListener> el = registry.getListeners("org.motechproject.server.someevent");
assertEquals(2, el.size());
registry.clearListenersForBean("TestEventListener");
el = registry.getListeners("org.motechproject.server.someevent");
assertEquals(1, el.size());
registry.clearListenersForBean("TestEventListener2");
el = registry.getListeners("org.motechproject.server.someevent");
assertEquals(0, el.size());
}
Aggregations