Package org.apache.tapestry.engine

Examples of org.apache.tapestry.engine.ServiceEncoding


    }
   
    public void testDecode()
    {
        MockControl c = newControl(ServiceEncoding.class);
        ServiceEncoding sec = (ServiceEncoding) c.getMock();

        sec.getServletPath();
        c.setReturnValue("/hitter.svc");

        sec.setParameterValue(ServiceConstants.SERVICE, "hitter");
       
        replayControls();

        ServiceExtensionEncoder e = new ServiceExtensionEncoder();
        e.setExtension("svc");
View Full Code Here


public class TestPageServiceEncoder extends HiveMindTestCase
{
    public void testEncodeOtherService()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding e = (ServiceEncoding) control.getMock();

        e.getParameterValue(ServiceConstants.SERVICE);
        control.setReturnValue("foo");

        replayControls();

        PageServiceEncoder encoder = new PageServiceEncoder();
View Full Code Here

    }

    public void testEncode()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding e = (ServiceEncoding) control.getMock();

        e.getParameterValue(ServiceConstants.SERVICE);
        control.setReturnValue("page");

        e.getParameterValue(ServiceConstants.PAGE);
        control.setReturnValue("Home");

        e.setServletPath("/Home.html");
        e.setParameterValue(ServiceConstants.SERVICE, null);
        e.setParameterValue(ServiceConstants.PAGE, null);

        replayControls();

        PageServiceEncoder encoder = new PageServiceEncoder();
        encoder.setServiceName("page");
View Full Code Here

    }

    public void testEncodeInNamespace()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding e = (ServiceEncoding) control.getMock();

        e.getParameterValue(ServiceConstants.SERVICE);
        control.setReturnValue("page");

        e.getParameterValue(ServiceConstants.PAGE);
        control.setReturnValue("contrib:Foo");

        replayControls();

        PageServiceEncoder encoder = new PageServiceEncoder();
View Full Code Here

    }

    public void testDecodeNoExtension()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding e = (ServiceEncoding) control.getMock();

        e.getServletPath();
        control.setReturnValue("/app");

        replayControls();

        PageServiceEncoder encoder = new PageServiceEncoder();
View Full Code Here

    }

    public void testDecodeEndsWithDot()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding e = (ServiceEncoding) control.getMock();

        e.getServletPath();
        control.setReturnValue("/ends.with.dot.");

        replayControls();

        PageServiceEncoder encoder = new PageServiceEncoder();
View Full Code Here

    }

    public void testDecodeWrongExtension()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding e = (ServiceEncoding) control.getMock();

        e.getServletPath();
        control.setReturnValue("/Home.direct");

        replayControls();

        PageServiceEncoder encoder = new PageServiceEncoder();
View Full Code Here

    }

    public void testDecodeSuccess()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding e = (ServiceEncoding) control.getMock();

        e.getServletPath();
        control.setReturnValue("/Home.html");

        e.setParameterValue(ServiceConstants.SERVICE, "page");
        e.setParameterValue(ServiceConstants.PAGE, "Home");

        replayControls();

        PageServiceEncoder encoder = new PageServiceEncoder();
        encoder.setExtension("html");
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

        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

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.