Index: gnu/testlet/javax/swing/plaf/metal/MetalBorders/ButtonBorder/getBorderInsets.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalBorders/ButtonBorder/getBorderInsets.java,v retrieving revision 1.1 diff -u -r1.1 getBorderInsets.java --- gnu/testlet/javax/swing/plaf/metal/MetalBorders/ButtonBorder/getBorderInsets.java 13 Sep 2005 19:37:51 -0000 1.1 +++ gnu/testlet/javax/swing/plaf/metal/MetalBorders/ButtonBorder/getBorderInsets.java 13 Feb 2006 13:36:00 -0000 @@ -1,6 +1,6 @@ // Tags: JDK1.4 -// Copyright (C) 2005 David Gilbert +// Copyright (C) 2005, 2006 David Gilbert // This file is part of Mauve. @@ -26,6 +26,7 @@ import java.awt.Insets; +import javax.swing.JButton; import javax.swing.plaf.metal.MetalBorders.ButtonBorder; /** @@ -52,6 +53,10 @@ ButtonBorder b = new ButtonBorder(); Insets insets = b.getBorderInsets(null); harness.check(insets, new Insets(3, 3, 3, 3)); + + // the method always returns the same instance + Insets insets2 = b.getBorderInsets(null); + harness.check(insets == insets2); } public void test2(TestHarness harness) @@ -60,17 +65,19 @@ ButtonBorder b = new ButtonBorder(); Insets insets = b.getBorderInsets(null, new Insets(1, 2, 3, 4)); harness.check(insets, new Insets(3, 3, 3, 3)); - + + // check null insets boolean pass = false; try { - b.getBorderInsets(null, null); + b.getBorderInsets(new JButton("Test"), null); } catch (NullPointerException e) { pass = true; } harness.check(pass); + } } Index: gnu/testlet/javax/swing/plaf/metal/MetalBorders/Flush3DBorder/getBorderInsets.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalBorders/Flush3DBorder/getBorderInsets.java,v retrieving revision 1.1 diff -u -r1.1 getBorderInsets.java --- gnu/testlet/javax/swing/plaf/metal/MetalBorders/Flush3DBorder/getBorderInsets.java 13 Sep 2005 19:37:51 -0000 1.1 +++ gnu/testlet/javax/swing/plaf/metal/MetalBorders/Flush3DBorder/getBorderInsets.java 13 Feb 2006 13:36:00 -0000 @@ -1,6 +1,6 @@ // Tags: JDK1.4 -// Copyright (C) 2005 David Gilbert +// Copyright (C) 2005, 2006 David Gilbert // This file is part of Mauve. @@ -26,8 +26,8 @@ import java.awt.Insets; +import javax.swing.JButton; import javax.swing.plaf.metal.MetalBorders.Flush3DBorder; -import javax.swing.plaf.metal.MetalBorders.InternalFrameBorder; /** * Some tests for the getBorderInsets() method in the {@link Flush3DBorder} @@ -53,6 +53,10 @@ Flush3DBorder b = new Flush3DBorder(); Insets insets = b.getBorderInsets(null); harness.check(insets, new Insets(2, 2, 2, 2)); + + // the method always returns the same instance + Insets insets2 = b.getBorderInsets(null); + harness.check(insets == insets2); } public void test2(TestHarness harness) @@ -62,10 +66,11 @@ Insets insets = b.getBorderInsets(null, new Insets(1, 2, 3, 4)); harness.check(insets, new Insets(2, 2, 2, 2)); + // check null insets boolean pass = false; try { - b.getBorderInsets(null, null); + b.getBorderInsets(new JButton("Test"), null); } catch (NullPointerException e) { Index: gnu/testlet/javax/swing/plaf/metal/MetalBorders/InternalFrameBorder/getBorderInsets.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalBorders/InternalFrameBorder/getBorderInsets.java,v retrieving revision 1.1 diff -u -r1.1 getBorderInsets.java --- gnu/testlet/javax/swing/plaf/metal/MetalBorders/InternalFrameBorder/getBorderInsets.java 13 Sep 2005 19:37:52 -0000 1.1 +++ gnu/testlet/javax/swing/plaf/metal/MetalBorders/InternalFrameBorder/getBorderInsets.java 13 Feb 2006 13:36:00 -0000 @@ -1,6 +1,6 @@ // Tags: JDK1.4 -// Copyright (C) 2005 David Gilbert +// Copyright (C) 2005, 2006 David Gilbert // This file is part of Mauve. @@ -16,8 +16,8 @@ // You should have received a copy of the GNU General Public License // along with Mauve; see the file COPYING. If not, write to -// the Free Software Foundation, 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. */ +// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA. package gnu.testlet.javax.swing.plaf.metal.MetalBorders.InternalFrameBorder; @@ -26,6 +26,7 @@ import java.awt.Insets; +import javax.swing.JButton; import javax.swing.plaf.metal.MetalBorders.InternalFrameBorder; /** @@ -52,6 +53,10 @@ InternalFrameBorder b = new InternalFrameBorder(); Insets insets = b.getBorderInsets(null); harness.check(insets, new Insets(5, 5, 5, 5)); + + // the method always returns the same instance + Insets insets2 = b.getBorderInsets(null); + harness.check(insets == insets2); } public void test2(TestHarness harness) @@ -64,7 +69,7 @@ boolean pass = false; try { - b.getBorderInsets(null, null); + b.getBorderInsets(new JButton("Test"), null); } catch (NullPointerException e) { Index: gnu/testlet/javax/swing/plaf/metal/MetalBorders/MenuItemBorder/getBorderInsets.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalBorders/MenuItemBorder/getBorderInsets.java,v retrieving revision 1.1 diff -u -r1.1 getBorderInsets.java --- gnu/testlet/javax/swing/plaf/metal/MetalBorders/MenuItemBorder/getBorderInsets.java 13 Sep 2005 19:37:54 -0000 1.1 +++ gnu/testlet/javax/swing/plaf/metal/MetalBorders/MenuItemBorder/getBorderInsets.java 13 Feb 2006 13:36:00 -0000 @@ -1,6 +1,6 @@ // Tags: JDK1.4 -// Copyright (C) 2005 David Gilbert +// Copyright (C) 2005, 2006 David Gilbert // This file is part of Mauve. @@ -16,8 +16,8 @@ // You should have received a copy of the GNU General Public License // along with Mauve; see the file COPYING. If not, write to -// the Free Software Foundation, 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. */ +// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA. package gnu.testlet.javax.swing.plaf.metal.MetalBorders.MenuItemBorder; @@ -26,6 +26,7 @@ import java.awt.Insets; +import javax.swing.JButton; import javax.swing.plaf.metal.MetalBorders.MenuItemBorder; /** @@ -52,6 +53,10 @@ MenuItemBorder b = new MenuItemBorder(); Insets insets = b.getBorderInsets(null); harness.check(insets, new Insets(2, 2, 2, 2)); + + // the method always returns the same instance + Insets insets2 = b.getBorderInsets(null); + harness.check(insets == insets2); } public void test2(TestHarness harness) @@ -64,7 +69,7 @@ boolean pass = false; try { - b.getBorderInsets(null, null); + b.getBorderInsets(new JButton("Test"), null); } catch (NullPointerException e) { Index: gnu/testlet/javax/swing/plaf/metal/MetalBorders/PaletteBorder/getBorderInsets.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/metal/MetalBorders/PaletteBorder/getBorderInsets.java,v retrieving revision 1.1 diff -u -r1.1 getBorderInsets.java --- gnu/testlet/javax/swing/plaf/metal/MetalBorders/PaletteBorder/getBorderInsets.java 13 Sep 2005 19:37:55 -0000 1.1 +++ gnu/testlet/javax/swing/plaf/metal/MetalBorders/PaletteBorder/getBorderInsets.java 13 Feb 2006 13:36:00 -0000 @@ -26,6 +26,7 @@ import java.awt.Insets; +import javax.swing.JButton; import javax.swing.plaf.metal.MetalBorders.PaletteBorder; /** @@ -52,6 +53,10 @@ PaletteBorder b = new PaletteBorder(); Insets insets = b.getBorderInsets(null); harness.check(insets, new Insets(1, 1, 1, 1)); + + // the method always returns the same instance + Insets insets2 = b.getBorderInsets(null); + harness.check(insets == insets2); } public void test2(TestHarness harness) @@ -64,7 +69,7 @@ boolean pass = false; try { - b.getBorderInsets(null, null); + b.getBorderInsets(new JButton("Test"), null); } catch (NullPointerException e) {