198199200201202203204205206207208
ElseBean reverse = (ElseBean) newInstance(ElseBean.class); IRequestCycle cycle = newCycle(); IForm form = newMock(IForm.class); expect(cycle.renderStackPush(conditional)).andReturn(conditional); expect(cycle.isRewinding()).andReturn(false); expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(form);
214215216217218219220221222223224
cycle.setAttribute(IfBean.IF_VALUE_ATTRIBUTE, Boolean.FALSE); expect(cycle.renderStackPop()).andReturn(conditional); expect(cycle.renderStackPush(reverse)).andReturn(reverse); expect(cycle.getAttribute(IfBean.IF_VALUE_ATTRIBUTE)).andReturn(Boolean.FALSE); expect(cycle.isRewinding()).andReturn(false);
250251252253254255256257258259260
ElseBean reverse = (ElseBean) newInstance(ElseBean.class); IForm form = newMock(IForm.class); IRequestCycle cycle = newCycle(); expect(cycle.renderStackPush(conditional)).andReturn(conditional); expect(cycle.isRewinding()).andReturn(true); expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(form);
270271272273274275276277278279280
cycle.setAttribute(IfBean.IF_VALUE_ATTRIBUTE, Boolean.TRUE); expect(cycle.renderStackPop()).andReturn(conditional); expect(cycle.renderStackPush(reverse)).andReturn(reverse); expect(cycle.getAttribute(IfBean.IF_VALUE_ATTRIBUTE)).andReturn(Boolean.TRUE); IRender body2 = newRender();
301302303304305306307308309310311
317318319320321322323324325326327
cycle.setAttribute(IfBean.IF_VALUE_ATTRIBUTE, Boolean.FALSE); expect(cycle.renderStackPop()).andReturn(conditional); expect(cycle.renderStackPush(reverse)).andReturn(reverse); expect(cycle.getAttribute(IfBean.IF_VALUE_ATTRIBUTE)).andReturn(Boolean.FALSE); expect(cycle.isRewinding()).andReturn(true);
358359360361362363364365366367368
"element", "div", "specification", spec, "renderTag", Boolean.TRUE }); expect(cycle.renderStackPush(conditional)).andReturn(conditional); expect(cycle.isRewinding()).andReturn(false); expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(null);
401402403404405406407408409410411
"specification", spec, "renderTag", Boolean.FALSE, "templateTagName", "fieldset" }); expect(cycle.renderStackPush(conditional)).andReturn(conditional); expect(cycle.isRewinding()).andReturn(false); expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(null);
4243444546474849505152
IRequestCycle cycle = newMock(IRequestCycle.class); Location l = newLocation(); Any any = newInstance(Any.class, new Object[] { "location", l }); expect(cycle.renderStackPush(any)).andReturn(any); expect(cycle.renderStackPop()).andReturn(any); replay();
7172737475767778798081
IRequestCycle cycle = newCycle(false, writer); Any any = newInstance(Any.class, new Object[] { "element", "span" }); expect(cycle.renderStackPush(any)).andReturn(any); writer.begin("span"); IRender body = newRender(); body.render(writer, cycle);