Package de.arago.portlet.util

Examples of de.arago.portlet.util.Paginator.slice()


        assertEquals(1, pager.firstPage());
        assertEquals(5, pager.lastPage());

        pager.go(1);
        assertEquals(1, pager.getCurrentPage());
        assertEquals(page1, pager.slice(items));

        pager.go(2);
        assertEquals(2, pager.getCurrentPage());
        assertEquals(page2, pager.slice(items));
View Full Code Here


        assertEquals(1, pager.getCurrentPage());
        assertEquals(page1, pager.slice(items));

        pager.go(2);
        assertEquals(2, pager.getCurrentPage());
        assertEquals(page2, pager.slice(items));

        pager.go(3);
        assertEquals(3, pager.getCurrentPage());
        assertEquals(page3, pager.slice(items));
View Full Code Here

        assertEquals(2, pager.getCurrentPage());
        assertEquals(page2, pager.slice(items));

        pager.go(3);
        assertEquals(3, pager.getCurrentPage());
        assertEquals(page3, pager.slice(items));

        pager.go(4);
        assertEquals(4, pager.getCurrentPage());
        assertEquals(page4, pager.slice(items));
View Full Code Here

        assertEquals(3, pager.getCurrentPage());
        assertEquals(page3, pager.slice(items));

        pager.go(4);
        assertEquals(4, pager.getCurrentPage());
        assertEquals(page4, pager.slice(items));

        pager.go(5);
        assertEquals(5, pager.getCurrentPage());
        assertEquals(page5, pager.slice(items));
View Full Code Here

        assertEquals(4, pager.getCurrentPage());
        assertEquals(page4, pager.slice(items));

        pager.go(5);
        assertEquals(5, pager.getCurrentPage());
        assertEquals(page5, pager.slice(items));

        // pager may not overrun boundaries
        pager.go(6);
        assertEquals(5, pager.getCurrentPage());
        assertEquals(page5, pager.slice(items));
View Full Code Here

        assertEquals(page5, pager.slice(items));

        // pager may not overrun boundaries
        pager.go(6);
        assertEquals(5, pager.getCurrentPage());
        assertEquals(page5, pager.slice(items));

    }


    public void testSmallerThanItemsPerPage() {
View Full Code Here

        Paginator pager = new Paginator(items.size(), 20);

        assertEquals(1, pager.firstPage());
        assertEquals(1, pager.lastPage());

        assertEquals(items, pager.slice(items));

    }


    public void testEven() {
View Full Code Here

        pager.go(2);
        assertEquals(1, pager.firstPage());
        assertEquals(1, pager.lastPage());

        assertEquals(items, pager.slice(items));

    }

    public void testNullList() {
        Paginator pager = new Paginator(4, 4);
View Full Code Here

        pager.go(2);
        assertEquals(1, pager.firstPage());
        assertEquals(1, pager.lastPage());

        assertEquals(Collections.EMPTY_LIST, pager.slice(null));

    }

    public void testSmaller() {
        List<Object> items = Arrays.asList(new Object[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14});
View Full Code Here

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.