Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.LinkFactory


    protected LinkFactory newLinkFactory(IRequestCycle cycle, Map parameters, boolean stateful,
            ILink link)
    {
        MockControl control = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) control.getMock();

        lf.constructLink(cycle, parameters, stateful);

        control.setReturnValue(link);

        return lf;
    }
View Full Code Here


public class TestExternalService extends ServiceTestCase
{
    private LinkFactory newLinkFactory(IRequestCycle cycle, Object[] serviceParameters)
    {
        MockControl control = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) control.getMock();

        lf.extractListenerParameters(cycle);
        control.setReturnValue(serviceParameters);

        return lf;
    }
View Full Code Here

        parameters.put(ServiceConstants.SERVICE, Tapestry.EXTERNAL_SERVICE);
        parameters.put(ServiceConstants.PAGE, "ActivePage");
        parameters.put(ServiceConstants.PARAMETER, serviceParameters);

        MockControl lfc = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) lfc.getMock();

        ILink link = (ILink) newMock(ILink.class);

        IRequestCycle cycle = (IRequestCycle) newMock(IRequestCycle.class);

        lf.constructLink(cycle, parameters, true);
        lfc.setReturnValue(link);

        replayControls();

        ExternalService es = new ExternalService();
View Full Code Here

        cyclec.setReturnValue("ActivePage");

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

        LinkFactory lf = newLinkFactory(cycle, parameters);

        cycle.setListenerParameters(parameters);
        cycle.activate(page);
        page.activateExternalPage(parameters, cycle);
View Full Code Here

        parameters.put(ServiceConstants.CONTAINER, null);
        parameters.put(ServiceConstants.SESSION, null);
        parameters.put(ServiceConstants.PARAMETER, serviceParameters);

        MockControl lfc = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) lfc.getMock();

        ILink link = newLink();

        lf.constructLink(cycle, parameters, true);
        lfc.setReturnValue(link);

        replayControls();

        DirectService ds = new DirectService();
View Full Code Here

        parameters.put(ServiceConstants.CONTAINER, null);
        parameters.put(ServiceConstants.SESSION, "T");
        parameters.put(ServiceConstants.PARAMETER, serviceParameters);

        MockControl lfc = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) lfc.getMock();

        ILink link = newLink();

        lf.constructLink(cycle, parameters, true);
        lfc.setReturnValue(link);

        replayControls();

        DirectService ds = new DirectService();
View Full Code Here

        parameters.put(ServiceConstants.CONTAINER, "ComponentPage");
        parameters.put(ServiceConstants.SESSION, null);
        parameters.put(ServiceConstants.PARAMETER, serviceParameters);

        MockControl lfc = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) lfc.getMock();

        ILink link = newLink();

        lf.constructLink(cycle, parameters, true);
        lfc.setReturnValue(link);

        replayControls();

        DirectService ds = new DirectService();
View Full Code Here

        page.getNestedComponent("fred.barney");
        pagec.setReturnValue(d);

        MockControl lfc = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) lfc.getMock();

        lf.extractListenerParameters(cycle);
        lfc.setReturnValue(parameters);

        cycle.setListenerParameters(parameters);

        d.trigger(cycle);
View Full Code Here

        componentPage.getNestedComponent("fred.barney");
        componentPagec.setReturnValue(d);

        MockControl lfc = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) lfc.getMock();

        lf.extractListenerParameters(cycle);
        lfc.setReturnValue(parameters);

        cycle.setListenerParameters(parameters);

        d.trigger(cycle);
View Full Code Here

        WebSession session = newWebSession(false);
        WebRequest request = newWebRequest(session);

        MockControl lfc = newControl(LinkFactory.class);
        LinkFactory lf = (LinkFactory) lfc.getMock();

        lf.extractListenerParameters(cycle);
        lfc.setReturnValue(parameters);

        cycle.setListenerParameters(parameters);

        d.trigger(cycle);
View Full Code Here

TOP

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

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.