Package org.apache.tapestry.engine

Examples of org.apache.tapestry.engine.ServiceEncoding


    }

    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

public class TestAssetEncoder extends HiveMindTestCase
{
    public void testWrongService()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding encoding = (ServiceEncoding) control.getMock();

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

        replayControls();

        new AssetEncoder().encode(encoding);
View Full Code Here

    }

    public void testWrongPath()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding encoding = (ServiceEncoding) control.getMock();

        encoding.getServletPath();
        control.setReturnValue("/Home.page");

        replayControls();

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

    }

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

        encoding.getParameterValue(ServiceConstants.SERVICE);
        control.setReturnValue(Tapestry.ASSET_SERVICE);

        encoding.getParameterValue(AssetService.PATH);
        control.setReturnValue("/foo/bar/Baz.gif");

        encoding.getParameterValue(AssetService.DIGEST);
        control.setReturnValue("12345");

        encoding.setServletPath("/assets/12345/foo/bar/Baz.gif");
        encoding.setParameterValue(AssetService.PATH, null);
        encoding.setParameterValue(AssetService.DIGEST, null);
        encoding.setParameterValue(ServiceConstants.SERVICE, null);
       
        replayControls();

        AssetEncoder encoder = new AssetEncoder();
        encoder.setPath("/assets/");
View Full Code Here

    }

    public void testDecode()
    {
        MockControl control = newControl(ServiceEncoding.class);
        ServiceEncoding encoding = (ServiceEncoding) control.getMock();

        encoding.getServletPath();
        control.setReturnValue("/assets/12345/foo/bar/Baz.gif");

        encoding.setParameterValue(ServiceConstants.SERVICE, Tapestry.ASSET_SERVICE);
        encoding.setParameterValue(AssetService.DIGEST, "12345");
        encoding.setParameterValue(AssetService.PATH, "/foo/bar/Baz.gif");
       
        replayControls();

        AssetEncoder encoder = new AssetEncoder();
        encoder.setPath("/assets/");
View Full Code Here

        squeezeServiceParameters(parameters);

        IEngine engine = cycle.getEngine();

        ServiceEncoding serviceEncoding = createServiceEncoding(parameters);

        String fullServletPath = _contextPath + serviceEncoding.getServletPath();

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

public class TestServiceExtensionEncoder extends HiveMindTestCase
{
    public void testEncode()
    {
        MockControl c = newControl(ServiceEncoding.class);
        ServiceEncoding sec = (ServiceEncoding) c.getMock();

        sec.getParameterValue(ServiceConstants.SERVICE);
        c.setReturnValue("heavy");

        sec.setServletPath("/heavy.svc");
        sec.setParameterValue(ServiceConstants.SERVICE, null);

        replayControls();

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

    }

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

        sec.getServletPath();
        c.setReturnValue("/foo/bar/baz.direct");

        replayControls();

        ServiceExtensionEncoder e = new ServiceExtensionEncoder();
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.