Package org.apache.tapestry.util

Examples of org.apache.tapestry.util.QueryParameterMap


    }

    public void testGetParameterNames()
    {
        PortletURL url = newPortletURL();
        QueryParameterMap parameters = org.easymock.classextension.EasyMock.createMock(QueryParameterMap.class);

        String[] names = { "Fred", "Barney" };

        expect(parameters.getParameterNames()).andReturn(names);
       
        replay();
        org.easymock.classextension.EasyMock.replay(parameters);

        ILink link = new PortletLink(url, parameters);
View Full Code Here


   
    public void testGetParameterValues()
    {
        PortletURL url = newPortletURL();
       
        QueryParameterMap parameters = org.easymock.classextension.EasyMock.createMock(QueryParameterMap.class);

        String[] values = { "Fred", "Barney" };

        expect(parameters.getParameterValues("bedrock")).andReturn(values);
       
        replay();
        org.easymock.classextension.EasyMock.replay(parameters);

        ILink link = new PortletLink(url, parameters);
View Full Code Here

    public void testGetURL()
    {
        PortletURL url = newPortletURL();

        QueryParameterMap parameters = org.easymock.classextension.EasyMock.createMock(QueryParameterMap.class);

        expect(parameters.getParameterNames()).andReturn(new String[0]);
       
        replay();
        org.easymock.classextension.EasyMock.replay(parameters);

        ILink link = new PortletLink(url, parameters);
View Full Code Here

    public void testGetURLLongForm()
    {
        PortletURL url = newPortletURL();

        QueryParameterMap parameters = org.easymock.classextension.EasyMock.createMock(QueryParameterMap.class);

        expect(parameters.getParameterNames()).andReturn(new String[] {"page"});
       
        String[] values = new String[] { "View" };
       
        expect(parameters.getParameterValues("page")).andReturn(values);
       
        url.setParameter("page", values);
       
        replay();
        org.easymock.classextension.EasyMock.replay(parameters);
View Full Code Here

    public void testGetURLUnencoding()
    {
        PortletURL url = new PortletURLFixture("this=foo&that=bar");

        QueryParameterMap parameters = org.easymock.classextension.EasyMock.createMock(QueryParameterMap.class);

        expect(parameters.getParameterNames()).andReturn(new String[0]);
       
        replay();
        org.easymock.classextension.EasyMock.replay(parameters);

        ILink link = new PortletLink(url, parameters);
View Full Code Here

    public void testGetURLIncludeParameters()
    {
        PortletURL url = newPortletURL();
       
        QueryParameterMap parameters = org.easymock.classextension.EasyMock.createMock(QueryParameterMap.class);
       
        String[] values = { "Fred", "Barney" };
       
        expect(parameters.getParameterNames()).andReturn(new String[]{"bedrock"});
       
        expect(parameters.getParameterValues("bedrock")).andReturn(values);
       
        url.setParameter("bedrock", values);

        replay();
        org.easymock.classextension.EasyMock.replay(parameters);
View Full Code Here

    public void testGetURLWithAnchor()
    {
        PortletURL url = newPortletURL();

        QueryParameterMap parameters = org.easymock.classextension.EasyMock.createMock(QueryParameterMap.class);

        replay();
        org.easymock.classextension.EasyMock.replay(parameters);

        ILink link = new PortletLink(url, parameters);
View Full Code Here

    public IRequestCycle newRequestCycle(IEngine engine)
    {
        WebRequest request = _infrastructure.getRequest();

        QueryParameterMap parameters = extractParameters(request);

        decodeParameters(request.getActivationPath(), request.getPathInfo(), parameters);

        String serviceName = findService(parameters);
View Full Code Here

       
        IEngine engine = newEngine();
       
        replay();
       
        IRequestCycle cycle = new RequestCycle(engine, new QueryParameterMap(), "fred", env);

        assertSame(infrastructure, cycle.getInfrastructure());
        assertSame(service, cycle.getService());
        assertSame(engine, cycle.getEngine());
View Full Code Here

     * file upload parameters!).
     */

    private QueryParameterMap extractParameters(WebRequest request)
    {
        QueryParameterMap result = new QueryParameterMap();

        Iterator i = request.getParameterNames().iterator();

        while (i.hasNext())
        {
            String name = (String) i.next();

            String[] values = request.getParameterValues(name);

            if (values.length == 1)
                result.setParameterValue(name, values[0]);
            else
                result.setParameterValues(name, values);
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.util.QueryParameterMap

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.