Examples of IExternalPage


Examples of org.apache.tapestry.IExternalPage

    }

    private IExternalPage newExternalPage(String pageName)
    {
        MockControl control = newControl(IExternalPage.class);
        IExternalPage page = (IExternalPage) control.getMock();

        page.getPageName();
        control.setReturnValue(pageName);

        return page;
    }
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    public void testByName()
    {
        Object[] parameters =
        { "param1", "param2" };

        IExternalPage page = newExternalPage();
        IRequestCycle cycle = newCycleGetPage("Fred", page);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        replayControls();

        ExternalCallback callback = new ExternalCallback("Fred", parameters);
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

        verifyControls();
    }

    public void testByNameNoParameters()
    {
        IExternalPage page = newExternalPage();
        IRequestCycle cycle = newCycleGetPage("Fred", page);

        cycle.activate(page);

        page.activateExternalPage(null, cycle);

        replayControls();

        ExternalCallback callback = new ExternalCallback("Fred", null);
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    public void testByPage()
    {
        Object[] parameters =
        { "param1", "param2" };

        IExternalPage page = newExternalPage("Barney");
        IRequestCycle cycle = newCycleGetPage("Barney", page);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        replayControls();

        ExternalCallback callback = new ExternalCallback(page, parameters);
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    public void service(IRequestCycle cycle) throws IOException
    {
        String pageName = cycle.getParameter(ServiceConstants.PAGE);
        IPage rawPage = cycle.getPage(pageName);

        IExternalPage page = null;

        try
        {
            page = (IExternalPage) rawPage;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(EngineMessages.pageNotCompatible(
                    rawPage,
                    IExternalPage.class), rawPage, null, ex);
        }

        Object[] parameters = _linkFactory.extractListenerParameters(cycle);

        cycle.setListenerParameters(parameters);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        _responseRenderer.renderResponse(cycle);
    }
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

        IEngineServiceView engine,
        IRequestCycle cycle,
        ResponseOutputStream output)
        throws ServletException, IOException
    {try { __CLOVER_82_0.M[474]++;
        __CLOVER_82_0.S[2121]++;IExternalPage page = null;

        __CLOVER_82_0.S[2122]++;String[] context = getServiceContext(cycle.getRequestContext());

        __CLOVER_82_0.S[2123]++;if ((((context == null || context.length != 1) && (++__CLOVER_82_0.CT[398] != 0)) || (++__CLOVER_82_0.CF[398] == 0))){
            __CLOVER_82_0.S[2124]++;throw new ApplicationRuntimeException(
                Tapestry.format("service-single-context-parameter", Tapestry.EXTERNAL_SERVICE));}

        __CLOVER_82_0.S[2125]++;String pageName = context[0];

        __CLOVER_82_0.S[2126]++;try
        {
            __CLOVER_82_0.S[2127]++;page = (IExternalPage) cycle.getPage(pageName);
        }
        catch (ClassCastException ex)
        {
            __CLOVER_82_0.S[2128]++;throw new ApplicationRuntimeException(
                Tapestry.format("ExternalService.page-not-compatible", pageName),
                ex);
        }

        __CLOVER_82_0.S[2129]++;Object[] parameters = getParameters(cycle);

        __CLOVER_82_0.S[2130]++;cycle.setServiceParameters(parameters);

        __CLOVER_82_0.S[2131]++;cycle.activate(page);

        __CLOVER_82_0.S[2132]++;page.activateExternalPage(parameters, cycle);

        // Render the response.
        __CLOVER_82_0.S[2133]++;engine.renderResponse(cycle, output);
    } finally { }}
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

        IEngineServiceView engine,
        IRequestCycle cycle,
        ResponseOutputStream output)
        throws ServletException, IOException
    {try { __CLOVER_82_0.M[3036]++;
        __CLOVER_82_0.S[12524]++;IExternalPage page = null;

        __CLOVER_82_0.S[12525]++;String[] context = getServiceContext(cycle.getRequestContext());

        __CLOVER_82_0.S[12526]++;if ((((context == null || context.length != 1) && (++__CLOVER_82_0.CT[2146] != 0)) || (++__CLOVER_82_0.CF[2146] == 0))){
            __CLOVER_82_0.S[12527]++;throw new ApplicationRuntimeException(
                Tapestry.format("service-single-context-parameter", Tapestry.EXTERNAL_SERVICE));}

        __CLOVER_82_0.S[12528]++;String pageName = context[0];

        __CLOVER_82_0.S[12529]++;try
        {
            __CLOVER_82_0.S[12530]++;page = (IExternalPage) cycle.getPage(pageName);
        }
        catch (ClassCastException ex)
        {
            __CLOVER_82_0.S[12531]++;throw new ApplicationRuntimeException(
                Tapestry.format("ExternalService.page-not-compatible", pageName),
                ex);
        }

        __CLOVER_82_0.S[12532]++;Object[] parameters = getParameters(cycle);

        __CLOVER_82_0.S[12533]++;cycle.setServiceParameters(parameters);

        __CLOVER_82_0.S[12534]++;cycle.activate(page);

        __CLOVER_82_0.S[12535]++;page.activateExternalPage(parameters, cycle);

        // Render the response.
        __CLOVER_82_0.S[12536]++;_responseRenderer.renderResponse(cycle, output);
    } finally { }}
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    public void testService() throws Exception
    {
        MockControl cyclec = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) cyclec.getMock();

        IExternalPage page = (IExternalPage) newMock(IExternalPage.class);

        Object[] parameters = new Object[0];

        cycle.getParameter(ServiceConstants.PAGE);
        cyclec.setReturnValue("ActivePage");

        cycle.getPage("ActivePage");
        cyclec.setReturnValue(page);

        LinkFactory lf = newLinkFactory(cycle, parameters);

        cycle.setListenerParameters(parameters);
        cycle.activate(page);
        page.activateExternalPage(parameters, cycle);

        ResponseRenderer rr = (ResponseRenderer) newMock(ResponseRenderer.class);

        rr.renderResponse(cycle);
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

        IEngineServiceView engine,
        IRequestCycle cycle,
        ResponseOutputStream output)
        throws ServletException, IOException
    {
        IExternalPage page = null;

        String[] context = getServiceContext(cycle.getRequestContext());

        if (context == null || context.length != 1)
            throw new ApplicationRuntimeException(
                Tapestry.format("service-single-context-parameter", Tapestry.EXTERNAL_SERVICE));

        String pageName = context[0];

        try
        {
            page = (IExternalPage) cycle.getPage(pageName);
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ExternalService.page-not-compatible", pageName),
                ex);
        }

        Object[] parameters = getParameters(cycle);

        cycle.setServiceParameters(parameters);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        // Render the response.
        engine.renderResponse(cycle, output);
    }
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    }

    private IExternalPage newExternalPage(String pageName)
    {
        MockControl control = newControl(IExternalPage.class);
        IExternalPage page = (IExternalPage) control.getMock();

        page.getPageName();
        control.setReturnValue(pageName);

        return page;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.