checkOrder(form, false);
FormSupport formSupport = newMock(FormSupport.class);
IComponentSpecification spec = new ComponentSpecification();
IValidationDelegate delegate = newMock(IValidationDelegate.class);
ListenerInvoker listenerInvoker = newMock(ListenerInvoker.class);
ListenerMap listenerMap = newMock(ListenerMap.class);
IActionListener listener = newMock(IActionListener.class);
IPage page = newMock(IPage.class);
checkOrder(page, false);
Map comps = new HashMap();
comps.put("form1", form);
Map tprops = new HashMap();
tprops.put("id", "form1");
BrowserEvent event = new BrowserEvent("onSelect", "form1", new EventTarget(tprops));
ComponentEventInvoker invoker = new ComponentEventInvoker();
invoker.setInvoker(listenerInvoker);
spec.addEventListener("form1", new String[] { "onSelect" }, "fooListener",
"form1", false, false, false, false);
invoker.addFormEventListener("form1", spec);
expect(formSupport.getForm()).andReturn(form);
expect(form.getExtendedId()).andReturn("form1").anyTimes();
expect(form.getPage()).andReturn(page);
expect(page.getComponents()).andReturn(comps);
expect(form.getSpecification()).andReturn(spec);
expect(form.getDelegate()).andReturn(delegate).anyTimes();
delegate.clearErrors();
expectLastCall().anyTimes();
expect(form.getListeners()).andReturn(listenerMap);
expect(listenerMap.getListener("fooListener")).andReturn(listener);
form.addDeferredRunnable(isA(Runnable.class));
cycle.disableFocus();