{
IRequestCycle cycle = newMock(IRequestCycle.class);
checkOrder(cycle, false);
ResponseBuilder resp = newMock(ResponseBuilder.class);
IEngineService engine = newMock(IEngineService.class);
IEngine cengine = newMock(IEngine.class);
ILink link = newMock(ILink.class);
IScript script = newMock(IScript.class);
PageRenderSupport prs = newMock(PageRenderSupport.class);
TranslatedFieldSupport translator = newMock(TranslatedFieldSupport.class);
ValidatableFieldSupport validator = newMock(ValidatableFieldSupport.class);
IValidationDelegate delegate = new ValidationDelegate();
IForm form = newMock(IForm.class);
IMarkupWriter writer = newBufferWriter();
Suggest comp = newInstance(Suggest.class,
"response", resp,
"templateTagName", "textarea",
"name", "suggest",
"clientId", "suggest",
"form", form,
"translatedFieldSupport", translator,
"validatableFieldSupport", validator,
"engineService", engine,
"script", script);
expect(cycle.isRewinding()).andReturn(false).anyTimes();
expect(resp.isDynamic()).andReturn(false);
expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(form).anyTimes();
expect(form.wasPrerendered(writer, comp)).andReturn(false).anyTimes();
expect(form.getDelegate()).andReturn(delegate).anyTimes();
expect(form.getElementId(comp)).andReturn("suggest");
expect(form.isRewinding()).andReturn(false).anyTimes();
form.setFormFieldUpdating(true);
expect(translator.format(comp, null)).andReturn("r2d2");
translator.renderContributions(comp, writer, cycle);
validator.renderContributions(comp, writer, cycle);
expect(cycle.getEngine()).andReturn(cengine);
expect(cengine.getOutputEncoding()).andReturn("utf-8");
expect(engine.getLink(eq(false), isA(DirectServiceParameter.class))).andReturn(link);
expect(link.getURL()).andReturn("http://url");
Capturer<Map> parm = newCapturer(Map.class);
trainGetAttribute(cycle, TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE, prs);