public void testUnselectAll() throws Exception { ActionHelper sah = new ActionHelper(); sah.setUpAction(action); sah.setupClampListBounds(); ActionForward forward = sah.executeAction("unselectall"); verifyRhnSetData(sah.getUser().getId(), action.getSetDecl().getLabel(), 0); verifyParam(forward.getPath(), "setupdated", "true"); }
public void testFilter() throws Exception { ActionHelper sah = new ActionHelper(); sah.setUpAction(action); sah.getRequest().setupAddParameter(RequestContext.FILTER_STRING, "zzzz"); sah.setupClampListBounds(); ActionForward forward = sah.executeAction("filter"); verifyParam(forward.getPath(), RequestContext.FILTER_STRING, "zzzz"); }
public void testUnspecified() throws Exception { ActionHelper sah = new ActionHelper(); sah.setUpAction(action); sah.setupClampListBounds(); sah.getRequest().setupAddParameter("items_selected", new String[] {"10", "20", "30"}); sah.getRequest().setupAddParameter("newset", (String) null); sah.getRequest().setupAddParameter("items_on_page", (String) null); ActionForward forward = sah.executeAction("unspecified"); verifyParam(forward.getPath(), "newset", "[10, 20, 30]"); }
public void testUpdateList() throws Exception { // TestAction action = new TestAction(); ActionHelper sah = new ActionHelper(); sah.setUpAction(action); sah.setupClampListBounds(); sah.getRequest().setRequestURL("foo"); sah.getRequest().setupAddParameter("items_selected", new String[] {"10", "20", "30"}); sah.getRequest().setupAddParameter("newset", (String) null); sah.getRequest().setupAddParameter("items_on_page", (String) null); ActionForward forward = sah.executeAction("updatelist"); // let's go find the data verifyRhnSetData(sah.getUser().getId(), action.getSetDecl().getLabel(), 3); verifyParam(forward.getPath(), "setupdated", "true"); }
public void testSelectAll() throws Exception { ActionHelper sah = new ActionHelper(); TestActionWithData a = new TestActionWithData() { protected DataResult getDataResult( User user, ActionForm formIn, HttpServletRequest request) { List retval = new LinkedList(); for (int i = 0; i < 10; i++) { retval.add(new TestIdObject(new Long(i))); } return new DataResult(retval); } }; sah.setUpAction(a); sah.setupClampListBounds(); ActionForward forward = sah.executeAction("selectall"); verifyRhnSetData(sah.getUser().getId(), a.getSetDecl().getLabel(), 10); verifyParam(forward.getPath(), "setupdated", "true"); }