@@ -0,0 +1,1914 @@
+package org.intermine.web;%0A%0A/*%0A * Copyright (C) 2002-2005 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.io.InputStream;%0Aimport java.io.InputStreamReader;%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.HashSet;%0A%0Aimport java.util.Map;%0Aimport java.util.HashMap;%0Aimport org.intermine.objectstore.ObjectStoreSummary;%0Aimport org.intermine.objectstore.query.ConstraintOp;%0A%0Aimport org.intermine.web.DisplayConstraint;%0A%0Aimport org.intermine.metadata.Model;%0Aimport org.intermine.objectstore.ObjectStore;%0Aimport org.intermine.objectstore.ObjectStoreException;%0A%0Aimport servletunit.struts.MockStrutsTestCase;%0A%0Apublic class DisplayConstraintTest extends MockStrutsTestCase%0A%7B%0A    DisplayConstraint dc;%0A    %0A    public DisplayConstraintTest(String arg) %7B%0A        super(arg);%0A    %7D%0A    %0A    public void setUp() throws Exception %7B%0A        super.setUp();%0A        %0A        PathQuery query = new PathQuery(Model.getInstanceByName(%22testmodel%22));%0A        PathNode node = query.addNode(%22Employee.name%22);%0A        %0A        dc = new DisplayConstraint(node, Model.getInstanceByName(%22testmodel%22),%0A                (ObjectStoreSummary) getActionServlet().getServletContext().getAttribute(Constants.OBJECT_STORE_SUMMARY));%0A    %7D%0A    %0A    public void testValidOps() throws Exception %7B        %0A        assertEquals(8, dc.getValidOps().size());%0A    %7D%0A    %0A    public void testOptionsList() throws Exception %7B%0A        assertEquals(6, dc.getOptionsList().size());%0A    %7D%0A    %0A    public void testFixedOpsIndeces() throws Exception %7B%0A        assertEquals(new HashSet(Arrays.asList(new Object%5B%5D%7Bnew Integer(0), new Integer(1)%7D)),%0A                     new HashSet(dc.getFixedOpIndices()));%0A    %7D%0A%7D%0A

Test for DisplayConstraint.