From: David G. <mu...@us...> - 2006-01-26 15:46:11
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/annotations/junit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23882/source/org/jfree/chart/annotations/junit Modified Files: XYTextAnnotationTests.java Log Message: 2006-01-26 David Gilbert <dav...@ob...> * org/jfree/chart/annotations/XYTextAnnotation.java (equals): Check x and y location. Index: XYTextAnnotationTests.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/annotations/junit/XYTextAnnotationTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XYTextAnnotationTests.java 28 Feb 2005 16:07:39 -0000 1.3 --- XYTextAnnotationTests.java 26 Jan 2006 15:46:02 -0000 1.4 *************** *** 3,7 **** * =========================================================== * ! * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html --- 3,7 ---- * =========================================================== * ! * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html *************** *** 17,23 **** * License for more details. * ! * You should have received a copy of the GNU Lesser General Public License ! * along with this library; if not, write to the Free Software Foundation, ! * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. --- 17,24 ---- * License for more details. * ! * You should have received a copy of the GNU Lesser General Public ! * License along with this library; if not, write to the Free Software ! * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, ! * USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. *************** *** 27,31 **** * XYTextAnnotationTests.java * -------------------------- ! * (C) Copyright 2003-2005, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); --- 28,32 ---- * XYTextAnnotationTests.java * -------------------------- ! * (C) Copyright 2003-2006, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); *************** *** 38,41 **** --- 39,43 ---- * 19-Aug-2003 : Version 1 (DG); * 07-Jan-2005 : Added hashCode() test (DG); + * 26-Jan-2006 : Extended equals() test (DG); * */ *************** *** 97,100 **** --- 99,114 ---- assertTrue(a1.equals(a2)); + // x + a1 = new XYTextAnnotation("ABC", 11.0, 20.0); + assertFalse(a1.equals(a2)); + a2 = new XYTextAnnotation("ABC", 11.0, 20.0); + assertTrue(a1.equals(a2)); + + // y + a1 = new XYTextAnnotation("ABC", 11.0, 22.0); + assertFalse(a1.equals(a2)); + a2 = new XYTextAnnotation("ABC", 11.0, 22.0); + assertTrue(a1.equals(a2)); + // font a1.setFont(new Font("Serif", Font.PLAIN, 23)); *************** *** 104,113 **** // paint ! GradientPaint gp1 = new GradientPaint( ! 1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow ! ); ! GradientPaint gp2 = new GradientPaint( ! 1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow ! ); a1.setPaint(gp1); assertFalse(a1.equals(a2)); --- 118,125 ---- // paint ! GradientPaint gp1 = new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, ! 4.0f, Color.yellow); ! GradientPaint gp2 = new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, ! 4.0f, Color.yellow); a1.setPaint(gp1); assertFalse(a1.equals(a2)); *************** *** 177,183 **** out.close(); ! ObjectInput in = new ObjectInputStream( ! new ByteArrayInputStream(buffer.toByteArray()) ! ); a2 = (XYTextAnnotation) in.readObject(); in.close(); --- 189,194 ---- out.close(); ! ObjectInput in = new ObjectInputStream(new ByteArrayInputStream( ! buffer.toByteArray())); a2 = (XYTextAnnotation) in.readObject(); in.close(); |