IRequestCycle cycle = newCycle();
IPage page = newPage();
IPage componentPage = newPage();
IDirect d = newDirect();
LinkFactory lf = newLinkFactory();
ResponseRenderer rr = newResponseRenderer();
trainGetParameter(cycle, ServiceConstants.COMPONENT, "fred.barney");
trainGetParameter(cycle, ServiceConstants.CONTAINER, "ComponentPage");
trainGetParameter(cycle, ServiceConstants.PAGE, "ActivePage");
trainGetParameter(cycle, ServiceConstants.SESSION, null);
trainGetPage(cycle, "ActivePage", page);
cycle.activate(page);
trainGetPage(cycle, "ComponentPage", componentPage);
trainGetNestedComponent(componentPage, "fred.barney", d);
trainExtractListenerParameters(lf, cycle, parameters);
cycle.setListenerParameters(parameters);
d.trigger(cycle);
rr.renderResponse(cycle);
replayControls();
DirectService ds = new DirectService();
ds.setLinkFactory(lf);