Package org.apache.tapestry.engine

Examples of org.apache.tapestry.engine.ServiceEncoding


        verify();
    }
   
    public void testDecodeHtmSuccess()
    {
        ServiceEncoding e = newMock(ServiceEncoding.class);

        expect(e.getServletPath()).andReturn("/Home.htm");

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

        replay();

        PageServiceEncoder encoder = new PageServiceEncoder();
        encoder.setExtension("htm");
View Full Code Here


    }

    public void testAddParameters()
    {
        PropertyPersistenceStrategy strategy = newStrategy();
        ServiceEncoding encoding = newEncoding();

        strategy.addParametersForPersistentProperties(encoding, false);

        replayControls();
View Full Code Here

    public void testAddParametersForPersistentProperties()
    {
        WebRequest request = newRequest();

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

        trainGetParameterNames(request, new String[]
        { "bar", "appstate:MyPage" });

        trainGetParameterValue(request, "appstate:MyPage", "ENCODED");

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

        replayControls();

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

    {
        WebRequest request = newRequest();
        IRequestCycle cycle = newCycle();
        IPage page = newPage();

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

        trainGetPage(cycle, page);

        trainGetPageName(page, "MyPage");

        trainGetPage(cycle, page);
        trainGetPageName(page, "MyPage");

        trainGetParameterNames(request, new String[]
        { "foo", "state:MyPage", "state:OtherPage" });

        trainGetParameterValue(request, "state:MyPage", "ENCODED1");
        trainGetParameterValue(request, "state:OtherPage", "ENCODED2");

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

        replayControls();

        PageClientPropertyPersistenceScope scope = new PageClientPropertyPersistenceScope();
        scope.setRequestCycle(cycle);
View Full Code Here

        return session;
    }

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

        replayControls();

        SessionPropertyPersistenceStrategy strategy = new SessionPropertyPersistenceStrategy();
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

    }

    public void testAddParameters()
    {
        PropertyPersistenceStrategy strategy = newStrategy();
        ServiceEncoding encoding = newEncoding();

        strategy.addParametersForPersistentProperties(encoding, false);

        replay();
View Full Code Here

    public void testAddParametersForPersistentProperties()
    {
        WebRequest request = newRequest();

        ServiceEncoding encoding = newMock(ServiceEncoding.class);

        trainGetParameterNames(request, new String[]
        { "bar", "appstate:MyPage" });

        trainGetParameterValue(request, "appstate:MyPage", "ENCODED");

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

        replay();

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

    {
        WebRequest request = newRequest();
        IRequestCycle cycle = newCycle();
        IPage page = newPage();

        ServiceEncoding encoding = newMock(ServiceEncoding.class);
       
        trainGetParameterNames(request, new String[] { "foo", "state:MyPage", "state:OtherPage" });
       
        trainGetParameterValue(request, "state:MyPage", "ENCODED1");
        trainGetParameterValue(request, "state:OtherPage", "ENCODED2");
      
        trainGetPage(cycle, page);
        trainGetPageName(page, "MyPage");
       
        encoding.setParameterValue("state:MyPage", "ENCODED1");

        trainGetPage(cycle, page);
        trainGetPageName(page, "MyPage");

View Full Code Here

        return session;
    }

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

        replay();

        SessionPropertyPersistenceStrategy strategy = new SessionPropertyPersistenceStrategy();
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.