@Test public void loopback_request() throws Exception { RequestPageCache cache = mockRequestPageCache(); ComponentEventResultProcessor processor = mockComponentEventResultProcessor(); PageResponseRenderer renderer = mockPageResponseRenderer(); Page page = mockPage(); EventContext context = mockEventContext(); ComponentPageElement root = mockComponentPageElement(); InternalComponentResources pageResources = mockInternalComponentResources(); PageActivator activator = newMock(PageActivator.class); Request request = mockRequest(); train_getAttribute(request, InternalConstants.BYPASS_ACTIVATION, null); train_get(cache, "foo/Bar", page); train_getRootElement(page, root); train_getComponentResources(root, pageResources); expect(activator.activatePage(pageResources, context, processor)).andReturn(false); renderer.renderPageResponse(page); replay(); PageRenderRequestHandler handler = new PageRenderRequestHandlerImpl(cache, processor, renderer, activator, request); PageRenderRequestParameters parameters = new PageRenderRequestParameters("foo/Bar", context, true); handler.handle(parameters); verify(); }
public void handle(PageRenderRequestParameters parameters) throws IOException { Page page = cache.get(parameters.getLogicalPageName()); if (request.getAttribute(InternalConstants.BYPASS_ACTIVATION) == null) { if (pageActivator.activatePage(page.getRootElement().getComponentResources(), parameters.getActivationContext(), resultProcessor)) { return; } if (!parameters.isLoopback()) { page.pageReset(); } } pageResponseRenderer.renderPageResponse(page); }
PageRenderRequestHandlerImpl implements PageRenderRequestHandler { public void handle(PageRenderRequestParameters parameters) throws IOException { Page page = cache.get(parameters.getLogicalPageName()); if (request.getAttribute(InternalConstants.BYPASS_ACTIVATION) == null) { if (pageActivator.activatePage(page.getRootElement().getComponentResources(), parameters.getActivationContext(), resultProcessor)) { return; } if (!parameters.isLoopback()) { page.pageReset(); } } pageResponseRenderer.renderPageResponse(page); } }
PageRenderRequestHandlerImpl implements PageRenderRequestHandler { public void handle(PageRenderRequestParameters parameters) throws IOException { Page page = cache.get(parameters.getLogicalPageName()); if (request.getAttribute(InternalConstants.BYPASS_ACTIVATION) == null) { if (pageActivator.activatePage(page.getRootElement().getComponentResources(), parameters.getActivationContext(), resultProcessor)) { return; } if (!parameters.isLoopback()) { page.pageReset(); } } pageResponseRenderer.renderPageResponse(page); } PageRenderRequestHandlerImpl(RequestPageCache cache, @Traditional
    @Primary
    ComponentEventResultProcessor resultProcessor, PageResponseRenderer pageResponseRenderer,
                                        PageActivator pageActivator, Request request); }
PageRenderRequestHandlerImpl implements PageRenderRequestHandler { public void handle(PageRenderRequestParameters parameters) throws IOException { Page page = cache.get(parameters.getLogicalPageName()); if (request.getAttribute(InternalConstants.BYPASS_ACTIVATION) == null) { if (pageActivator.activatePage(page.getRootElement().getComponentResources(), parameters.getActivationContext(), resultProcessor)) { return; } if (!parameters.isLoopback()) { page.pageReset(); } } pageResponseRenderer.renderPageResponse(page); } PageRenderRequestHandlerImpl(RequestPageCache cache, @Traditional
    @Primary
    ComponentEventResultProcessor resultProcessor, PageResponseRenderer pageResponseRenderer,
                                        PageActivator pageActivator, Request request); void handle(PageRenderRequestParameters parameters); }
PageRenderRequestHandlerImpl implements PageRenderRequestHandler { public void handle(PageRenderRequestParameters parameters) throws IOException { Page page = cache.get(parameters.getLogicalPageName()); if (request.getAttribute(InternalConstants.BYPASS_ACTIVATION) == null) { if (pageActivator.activatePage(page.getRootElement().getComponentResources(), parameters.getActivationContext(), resultProcessor)) { return; } if (!parameters.isLoopback()) { page.pageReset(); } } pageResponseRenderer.renderPageResponse(page); } PageRenderRequestHandlerImpl(RequestPageCache cache, @Traditional
    @Primary
    ComponentEventResultProcessor resultProcessor, PageResponseRenderer pageResponseRenderer,
                                        PageActivator pageActivator, Request request); void handle(PageRenderRequestParameters parameters);  }