public void testSessionActiveAndRequired() throws Exception
{
Object[] parameters = new Object[0];
IRequestCycle cycle = newCycle();
IPage page = newPage();
IDirectEvent d = newDirect();
LinkFactory lf = newLinkFactory();
ResponseRenderer rr = newResponseRenderer();
trainGetParameter(cycle, ServiceConstants.COMPONENT, "fred.barney");
trainGetParameter(cycle, ServiceConstants.CONTAINER, null);
trainGetParameter(cycle, ServiceConstants.PAGE, "ActivePage");
trainGetParameter(cycle, ServiceConstants.SESSION, "T");
trainGetPage(cycle, "ActivePage", page);
cycle.activate(page);
trainGetNestedComponent(page, "fred.barney", d);
trainIsStateful(d, true);
WebSession session = newWebSession(false);
WebRequest request = newWebRequest(session);
trainExtractListenerParameters(lf, cycle, parameters);
trainExtractBrowserEvent(cycle);
cycle.setListenerParameters(isA(Object[].class));
d.triggerEvent(eq(cycle), isA(BrowserEvent.class));
rr.renderResponse(cycle);
replay();