164165166167168169170171172173174
public void testCleanupAfterRender() { IRequestCycle cycle = newCycle(); cycle.removeAttribute(LinkSubmit.ATTRIBUTE_NAME); replayControls(); LinkSubmit linkSubmit = (LinkSubmit) newInstance(LinkSubmit.class);
116117118119120121122123124125126
cycle.setAttribute(eq("org.apache.tapestry.PageRenderSupport"), isA(PageRenderSupport.class)); cycle.renderPage(isA(ResponseBuilder.class)); cycle.removeAttribute("org.apache.tapestry.PageRenderSupport"); return cycle; } public void testSuccess() throws Exception
445446447448449450451452453454455
expect(cycle.getResponseBuilder()).andReturn(builder); builder.render(nested, field, cycle); cycle.removeAttribute(TapestryUtils.FIELD_PRERENDER); expect(nested.getBuffer()).andReturn("NESTED CONTENT"); replay();
175176177178179180181182183184185
public void testCleanupAfterRender() { IRequestCycle cycle = newCycle(); cycle.removeAttribute(LinkSubmit.ATTRIBUTE_NAME); replay(); LinkSubmit linkSubmit = (LinkSubmit) newInstance(LinkSubmit.class);
183184185186187188189190191192193
nested.close(); writer.end(); cycle.removeAttribute(Tapestry.LINK_COMPONENT_ATTRIBUTE_NAME); replay(); new DefaultLinkRenderer().renderLink(writer, cycle, component);
244245246247248249250251252253254
266267268269270271272273274275276
trainIsDisabled(component, true); component.renderBody(writer, cycle); cycle.removeAttribute(Tapestry.LINK_COMPONENT_ATTRIBUTE_NAME); replay(); new DefaultLinkRenderer().renderLink(writer, cycle, component);
289290291292293294295296297298299
trainIsDisabled(component, false); trainIsRewinding(cycle, true); component.renderBody(writer, cycle); cycle.removeAttribute(Tapestry.LINK_COMPONENT_ATTRIBUTE_NAME); replay(); new DefaultLinkRenderer().renderLink(writer, cycle, component);
344345346347348349350351352353354
nested.close(); writer.end(); cycle.removeAttribute(Tapestry.LINK_COMPONENT_ATTRIBUTE_NAME); replay(); new RendererFixture(writer, cycle, component, "xlink", true, "xtarget", "xurl").renderLink( writer,
399400401402403404405406407408409
writer.print("AFTER-BODY-RENDER"); writer.closeTag(); cycle.removeAttribute(Tapestry.LINK_COMPONENT_ATTRIBUTE_NAME); replay(); new RendererFixture(writer, cycle, component, "xlink", false, "xtarget", "xurl") .renderLink(writer, cycle, component);