Package org.apache.tapestry

Examples of org.apache.tapestry.IRequestCycle


     * the time of render) page.
     */
    public void testServiceComplex() throws Exception
    {
        Object[] parameters = new Object[0];
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IPage componentPage = newPage();
        IDirect 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);

        cycle.setListenerParameters(parameters);

        d.trigger(cycle);

        rr.renderResponse(cycle);

View Full Code Here


        verifyControls();
    }

    public void testServiceNotDirect() throws Exception
    {
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IComponent c = newComponent();
        Location l = newLocation();

        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", c);

        trainGetExtendedId(c, "ActivePage/fred.barney");
        trainGetLocation(c, l);
View Full Code Here

    }

    public void testSessionActiveAndRequired() throws Exception
    {
        Object[] parameters = new Object[0];
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirect d = newDirect();
        WebSession session = newWebSession(false);
        WebRequest request = newWebRequest(session);
        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);

        trainExtractListenerParameters(lf, cycle, parameters);

        cycle.setListenerParameters(parameters);

        d.trigger(cycle);

        rr.renderResponse(cycle);
View Full Code Here

        setReturnValue(direct, isStateful);
    }

    public void testStaleSession() throws Exception
    {
        IRequestCycle cycle = newCycle();
        IPage page = newPage();
        IDirect d = newDirect();
        WebRequest request = newWebRequest(null);
        Location l = newLocation();

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

    /** @since 4.0 */
    public void testGetURLWithParameters()
    {
        WebRequest request = newRequest();
        IRequestCycle rc = newCycle();

        trainEncodeURL(
                rc,
                "/context/servlet?service=myservice",
                "/context/servlet?service=myservice;encoded");
View Full Code Here

    }

    public void testGetURLWithServiceParameters()
    {
        WebRequest request = newRequest();
        IRequestCycle rc = newCycle();

        EngineServiceLink l = new EngineServiceLink(rc, "/ctx/app", ENCODING, _urlCodec, request,
                buildParameters("foo", new String[]
                { "godzilla", "frodo" }), false);
View Full Code Here

    /** @since 4.0 */

    public void testGetURLSansParameters()
    {
        WebRequest request = newRequest();
        IRequestCycle rc = newCycle();

        EngineServiceLink l = new EngineServiceLink(rc, "/context/servlet", ENCODING, _urlCodec,
                request, buildParameters("myservice", null), true);

        trainEncodeURL(rc, "/context/servlet", "/context/servlet;encoded");
View Full Code Here

    /** @since 4.0 */

    public void testGetURLWithAnchor()
    {
        WebRequest request = newRequest();
        IRequestCycle rc = (IRequestCycle) newMock(IRequestCycle.class);

        EngineServiceLink l = new EngineServiceLink(rc, "/context/servlet", ENCODING, _urlCodec,
                request, buildParameters("myservice", null), false);

        replayControls();
View Full Code Here

    }

    public void testGetURLWithAnchorAndParameters() throws Exception
    {
        WebRequest request = newRequest();
        IRequestCycle rc = newCycle();

        EngineServiceLink l = new EngineServiceLink(rc, "/context/servlet", ENCODING, _urlCodec,
                request, buildParameters("myservice", null), false);

        replayControls();
View Full Code Here

    }

    public void testGetAbsoluteURL() throws Exception
    {
        WebRequest request = newRequest();
        IRequestCycle rc = newCycle();

        EngineServiceLink l = new EngineServiceLink(rc, "/ctx/app", ENCODING, _urlCodec, request,
                buildParameters("myservice", null), false);

        trainGetScheme(request, "HTTP");
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IRequestCycle

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.