Package org.apache.tapestry.engine

Examples of org.apache.tapestry.engine.ServiceEncoding


    public void testAddParameters()
    {
        IRequestCycle cycle = newCycle();
        PropertyPersistenceStrategy strategy = newStrategy();
        ServiceEncoding encoding = (ServiceEncoding) newMock(ServiceEncoding.class);

        strategy.addParametersForPersistentProperties(encoding, cycle, false);

        replayControls();
View Full Code Here


    {
        MockControl requestc = newControl(WebRequest.class);
        WebRequest request = (WebRequest) requestc.getMock();

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

        request.getParameterNames();
        requestc.setReturnValue(Arrays.asList(new Object[]
        { "bar", "appstate:MyPage" }));

        request.getParameterValue("appstate:MyPage");
        requestc.setReturnValue("ENCODED");

        encoding.setParameterValue("appstate:MyPage", "ENCODED");

        replayControls();

        ClientPropertyPersistenceStrategy strategy = new ClientPropertyPersistenceStrategy();
        strategy.setRequest(request);
View Full Code Here

        IRequestCycle cycle = (IRequestCycle) cyclec.getMock();

        MockControl pagec = newControl(IPage.class);
        IPage page = (IPage) pagec.getMock();

        ServiceEncoding encoding = (ServiceEncoding) newMock(ServiceEncoding.class);

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

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

        page.getPageName();
        pagec.setReturnValue("MyPage");

        page.getPageName();
        pagec.setReturnValue("MyPage");

        request.getParameterNames();
        requestc.setReturnValue(Arrays.asList(new Object[]
        { "foo", "state:MyPage", "state:OtherPage" }));

        request.getParameterValue("state:MyPage");
        requestc.setReturnValue("ENCODED");

        request.getParameterValue("state:OtherPage");
        requestc.setReturnValue("ENCODED");

        encoding.setParameterValue("state:MyPage", "ENCODED");

        replayControls();

        ClientPropertyPersistenceStrategy strategy = new ClientPropertyPersistenceStrategy();
        strategy.setRequest(request);
View Full Code Here

        squeezeServiceParameters(parameters);

        IEngine engine = cycle.getEngine();

        ServiceEncoding serviceEncoding = createServiceEncoding(parameters);

        // Give persistent property strategies a chance to store extra data
        // into the link.

        if (stateful)
            _persistenceStrategySource.addParametersForPersistentProperties(
                    serviceEncoding,
                    cycle,
                    post);

        String fullServletPath = _contextPath + serviceEncoding.getServletPath();

        return new EngineServiceLink(cycle, fullServletPath, engine.getOutputEncoding(), _codec,
                _request, parameters, stateful);
    }
View Full Code Here

    {
        MockControl requestc = newControl(WebRequest.class);
        WebRequest request = (WebRequest) requestc.getMock();

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

        request.getParameterNames();
        requestc.setReturnValue(Arrays.asList(new Object[]
        { "bar", "appstate:MyPage" }));

        request.getParameterValue("appstate:MyPage");
        requestc.setReturnValue("ENCODED");

        encoding.setParameterValue("appstate:MyPage", "ENCODED");

        replayControls();

        ClientPropertyPersistenceStrategy strategy = new ClientPropertyPersistenceStrategy();
        strategy.setRequest(request);
View Full Code Here

        IRequestCycle cycle = (IRequestCycle) cyclec.getMock();

        MockControl pagec = newControl(IPage.class);
        IPage page = (IPage) pagec.getMock();

        ServiceEncoding encoding = (ServiceEncoding) newMock(ServiceEncoding.class);

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

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

        page.getPageName();
        pagec.setReturnValue("MyPage");

        page.getPageName();
        pagec.setReturnValue("MyPage");

        request.getParameterNames();
        requestc.setReturnValue(Arrays.asList(new Object[]
        { "foo", "state:MyPage", "state:OtherPage" }));

        request.getParameterValue("state:MyPage");
        requestc.setReturnValue("ENCODED");

        request.getParameterValue("state:OtherPage");
        requestc.setReturnValue("ENCODED");

        encoding.setParameterValue("state:MyPage", "ENCODED");

        replayControls();

        ClientPropertyPersistenceStrategy strategy = new ClientPropertyPersistenceStrategy();
        strategy.setRequest(request);
View Full Code Here

    {
        MockControl requestc = newControl(WebRequest.class);
        WebRequest request = (WebRequest) requestc.getMock();

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

        request.getParameterNames();
        requestc.setReturnValue(Arrays.asList(new Object[]
        { "foo", "state:MyPage" }));

        request.getParameterValue("state:MyPage");
        requestc.setReturnValue("ENCODED");

        encoding.setParameterValue("state:MyPage", "ENCODED");

        replayControls();

        ClientPropertyPersistenceStrategy strategy = new ClientPropertyPersistenceStrategy();
        strategy.setRequest(request);
View Full Code Here

    {
        finalizeParameters(service, parameters);
       
        IEngine engine = _requestCycle.getEngine();
       
        ServiceEncoding serviceEncoding = createServiceEncoding(parameters);
       
        // Give persistent property strategies a chance to store extra data
        // into the link.
       
        if (stateful)
            _persistenceStrategySource.addParametersForPersistentProperties(serviceEncoding, post);
       
        String fullServletPath = _contextPath + serviceEncoding.getServletPath();
       
        return new EngineServiceLink(_requestCycle, fullServletPath, engine.getOutputEncoding(),
                _codec, _request, parameters, stateful);
    }
View Full Code Here

@Test
public class AssetEncoderTest extends TestBase
{
    public void test_Wrong_Service()
    {
        ServiceEncoding encoding = newEncoding();

        trainGetParameterValue(encoding, ServiceConstants.SERVICE, "foo");

        replay();
View Full Code Here

        return newMock(ServiceEncoding.class);
    }

    public void test_Wrong_Path()
    {
        ServiceEncoding encoding = newEncoding();

        trainGetServletPath(encoding, "/Home.page");

        replay();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.engine.ServiceEncoding

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.