public void testTagSecondPage() throws Exception { tag.setPage(1); tag.doStartTag(); tag.doEndTag(); String result = writer.toString(); assertTrue("page.size=10: " + result, result.contains("page.size=10")); assertTrue("page.page=0: " + result, result.contains("page.page=0")); assertFalse("page.page=1: " + result, result.contains("page.page=1")); assertTrue("page.page=2: " + result, result.contains("page.page=2")); assertTrue("page.page=3: " + result, result.contains("page.page=3")); }
@Override protected void setUp() throws Exception { tag = new PagerTag(); super.setUp(tag); tag.setCount(50); tag.setLimit(10); tag.setLimitParam("page.size"); tag.setLink("http://www.example.com/"); tag.setMaxLinks(3); tag.setNextContent(">"); tag.setPrevContent("<"); tag.setPage(0); tag.setPageParam("page.page"); }