}
@Test
public void addEventProbe() {
Element elem = ElementFactory.make("identity", "src");
Event ev = new TagEvent(new TagList());
Pad sink = elem.getStaticPad("sink");
final AtomicReference<Event> e = new AtomicReference<Event>();
Pad.EVENT_PROBE event_probe = new Pad.EVENT_PROBE() {
public boolean eventReceived(Pad pad, Event event) {
e.set(event);
return false;
}
};
sink.addEventProbe(event_probe);
sink.sendEvent(ev);
assertEquals("event_prober.probeEvent() was not called", ev, e.get());
sink.removeEventProbe(event_probe);
Event ev2 = new TagEvent(new TagList());
sink.sendEvent(ev2);
assertNotSame("event_prober.probeEvent() should not have been called", ev2, e.get());
}