{
public void test_Event_Connection()
{
EnhancementOperation op = newOp();
IComponentSpecification spec = new ComponentSpecification();
Resource resource = newResource(AnnotatedPage.class);
EventListenerAnnotationWorker worker = new EventListenerAnnotationWorker();
replay();
Method m = findMethod(AnnotatedPage.class, "eventListener");
assertTrue(worker.canEnhance(m));
assertFalse(worker.canEnhance(findMethod(AnnotatedPage.class, "getPersistentProperty")));
worker.peformEnhancement(op, spec, m, resource);
verify();
ComponentEventProperty property = spec.getComponentEvents("email");
assertNotNull(property);
List listeners = property.getEventListeners("onClick");
assertNotNull(listeners);
assertEquals(1, listeners.size());
property = spec.getElementEvents("foo");
assertNotNull(property);
listeners = property.getEventListeners("onClick");
assertNotNull(listeners);
assertEquals(1, listeners.size());