@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"); }
public void testTagCurrentUrl() throws Exception { request.setQueryString(null); request.setServerName("www.example.com"); request.setContextPath(""); request.setServletPath("/page"); request.setPathInfo(null); tag.setLink(null); tag.doStartTag(); tag.doEndTag(); String result = writer.toString(); assertTrue("page.size=10: " + result, result.contains("page.size=10")); assertTrue("page.page=1: " + result, result.contains("page.page=1")); assertTrue("page.page=2: " + result, result.contains("page.page=2")); }