{
IMarkupWriter writer = newWriter();
IRequestCycle cycle = newCycle();
IValidationDelegate delegate = newDelegate();
MockForm form = new MockForm(delegate);
ComponentEventInvoker invoker =
org.easymock.classextension.EasyMock.createMock(ComponentEventInvoker.class);
trainIsRewound(cycle, form, true);
trainGetPageRenderSupport(cycle, null);
replay();
final FormSupport fs = newFormSupport(writer, cycle, form);
verify();
trainCycleSeedEncoding(cycle);
delegate.clear();
trainCycleForRewind(cycle, "barney", null);
final IFormComponent component = newFormComponent("barney", "barney");
IRender body = newComponentRenderBody(fs, component, writer);
form.setBody(body);
form.setEventInvoker(invoker);
trainExtractBrowserEvent(cycle);
invoker.invokeFormListeners(eq(fs), eq(cycle), isA(BrowserEvent.class));
replay();
assertEquals(FormConstants.SUBMIT_NORMAL, fs.rewind());