public void test_Prerendered_Field()
{
ClassResolver resolver = new DefaultClassResolver();
IComponentEventInvoker invoker = new org.apache.tapestry.internal.event.impl.ComponentEventInvoker();
IEngineService engine = newMock(IEngineService.class);
IRequestCycle cycle = newCycle();
checkOrder(cycle, false);
PageRenderSupport prs = newPageRenderSupport();
IScriptSource scriptSource = newMock(IScriptSource.class);
ComponentEventConnectionWorker worker = new ComponentEventConnectionWorker();
worker.setClassResolver(resolver);
worker.setEventInvoker(invoker);
worker.setEventEngine(engine);
worker.setScriptSource(scriptSource);
IDirectEvent component = newMock(IDirectEvent.class);
IComponentSpecification spec = new ComponentSpecification();
// now test render
invoker.addEventListener("comp1", spec);
spec.addEventListener("comp1", new String[] {"onclick"}, "testMethod", "form1", false, false, false, false);
expect(cycle.isRewinding()).andReturn(false);
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);