@@ -0,0 +1,2235 @@
+package org.intermine.web.struts;%0A%0A/*%0A * Copyright (C) 2002-2007 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 java.util.ArrayList;%0Aimport java.util.HashMap;%0A%0Aimport org.intermine.metadata.Model;%0Aimport org.intermine.path.Path;%0Aimport org.intermine.web.logic.Constants;%0Aimport org.intermine.web.logic.profile.Profile;%0Aimport org.intermine.web.logic.query.MainHelper;%0Aimport org.intermine.web.logic.query.PathQuery;%0A%0Aimport servletunit.struts.MockStrutsTestCase;%0A%0A/**%0A * Tests for SortOrderChange.%0A *%0A * @author Julie Sullivan%0A */%0A%0Apublic class SortOrderChangeTest extends MockStrutsTestCase%0A%7B%0A    public SortOrderChangeTest (String arg) %7B%0A        super(arg);%0A    %7D%0A%0A    public void tearDown() throws Exception %7B%0A         getActionServlet().destroy();%0A    %7D%0A%0A    public void testRemove() throws Exception %7B%0A        Model model = Model.getInstanceByName(%22testmodel%22);%0A        PathQuery query = new PathQuery(model);%0A        query.getView().add(MainHelper.makePath(model, query, %22Employee.name%22));%0A        query.getView().add(MainHelper.makePath(model, query, %22Employee.age%22));%0A        getSession().setAttribute(Constants.QUERY, query);%0A%0A        addRequestParameter(%22path%22, %22Employee.age%22);%0A        addRequestParameter(%22method%22, %22addToSortOrder%22);%0A%0A        //necessary to work-round struts test case not invoking our SessionListener%0A        getSession().setAttribute(Constants.PROFILE,%0A                                  new Profile(null, null, null, null,%0A                                              new HashMap(), new HashMap(), new HashMap()));%0A%0A        setRequestPathInfo(%22/sortOrderChange%22);%0A%0A        actionPerform();%0A        verifyNoActionErrors();%0A        //verifyForward(%22query%22);%0A%0A        ArrayList%3CPath%3E expected = new ArrayList%3CPath%3E();%0A        expected.add(MainHelper.makePath(model, query, %22Employee.age%22));%0A        expected.add(MainHelper.makePath(model, query, %22Employee.name%22));%0A        assertEquals(expected, ((PathQuery) getSession().getAttribute(Constants.QUERY)).getSortOrder());%0A    %7D%0A%7D%0A

Test for new controller.