Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.ResponseRenderer


        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

        return cycle;
    }

    protected ResponseRenderer newRenderer(IRequestCycle cycle, Throwable throwable) throws Exception
    {
        ResponseRenderer renderer = newMock(ResponseRenderer.class);
   
        renderer.renderResponse(cycle);
   
        if (throwable != null)
            expectLastCall().andThrow(throwable);
   
        return renderer;
View Full Code Here

        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, 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.triggerEvent(eq(cycle), isA(BrowserEvent.class));
       
        rr.renderResponse(cycle);
       
        replay();

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

        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IPage componentPage = newPage();
        IDirectEvent 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);
        trainExtractBrowserEvent(cycle);
       
        cycle.setListenerParameters(isA(Object[].class));
       
        d.triggerEvent(eq(cycle), isA(BrowserEvent.class));

        rr.renderResponse(cycle);

        replay();

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

        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();

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

        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, null);
View Full Code Here

    {
        Throwable cause = new IllegalArgumentException();
        IPage page = newPage();

        IRequestCycle cycle = newCycle("Exception", page);
        ResponseRenderer renderer = newRenderer(cycle, null);

        cycle.activate(page);

        replay();
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.