Package name.pehl.taoki.paging.parser

Source Code of name.pehl.taoki.paging.parser.UrlPageInfoParserTest

package name.pehl.taoki.paging.parser;

import java.util.HashMap;
import java.util.Map;

import name.pehl.taoki.paging.PageInfo;

import org.junit.Before;
import org.junit.Test;

/**
* @author $Author: harald.pehl $
* @version $Date: 2012-03-02 08:50:20 -0600 (Fri, 02 Mar 2012) $ $Revision: 145
*          $
*/
public class UrlPageInfoParserTest extends AbstractPageInfoParserTest
{
    @Before
    public void setUp() throws Exception
    {
        underTest = new UrlPageInfoParser();
    }


    @Test
    public void parseValid() throws PageInfoParseException
    {
        PageInfo pageInfo = null;

        pageInfo = underTest.parse(attributesFor(0, 10));
        assertPageInfo(pageInfo, 0, 10);
    }


    private Map<String, Object> attributesFor(int offset, int pageSize)
    {
        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put(PageInfoParser.OFFSET, String.valueOf(offset));
        attributes.put(PageInfoParser.PAGE_SIZE, String.valueOf(pageSize));
        return attributes;
    }
}
TOP

Related Classes of name.pehl.taoki.paging.parser.UrlPageInfoParserTest

TOP
Copyright © 2018 www.massapi.com. 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.