@@ -0,0 +1,2389 @@
+package org.flymine.web.results;%0A%0A/*%0A * Copyright (C) 2002-2003 FlyMine%0A *%0A * This code may be freely distributed and modified under the%0A * terms of the GNU Lesser General Public Licence.  This should%0A * be distributed with the code.  See the LICENSE file for more%0A * information or http://www.gnu.org/copyleft/lesser.html.%0A *%0A */%0A%0Aimport servletunit.struts.MockStrutsTestCase;%0Aimport org.apache.struts.tiles.ComponentContext;%0A%0Aimport org.flymine.objectstore.ObjectStore;%0Aimport org.flymine.objectstore.ObjectStoreFactory;%0Aimport org.flymine.objectstore.dummy.ObjectStoreDummyImpl;%0Aimport org.flymine.objectstore.query.Query;%0Aimport org.flymine.objectstore.query.fql.FqlQuery;%0Aimport org.flymine.objectstore.query.Results;%0A%0Apublic class ChangeResultsSizeActionTest extends MockStrutsTestCase%0A%7B%0A    public ChangeResultsSizeActionTest(String arg1) %7B%0A        super(arg1);%0A    %7D%0A%0A    private Results results;%0A    private DisplayableResults dr;%0A%0A    public void setUp() throws Exception %7B%0A        super.setUp();%0A        ObjectStoreDummyImpl os = new ObjectStoreDummyImpl();%0A        os.setResultsSize(15);%0A        FqlQuery fq = new FqlQuery(%22select c, d from Company as c, Department as d%22, %22org.flymine.model.testmodel%22);%0A        results = os.execute(fq.toQuery());%0A        dr = new DisplayableResults(results);%0A        dr.setPageSize(5);%0A    %7D%0A%0A%0A    public void testChangePageSize1() throws Exception %7B%0A        setRequestPathInfo(%22/changeResultsSize%22);%0A        addRequestParameter(%22pageSize%22,%2225%22);%0A        addRequestParameter(%22action%22, %22Change%22);%0A%0A        getSession().setAttribute(%22results%22, results);%0A        getSession().setAttribute(%22resultsTable%22, dr);%0A%0A        dr.setStart(0);%0A        actionPerform();%0A%0A        verifyForward(%22results%22);%0A        verifyNoActionErrors();%0A        assertEquals(0, dr.getStart());%0A        assertEquals(25, dr.getPageSize());%0A    %7D%0A%0A    public void testChangePageSize2() throws Exception %7B%0A        setRequestPathInfo(%22/changeResultsSize%22);%0A        addRequestParameter(%22pageSize%22,%2210%22);%0A        addRequestParameter(%22action%22, %22Change%22);%0A%0A        getSession().setAttribute(%22results%22, results);%0A        getSession().setAttribute(%22resultsTable%22, dr);%0A%0A        dr.setStart(12);%0A        actionPerform();%0A%0A        verifyForward(%22results%22);%0A        verifyNoActionErrors();%0A        assertEquals(10, dr.getStart());%0A        assertEquals(10, dr.getPageSize());%0A    %7D%0A%0A%0A%7D%0A

Test class for ChangeResultsSizeAction