@@ -0,0 +1,2342 @@
+package org.flymine.objectstore.query.presentation;%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 junit.framework.TestCase;%0A%0Aimport org.flymine.model.testmodel.*;%0Aimport org.flymine.objectstore.query.ClassConstraint;%0Aimport org.flymine.objectstore.query.Constraint;%0Aimport org.flymine.objectstore.query.ConstraintSet;%0Aimport org.flymine.objectstore.query.ContainsConstraint;%0Aimport org.flymine.objectstore.query.FromElement;%0Aimport org.flymine.objectstore.query.QueryClass;%0Aimport org.flymine.objectstore.query.QueryCollectionReference;%0Aimport org.flymine.objectstore.query.QueryExpression;%0Aimport org.flymine.objectstore.query.QueryField;%0Aimport org.flymine.objectstore.query.QueryValue;%0Aimport org.flymine.objectstore.query.SimpleConstraint;%0Aimport org.flymine.objectstore.query.SubqueryConstraint;%0Aimport org.flymine.objectstore.query.Query;%0Aimport org.flymine.objectstore.query.fql.FqlQuery;%0A%0Apublic class PrintableConstraintTest extends TestCase%0A%7B%0A    private PrintableConstraint pc1, pc2, pc3, pc4;%0A%0A    public PrintableConstraintTest(String arg) %7B%0A        super(arg);%0A    %7D%0A%0A    public void setUp() throws Exception %7B%0A        Query q1 = new Query();%0A        Query q2 = new Query();%0A        ConstraintSet cs1 = new ConstraintSet(ConstraintSet.AND);%0A        ConstraintSet cs2 = new ConstraintSet(ConstraintSet.OR);%0A%0A        pc1 = new PrintableConstraint(q1, cs1);%0A        pc2 = new PrintableConstraint(q1, cs1);%0A        pc3 = new PrintableConstraint(q2, cs1);%0A        pc4 = new PrintableConstraint(q2, cs2);%0A    %7D%0A%0A    public void testEquals() %7B%0A        assertEquals(pc1, pc1);%0A        assertEquals(pc1, pc2);%0A        assertFalse(pc1.equals(pc3));%0A        assertFalse(pc1.equals(pc4));%0A        assertFalse(pc3.equals(pc4));%0A    %7D%0A%0A    public void testHashCode() %7B%0A        assertEquals(pc1.hashCode(), pc1.hashCode());%0A        assertEquals(pc1.hashCode(), pc2.hashCode());%0A        // Not testing this%0A        //assertFalse(pc1.hashCode() == pc3.hashCode());%0A        assertFalse(pc1.hashCode() == pc4.hashCode());%0A        assertFalse(pc3.hashCode() == pc4.hashCode());%0A    %7D%0A%0A%0A%7D%0A

Test for PrintableConstraint