From: <mu...@us...> - 2008-04-23 15:09:28
|
Revision: 873 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=873&view=rev Author: mungady Date: 2008-04-23 08:09:08 -0700 (Wed, 23 Apr 2008) Log Message: ----------- New PublicCloneable tests. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BoxAndWhiskerToolTipGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BoxAndWhiskerXYToolTipGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BubbleXYItemLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/CustomXYItemLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/HighLowItemLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/IntervalCategoryLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/MultipleXYSeriesLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategoryItemLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategorySeriesLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategoryToolTipGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardPieSectionLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardPieToolTipGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardXYItemLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardXYSeriesLabelGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardXYToolTipGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardXYZToolTipGeneratorTests.java branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/SymbolicXYItemLabelGeneratorTests.java Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BoxAndWhiskerToolTipGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BoxAndWhiskerToolTipGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BoxAndWhiskerToolTipGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * --------------------------------------- * BoxAndWhiskerToolTipGeneratorTests.java * --------------------------------------- - * (C) Copyright 2004, 2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2004-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -35,6 +35,7 @@ * Changes * ------- * 02-Jun-2004 : Version 1 (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -53,6 +54,7 @@ import junit.framework.TestSuite; import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link BoxAndWhiskerToolTipGenerator} class. @@ -81,27 +83,27 @@ * A series of tests for the equals() method. */ public void testEquals() { - + // standard test BoxAndWhiskerToolTipGenerator g1 = new BoxAndWhiskerToolTipGenerator(); BoxAndWhiskerToolTipGenerator g2 = new BoxAndWhiskerToolTipGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - + // tooltip format - g1 = new BoxAndWhiskerToolTipGenerator("{0} --> {1} {2}", + g1 = new BoxAndWhiskerToolTipGenerator("{0} --> {1} {2}", new DecimalFormat("0.0")); - g2 = new BoxAndWhiskerToolTipGenerator("{1} {2}", + g2 = new BoxAndWhiskerToolTipGenerator("{1} {2}", new DecimalFormat("0.0")); assertFalse(g1.equals(g2)); - g2 = new BoxAndWhiskerToolTipGenerator("{0} --> {1} {2}", + g2 = new BoxAndWhiskerToolTipGenerator("{0} --> {1} {2}", new DecimalFormat("0.0")); assertTrue(g1.equals(g2)); // Y format - g1 = new BoxAndWhiskerToolTipGenerator("{0} --> {1} {2}", + g1 = new BoxAndWhiskerToolTipGenerator("{0} --> {1} {2}", new DecimalFormat("0.0")); - g2 = new BoxAndWhiskerToolTipGenerator("{0} --> {1} {2}", + g2 = new BoxAndWhiskerToolTipGenerator("{0} --> {1} {2}", new DecimalFormat("0.00")); assertFalse(g1.equals(g2)); } @@ -134,6 +136,14 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + BoxAndWhiskerToolTipGenerator g1 = new BoxAndWhiskerToolTipGenerator(); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BoxAndWhiskerXYToolTipGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BoxAndWhiskerXYToolTipGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BoxAndWhiskerXYToolTipGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ----------------------------------------- * BoxAndWhiskerXYToolTipGeneratorTests.java * ----------------------------------------- - * (C) Copyright 2003-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2003-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -35,8 +35,9 @@ * Changes * ------- * 13-Aug-2003 : Version 1 (DG); - * 27-Feb-2004 : Renamed BoxAndWhiskerItemLabelGenerator + * 27-Feb-2004 : Renamed BoxAndWhiskerItemLabelGenerator * --> XYBoxAndWhiskerItemLabelGenerator (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -56,6 +57,7 @@ import junit.framework.TestSuite; import org.jfree.chart.labels.BoxAndWhiskerXYToolTipGenerator; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link BoxAndWhiskerXYToolTipGenerator} class. @@ -84,42 +86,42 @@ * A series of tests for the equals() method. */ public void testEquals() { - + // standard test - BoxAndWhiskerXYToolTipGenerator g1 + BoxAndWhiskerXYToolTipGenerator g1 = new BoxAndWhiskerXYToolTipGenerator(); - BoxAndWhiskerXYToolTipGenerator g2 + BoxAndWhiskerXYToolTipGenerator g2 = new BoxAndWhiskerXYToolTipGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - + // tooltip format - g1 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", + g1 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0.0")); - g2 = new BoxAndWhiskerXYToolTipGenerator("{1} {2}", + g2 = new BoxAndWhiskerXYToolTipGenerator("{1} {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0.0")); assertFalse(g1.equals(g2)); - g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", + g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0.0")); assertTrue(g1.equals(g2)); // date format - g1 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", + g1 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0.0")); - g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", + g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", new SimpleDateFormat("MMM-yyyy"), new DecimalFormat("0.0")); assertFalse(g1.equals(g2)); - g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", + g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0.0")); assertTrue(g1.equals(g2)); // Y format - g1 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", + g1 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0.0")); - g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", + g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0.00")); assertFalse(g1.equals(g2)); - g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", + g2 = new BoxAndWhiskerXYToolTipGenerator("{0} --> {1} {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0.0")); assertTrue(g1.equals(g2)); } @@ -128,9 +130,9 @@ * Simple check that hashCode is implemented. */ public void testHashCode() { - BoxAndWhiskerXYToolTipGenerator g1 + BoxAndWhiskerXYToolTipGenerator g1 = new BoxAndWhiskerXYToolTipGenerator(); - BoxAndWhiskerXYToolTipGenerator g2 + BoxAndWhiskerXYToolTipGenerator g2 = new BoxAndWhiskerXYToolTipGenerator(); assertTrue(g1.equals(g2)); assertTrue(g1.hashCode() == g2.hashCode()); @@ -140,7 +142,7 @@ * Confirm that cloning works. */ public void testCloning() { - BoxAndWhiskerXYToolTipGenerator g1 + BoxAndWhiskerXYToolTipGenerator g1 = new BoxAndWhiskerXYToolTipGenerator(); BoxAndWhiskerXYToolTipGenerator g2 = null; try { @@ -155,11 +157,20 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + BoxAndWhiskerXYToolTipGenerator g1 + = new BoxAndWhiskerXYToolTipGenerator(); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { - BoxAndWhiskerXYToolTipGenerator g1 + BoxAndWhiskerXYToolTipGenerator g1 = new BoxAndWhiskerXYToolTipGenerator(); BoxAndWhiskerXYToolTipGenerator g2 = null; Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BubbleXYItemLabelGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BubbleXYItemLabelGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/BubbleXYItemLabelGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ------------------------------------ * BubbleXYItemLabelGeneratorTests.java * ------------------------------------ - * (C) Copyright 2006, 2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2006-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -35,6 +35,7 @@ * Changes * ------- * 20-Jan-2006 : Version 1 (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -58,6 +59,7 @@ import org.jfree.chart.labels.BubbleXYItemLabelGenerator; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link BubbleXYItemLabelGenerator} class. @@ -86,8 +88,8 @@ * A series of tests for the equals() method. */ public void testEquals() { - - // some setup... + + // some setup... String f1 = "{1}"; String f2 = "{2}"; NumberFormat xnf1 = new DecimalFormat("0.00"); @@ -99,17 +101,17 @@ BubbleXYItemLabelGenerator g1 = null; BubbleXYItemLabelGenerator g2 = null; - + g1 = new BubbleXYItemLabelGenerator(f1, xnf1, ynf1, znf1); g2 = new BubbleXYItemLabelGenerator(f1, xnf1, ynf1, znf1); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - + g1 = new BubbleXYItemLabelGenerator(f2, xnf1, ynf1, znf1); assertFalse(g1.equals(g2)); g2 = new BubbleXYItemLabelGenerator(f2, xnf1, ynf1, znf1); assertTrue(g1.equals(g2)); - + g1 = new BubbleXYItemLabelGenerator(f2, xnf2, ynf1, znf1); assertFalse(g1.equals(g2)); g2 = new BubbleXYItemLabelGenerator(f2, xnf2, ynf1, znf1); @@ -119,7 +121,7 @@ assertFalse(g1.equals(g2)); g2 = new BubbleXYItemLabelGenerator(f2, xnf2, ynf2, znf1); assertTrue(g1.equals(g2)); - + g1 = new BubbleXYItemLabelGenerator(f2, xnf2, ynf2, znf2); assertFalse(g1.equals(g2)); g2 = new BubbleXYItemLabelGenerator(f2, xnf2, ynf2, znf2); @@ -136,12 +138,12 @@ g2 = new BubbleXYItemLabelGenerator(f1, xdf1, ydf1, zdf1); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - + g1 = new BubbleXYItemLabelGenerator(f1, xdf2, ydf1, zdf1); assertFalse(g1.equals(g2)); g2 = new BubbleXYItemLabelGenerator(f1, xdf2, ydf1, zdf1); assertTrue(g1.equals(g2)); - + g1 = new BubbleXYItemLabelGenerator(f1, xdf2, ydf2, zdf1); assertFalse(g1.equals(g2)); g2 = new BubbleXYItemLabelGenerator(f1, xdf2, ydf2, zdf1); @@ -152,14 +154,14 @@ g2 = new BubbleXYItemLabelGenerator(f1, xdf2, ydf2, zdf2); assertTrue(g1.equals(g2)); } - + /** * Simple check that hashCode is implemented. */ public void testHashCode() { - BubbleXYItemLabelGenerator g1 + BubbleXYItemLabelGenerator g1 = new BubbleXYItemLabelGenerator(); - BubbleXYItemLabelGenerator g2 + BubbleXYItemLabelGenerator g2 = new BubbleXYItemLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g1.hashCode() == g2.hashCode()); @@ -183,6 +185,14 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + BubbleXYItemLabelGenerator g1 = new BubbleXYItemLabelGenerator(); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { @@ -207,7 +217,7 @@ assertEquals(g1, g2); } - + /** * Some checks for the testGenerateLabel() method. */ Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/CustomXYItemLabelGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/CustomXYItemLabelGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/CustomXYItemLabelGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * - * ---------------------------------- - * CustomXYToolTipGeneratorTests.java - * ---------------------------------- - * (C) Copyright 2003-2007, by Object Refinery Limited and Contributors. + * ------------------------------------ + * CustomXYItemLabelGeneratorTests.java + * ------------------------------------ + * (C) Copyright 2003-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -36,6 +36,7 @@ * ------- * 23-Mar-2003 : Version 1 (DG); * 13-Aug-2003 : Added cloning tests (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -54,6 +55,7 @@ import junit.framework.TestSuite; import org.jfree.chart.labels.CustomXYToolTipGenerator; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link CustomXYToolTipGenerator} class. @@ -96,6 +98,14 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + CustomXYToolTipGenerator g1 = new CustomXYToolTipGenerator(); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/HighLowItemLabelGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/HighLowItemLabelGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/HighLowItemLabelGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ----------------------------------- * HighLowItemLabelGeneratorTests.java * ----------------------------------- - * (C) Copyright 2003-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2003-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -35,6 +35,7 @@ * Changes * ------- * 18-Mar-2003 : Version 1 (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -55,6 +56,7 @@ import junit.framework.TestSuite; import org.jfree.chart.labels.HighLowItemLabelGenerator; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link HighLowItemLabelGenerator} class. @@ -87,22 +89,22 @@ HighLowItemLabelGenerator g2 = new HighLowItemLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - - g1 = new HighLowItemLabelGenerator(new SimpleDateFormat("d-MMM-yyyy"), + + g1 = new HighLowItemLabelGenerator(new SimpleDateFormat("d-MMM-yyyy"), NumberFormat.getInstance()); assertFalse(g1.equals(g2)); - g2 = new HighLowItemLabelGenerator(new SimpleDateFormat("d-MMM-yyyy"), + g2 = new HighLowItemLabelGenerator(new SimpleDateFormat("d-MMM-yyyy"), NumberFormat.getInstance()); assertTrue(g1.equals(g2)); - - g1 = new HighLowItemLabelGenerator(new SimpleDateFormat("d-MMM-yyyy"), + + g1 = new HighLowItemLabelGenerator(new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); - g2 = new HighLowItemLabelGenerator(new SimpleDateFormat("d-MMM-yyyy"), + g2 = new HighLowItemLabelGenerator(new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); } - + /** * Simple check that hashCode is implemented. */ @@ -131,6 +133,14 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + HighLowItemLabelGenerator g1 = new HighLowItemLabelGenerator(); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/IntervalCategoryLabelGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/IntervalCategoryLabelGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/IntervalCategoryLabelGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ---------------------------------------- * IntervalCategoryLabelGeneratorTests.java * ---------------------------------------- - * (C) Copyright 2003-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2003-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -36,6 +36,7 @@ * ------- * 21-Mar-2003 : Version 1 (DG); * 13-Aug-2003 : Added cloning tests, and renamed class (DG); + * 23-Apr-2008 : Added testPublicCloneble() (DG); * */ @@ -56,6 +57,7 @@ import junit.framework.TestSuite; import org.jfree.chart.labels.IntervalCategoryItemLabelGenerator; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link IntervalCategoryItemLabelGenerator} class. @@ -84,37 +86,37 @@ * Tests the equals() method. */ public void testEquals() { - - IntervalCategoryItemLabelGenerator g1 + + IntervalCategoryItemLabelGenerator g1 = new IntervalCategoryItemLabelGenerator(); - IntervalCategoryItemLabelGenerator g2 + IntervalCategoryItemLabelGenerator g2 = new IntervalCategoryItemLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - - g1 = new IntervalCategoryItemLabelGenerator("{3} - {4}", + + g1 = new IntervalCategoryItemLabelGenerator("{3} - {4}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); - g2 = new IntervalCategoryItemLabelGenerator("{3} - {4}", + g2 = new IntervalCategoryItemLabelGenerator("{3} - {4}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); - - g1 = new IntervalCategoryItemLabelGenerator("{3} - {4}", + + g1 = new IntervalCategoryItemLabelGenerator("{3} - {4}", new SimpleDateFormat("d-MMM")); assertFalse(g1.equals(g2)); - g2 = new IntervalCategoryItemLabelGenerator("{3} - {4}", + g2 = new IntervalCategoryItemLabelGenerator("{3} - {4}", new SimpleDateFormat("d-MMM")); assertTrue(g1.equals(g2)); - + } /** * Simple check that hashCode is implemented. */ public void testHashCode() { - IntervalCategoryItemLabelGenerator g1 + IntervalCategoryItemLabelGenerator g1 = new IntervalCategoryItemLabelGenerator(); - IntervalCategoryItemLabelGenerator g2 + IntervalCategoryItemLabelGenerator g2 = new IntervalCategoryItemLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g1.hashCode() == g2.hashCode()); @@ -124,7 +126,7 @@ * Confirm that cloning works. */ public void testCloning() { - IntervalCategoryItemLabelGenerator g1 + IntervalCategoryItemLabelGenerator g1 = new IntervalCategoryItemLabelGenerator(); IntervalCategoryItemLabelGenerator g2 = null; try { @@ -139,12 +141,21 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + IntervalCategoryItemLabelGenerator g1 + = new IntervalCategoryItemLabelGenerator(); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { - IntervalCategoryItemLabelGenerator g1 - = new IntervalCategoryItemLabelGenerator("{3} - {4}", + IntervalCategoryItemLabelGenerator g1 + = new IntervalCategoryItemLabelGenerator("{3} - {4}", DateFormat.getInstance()); IntervalCategoryItemLabelGenerator g2 = null; Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/MultipleXYSeriesLabelGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/MultipleXYSeriesLabelGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/MultipleXYSeriesLabelGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ---------------------------------------- * MultipleXYSeriesLabelGeneratorTests.java * ---------------------------------------- - * (C) Copyright 2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2007, 2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -35,6 +35,7 @@ * Changes * ------- * 20-Jan-2007 : Version 1 (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -52,6 +53,7 @@ import junit.framework.TestSuite; import org.jfree.chart.labels.MultipleXYSeriesLabelGenerator; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link MultipleXYSeriesLabelGenerator} class. @@ -80,18 +82,18 @@ * A series of tests for the equals() method. */ public void testEquals() { - MultipleXYSeriesLabelGenerator g1 + MultipleXYSeriesLabelGenerator g1 = new MultipleXYSeriesLabelGenerator(); - MultipleXYSeriesLabelGenerator g2 + MultipleXYSeriesLabelGenerator g2 = new MultipleXYSeriesLabelGenerator(); assertTrue(g1.equals(g2)); - assertTrue(g2.equals(g1)); - + assertTrue(g2.equals(g1)); + g1 = new MultipleXYSeriesLabelGenerator("Series {0}"); assertFalse(g1.equals(g2)); g2 = new MultipleXYSeriesLabelGenerator("Series {0}"); assertTrue(g1.equals(g2)); - + g1.addSeriesLabel(1, "Additional 1"); assertFalse(g1.equals(g2)); g2.addSeriesLabel(1, "Additional 1"); @@ -102,9 +104,9 @@ * Simple check that hashCode is implemented. */ public void testHashCode() { - MultipleXYSeriesLabelGenerator g1 + MultipleXYSeriesLabelGenerator g1 = new MultipleXYSeriesLabelGenerator(); - MultipleXYSeriesLabelGenerator g2 + MultipleXYSeriesLabelGenerator g2 = new MultipleXYSeriesLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g1.hashCode() == g2.hashCode()); @@ -114,7 +116,7 @@ * Confirm that cloning works. */ public void testCloning() { - MultipleXYSeriesLabelGenerator g1 + MultipleXYSeriesLabelGenerator g1 = new MultipleXYSeriesLabelGenerator(); MultipleXYSeriesLabelGenerator g2 = null; try { @@ -126,7 +128,7 @@ assertTrue(g1 != g2); assertTrue(g1.getClass() == g2.getClass()); assertTrue(g1.equals(g2)); - + // check independence g1.addSeriesLabel(3, "Add3"); assertFalse(g1.equals(g2)); @@ -135,11 +137,20 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + MultipleXYSeriesLabelGenerator g1 + = new MultipleXYSeriesLabelGenerator(); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { - MultipleXYSeriesLabelGenerator g1 + MultipleXYSeriesLabelGenerator g1 = new MultipleXYSeriesLabelGenerator(); g1.addSeriesLabel(0, "Add0"); g1.addSeriesLabel(0, "Add0b"); Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategoryItemLabelGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategoryItemLabelGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategoryItemLabelGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * - * ---------------------------------------- - * StandardCategoryLabelGeneratorTests.java - * ---------------------------------------- - * (C) Copyright 2003-2007, by Object Refinery Limited and Contributors. + * -------------------------------------------- + * StandardCategoryItemLabelGeneratorTests.java + * -------------------------------------------- + * (C) Copyright 2003-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -37,6 +37,7 @@ * 21-Mar-2003 : Version 1 (DG); * 13-Aug-2003 : Added cloning tests (DG); * 11-May-2004 : Renamed class (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -59,6 +60,7 @@ import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; import org.jfree.chart.labels.StandardCategoryToolTipGenerator; import org.jfree.data.category.DefaultCategoryDataset; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link StandardCategoryItemLabelGenerator} class. @@ -82,13 +84,13 @@ public StandardCategoryItemLabelGeneratorTests(String name) { super(name); } - + /** * Some checks for the generalLabel() method. */ public void testGenerateLabel() { - StandardCategoryItemLabelGenerator g - = new StandardCategoryItemLabelGenerator("{2}", + StandardCategoryItemLabelGenerator g + = new StandardCategoryItemLabelGenerator("{2}", new DecimalFormat("0.000")); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(1.0, "R0", "C0"); @@ -97,54 +99,54 @@ dataset.addValue(null, "R1", "C1"); String s = g.generateLabel(dataset, 0, 0); assertEquals("1.000", s); - + // try a null value s = g.generateLabel(dataset, 1, 1); assertEquals("-", s); } - + /** * Some checks for the equals() method. */ public void testEquals() { - - StandardCategoryItemLabelGenerator g1 + + StandardCategoryItemLabelGenerator g1 = new StandardCategoryItemLabelGenerator(); - StandardCategoryItemLabelGenerator g2 + StandardCategoryItemLabelGenerator g2 = new StandardCategoryItemLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - - g1 = new StandardCategoryItemLabelGenerator("{0}", + + g1 = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); - g2 = new StandardCategoryItemLabelGenerator("{0}", + g2 = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); - g1 = new StandardCategoryItemLabelGenerator("{1}", + g1 = new StandardCategoryItemLabelGenerator("{1}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); - g2 = new StandardCategoryItemLabelGenerator("{1}", + g2 = new StandardCategoryItemLabelGenerator("{1}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); - g1 = new StandardCategoryItemLabelGenerator("{2}", + g1 = new StandardCategoryItemLabelGenerator("{2}", new SimpleDateFormat("d-MMM")); assertFalse(g1.equals(g2)); - g2 = new StandardCategoryItemLabelGenerator("{2}", + g2 = new StandardCategoryItemLabelGenerator("{2}", new SimpleDateFormat("d-MMM")); assertTrue(g1.equals(g2)); - + } /** * Simple check that hashCode is implemented. */ public void testHashCode() { - StandardCategoryItemLabelGenerator g1 + StandardCategoryItemLabelGenerator g1 = new StandardCategoryItemLabelGenerator(); - StandardCategoryItemLabelGenerator g2 + StandardCategoryItemLabelGenerator g2 = new StandardCategoryItemLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g1.hashCode() == g2.hashCode()); @@ -154,7 +156,7 @@ * Confirm that cloning works. */ public void testCloning() { - StandardCategoryItemLabelGenerator g1 + StandardCategoryItemLabelGenerator g1 = new StandardCategoryItemLabelGenerator(); StandardCategoryItemLabelGenerator g2 = null; try { @@ -169,12 +171,21 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + StandardCategoryItemLabelGenerator g1 + = new StandardCategoryItemLabelGenerator(); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { StandardCategoryItemLabelGenerator g1 - = new StandardCategoryItemLabelGenerator("{2}", + = new StandardCategoryItemLabelGenerator("{2}", DateFormat.getInstance()); StandardCategoryItemLabelGenerator g2 = null; @@ -195,16 +206,16 @@ assertEquals(g1, g2); } - + /** * A test for bug 1481087. */ public void testEquals1481087() { - StandardCategoryItemLabelGenerator g1 - = new StandardCategoryItemLabelGenerator("{0}", + StandardCategoryItemLabelGenerator g1 + = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.00")); - StandardCategoryToolTipGenerator g2 - = new StandardCategoryToolTipGenerator("{0}", + StandardCategoryToolTipGenerator g2 + = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.00")); assertFalse(g1.equals(g2)); } Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategorySeriesLabelGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategorySeriesLabelGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategorySeriesLabelGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ---------------------------------------------- * StandardCategorySeriesLabelGeneratorTests.java * ---------------------------------------------- - * (C) Copyright 2006, 2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2006-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -35,6 +35,7 @@ * Changes * ------- * 03-May-2006 : Version 1 (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -53,6 +54,7 @@ import org.jfree.chart.labels.StandardCategorySeriesLabelGenerator; import org.jfree.data.category.DefaultCategoryDataset; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link StandardCategorySeriesLabelGenerator} class. @@ -76,12 +78,12 @@ public StandardCategorySeriesLabelGeneratorTests(String name) { super(name); } - + /** * Some checks for the generalLabel() method. */ public void testGenerateLabel() { - StandardCategorySeriesLabelGenerator g + StandardCategorySeriesLabelGenerator g = new StandardCategorySeriesLabelGenerator("{0}"); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(1.0, "R0", "C0"); @@ -91,31 +93,31 @@ String s = g.generateLabel(dataset, 0); assertEquals("R0", s); } - + /** * Some checks for the equals() method. */ public void testEquals() { - StandardCategorySeriesLabelGenerator g1 + StandardCategorySeriesLabelGenerator g1 = new StandardCategorySeriesLabelGenerator(); - StandardCategorySeriesLabelGenerator g2 + StandardCategorySeriesLabelGenerator g2 = new StandardCategorySeriesLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - + g1 = new StandardCategorySeriesLabelGenerator("{1}"); assertFalse(g1.equals(g2)); g2 = new StandardCategorySeriesLabelGenerator("{1}"); - assertTrue(g1.equals(g2)); + assertTrue(g1.equals(g2)); } /** * Simple check that hashCode is implemented. */ public void testHashCode() { - StandardCategorySeriesLabelGenerator g1 + StandardCategorySeriesLabelGenerator g1 = new StandardCategorySeriesLabelGenerator(); - StandardCategorySeriesLabelGenerator g2 + StandardCategorySeriesLabelGenerator g2 = new StandardCategorySeriesLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g1.hashCode() == g2.hashCode()); @@ -125,7 +127,7 @@ * Confirm that cloning works. */ public void testCloning() { - StandardCategorySeriesLabelGenerator g1 + StandardCategorySeriesLabelGenerator g1 = new StandardCategorySeriesLabelGenerator("{1}"); StandardCategorySeriesLabelGenerator g2 = null; try { @@ -140,6 +142,15 @@ } /** + * Check to ensure that this class implements PublicCloneable. + */ + public void testPublicCloneable() { + StandardCategorySeriesLabelGenerator g1 + = new StandardCategorySeriesLabelGenerator("{1}"); + assertTrue(g1 instanceof PublicCloneable); + } + + /** * Serialize an instance, restore it, and check for equality. */ public void testSerialization() { Modified: branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategoryToolTipGeneratorTests.java =================================================================== --- branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategoryToolTipGeneratorTests.java 2008-04-23 14:29:43 UTC (rev 872) +++ branches/jfreechart-1.0.x-branch/tests/org/jfree/chart/labels/junit/StandardCategoryToolTipGeneratorTests.java 2008-04-23 15:09:08 UTC (rev 873) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ------------------------------------------ * StandardCategoryToolTipGeneratorTests.java * ------------------------------------------ - * (C) Copyright 2004-2007, by Object Refinery Limited and Contributors. + * (C) Copyright 2004-2008, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -37,6 +37,7 @@ * 11-May-2004 : Version 1 (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 03-May-2006 : Added testEquals1481087() (DG); + * 23-Apr-2008 : Added testPublicCloneable() (DG); * */ @@ -58,6 +59,7 @@ import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; import org.jfree.chart.labels.StandardCategoryToolTipGenerator; +import org.jfree.util.PublicCloneable; /** * Tests for the {@link StandardCategoryToolTipGenerator} class. @@ -81,49 +83,49 @@ public StandardCategoryToolTipGeneratorTests(String name) { super(name); } - + /** * Tests the equals() method. */ public void testEquals() { - - StandardCategoryToolTipGenerator g1 + + StandardCategoryToolTipGenerator g1 = new StandardCategoryToolTipGenerator(); - StandardCategoryToolTipGenerator g2 + StandardCategoryToolTipGenerator g2 = new StandardCategoryToolTipGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); - - g1 = new StandardCategoryToolTipGenerator("{0}", + + g1 = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); - g2 = new StandardCategoryToolTipGenerator("{0}", + g2 = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); - g1 = new StandardCategoryToolTipGenerator("{1}", + g1 = new StandardCategoryToolTipGenerator("{1}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); - g2 = new StandardCategoryToolTipGenerator("{1}", + g2 = new StandardCategoryToolTipGenerator("{1}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); - g1 = new StandardCategoryToolTipGenerator("{2}", + g1 = new StandardCategoryToolTipGenerator("{2}", new SimpleDateFormat("d-MMM")); assertFalse(g1.equals(g2)); - g2 = new StandardCategoryToolTipGenerator("{2}", + g2 = new StandardCategoryToolTipGenerator("{2}", new SimpleDateFormat("d-MMM")); assertTrue(g1.equals(g2)); - + } /** * Simple check that hashCode is implemented. */ public void testHashCode() { - StandardCategoryToolTipGenerator g1 + StandardCategoryToolTipGenerator g1 = new StandardCategoryToolTipGenerator(); - StandardCategoryToolTipGenerator g2 + StandardCategoryToolTipGenerator g2 = new StandardCategoryToolTipGenerator(); assertTrue(g1.equals(g2)); assertTrue(g1.hashC... [truncated message content] |