Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.ResponseRenderer


        Throwable renderCause = new ApplicationRuntimeException("Some failure.");

        IPage page = newPage();

        IRequestCycle cycle = newCycle("Exception", page);
        ResponseRenderer renderer = newRenderer(cycle, renderCause);
        RequestExceptionReporter reporter = newReporter();

        cycle.activate(page);

        reporter.reportRequestException(ErrorMessages.unableToProcessClientRequest(cause), cause);
View Full Code Here


    public void testIsActionRequest() throws Exception
    {
        IRequestCycle cycle = newCycle();
        PortletRequestGlobals globals = newRequestGlobals(false);
        ResponseRenderer renderer = newResponseRenderer();

        cycle.activate("ZePage");
        renderer.renderResponse(cycle);

        replayControls();

        PortletHomeService phs = new PortletHomeService();
        phs.setResponseRenderer(renderer);
View Full Code Here

        Object[] parameters = new Object[0];
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirect d = newDirect(false);
        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, null);

        trainGetPage(cycle, "ActivePage", page);
        cycle.activate(page);

        trainGetNestedComponent(page, "fred.barney", d);

        trainExtractListenerParameters(lf, cycle, parameters);
       
        expect(cycle.getParameter(BrowserEvent.NAME)).andReturn(null);
       
        cycle.setListenerParameters(parameters);

        d.trigger(cycle);

        rr.renderResponse(cycle);

        replay();

        DirectService ds = new DirectService();
        ds.setLinkFactory(lf);
View Full Code Here

        Object[] parameters = new Object[0];
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirect d = newDirect(false);
        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, null);

        trainGetPage(cycle, "ActivePage", page);
        cycle.activate(page);

        trainGetNestedComponent(page, "fred.barney", d);

        trainExtractListenerParameters(lf, cycle, parameters);
       
        trainExtractBrowserEvent(cycle);
       
        cycle.setListenerParameters(isA(Object[].class));
       
        d.trigger(cycle);

        rr.renderResponse(cycle);

        replay();

        DirectService ds = new DirectService();
        ds.setLinkFactory(lf);
View Full Code Here

        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IPage componentPage = newPage();
        IDirect d = newDirect(false);
        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);
       
        expect(cycle.getParameter(BrowserEvent.NAME)).andReturn(null);
       
        cycle.setListenerParameters(parameters);

        d.trigger(cycle);

        rr.renderResponse(cycle);

        replay();

        DirectService ds = new DirectService();
        ds.setLinkFactory(lf);
View Full Code Here

        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirect d = newDirect(false);
       
        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 = newMock(WebSession.class);
        WebRequest request = newWebRequest(session);
       
        expect(session.isNew()).andReturn(false);
       
        trainExtractListenerParameters(lf, cycle, parameters);
       
        expect(cycle.getParameter(BrowserEvent.NAME)).andReturn(null);
       
        cycle.setListenerParameters(parameters);

        d.trigger(cycle);

        rr.renderResponse(cycle);

        replay();

        DirectService ds = new DirectService();
        ds.setLinkFactory(lf);
View Full Code Here

    {
        IRequestCycle cycle = newCycle();
        IExternalPage page = newMock(IExternalPage.class);
        Object[] parameters = new Object[0];
        LinkFactory lf = newLinkFactory();
        ResponseRenderer rr = newResponseRenderer();
       
        trainGetParameter(cycle, ServiceConstants.PAGE, "ActivePage");
       
        trainGetPage(cycle, "ActivePage", page);
       
        trainExtractListenerParameters(lf, cycle, parameters);
       
        cycle.setListenerParameters(parameters);
        cycle.activate(page);
       
        page.activateExternalPage(parameters, cycle);
       
        rr.renderResponse(cycle);

        replay();

        ExternalService es = new ExternalService();
        es.setLinkFactory(lf);
View Full Code Here

    }

    public void testService() throws Exception
    {
        IRequestCycle cycle = newCycle();
        ResponseRenderer rr = newResponseRenderer();

        trainGetParameter(cycle, ServiceConstants.PAGE, "TargetPage");

        cycle.activate("TargetPage");

        rr.renderResponse(cycle);

        replay();

        PageService ps = new PageService();
        ps.setResponseRenderer(rr);
View Full Code Here

    public void testService() throws Exception
    {
        IRequestCycle cycle = newCycle();
        ResetEventHub hub = newMock(ResetEventHub.class);
        ResponseRenderer rr = newResponseRenderer();

        trainGetParameter(cycle, ServiceConstants.PAGE, "TargetPage");

        hub.fireResetEvent();

        cycle.activate("TargetPage");

        rr.renderResponse(cycle);

        replay();

        ResetService rs = new ResetService();
        rs.setEnabled(true);
View Full Code Here

    public void testServiceNotEnabled() throws Exception
    {
        IRequestCycle cycle = newCycle();
        ResetEventHub hub = newMock(ResetEventHub.class);
        ResponseRenderer rr = newResponseRenderer();

        trainGetParameter(cycle, ServiceConstants.PAGE, "TargetPage");

        cycle.activate("TargetPage");

        rr.renderResponse(cycle);

        replay();

        ResetService rs = new ResetService();
        rs.setEnabled(false);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.ResponseRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.