Package name.pehl.taoki.paging.parser

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

package name.pehl.taoki.paging.parser;

import static org.junit.Assert.*;
import name.pehl.taoki.paging.PageInfo;

import org.junit.Test;

/**
* @author $Author: harald.pehl $
* @version $Date: 2012-03-02 08:50:20 -0600 (Fri, 02 Mar 2012) $ $Revision: 145
*          $
*/
public abstract class AbstractPageInfoParserTest
{
    protected static final String FOO = "foo";
    protected static final String PAGE_INFO_PARSE_EXCEPTION_EXPECTED = PageInfoParseException.class.getSimpleName()
            + " erwartet!";

    protected PageInfoParser underTest;


    @Test
    public void parseNull() throws PageInfoParseException
    {
        PageInfo pageInfo = underTest.parse(null);
        assertNull(pageInfo);
    }


    @Test(expected = PageInfoParseException.class)
    public void parseWrongInput() throws PageInfoParseException
    {
        underTest.parse(new Object());
    }


    protected void assertPageInfo(PageInfo pageInfo, int offset, int pageSize)
    {
        assertNotNull(pageInfo);
        assertEquals(offset, pageInfo.getOffset());
        assertEquals(pageSize, pageInfo.getPageSize());
    }
}
TOP

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

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.