This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI: MetalComboBoxIcon
- From: David Gilbert <david dot gilbert at object-refinery dot com>
- To: mauve-patches at sources dot redhat dot com
- Date: Thu, 13 Oct 2005 08:44:41 +0000
- Subject: FYI: MetalComboBoxIcon
I committed these simple tests for the MetalComboBoxIcon class:
2005-10-13 David Gilbert <david.gilbert@object-refinery.com>
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/constructors.java:
New test,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboBox.java:
New test,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboIcon.java:
New test,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isFocusTraversable.java:
New test,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isIconOnly.java:
New test,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboBox.java:
New test,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboIcon.java:
New test,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setEnabled.java:
New test,
*
gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setIconOnly.java:
New test.
Regards,
Dave
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/constructors.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/constructors.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/constructors.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/constructors.java 13 Oct 2005 07:39:26 -0000
@@ -0,0 +1,111 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+
+/**
+ * Some tests for the constructors in the {@link MetalComboBoxButton} class.
+ */
+public class constructors implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ testConstructor1(harness);
+ testConstructor2(harness);
+ }
+
+ private void testConstructor1(TestHarness harness)
+ {
+ harness.checkPoint("MetalComboBoxButton(JComboBox, Icon, CellRendererPane, JList)");
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
+ new CellRendererPane(), new JList());
+ harness.check(b.getComboBox() == jcb);
+ harness.check(b.getComboIcon() == icon);
+ harness.check(!b.isIconOnly());
+
+ boolean pass = false;
+ try
+ {
+ b = new MetalComboBoxButton(null, icon, new CellRendererPane(),
+ new JList());
+ }
+ catch (NullPointerException e)
+ {
+ pass = true;
+ }
+ harness.check(pass);
+
+ b = new MetalComboBoxButton(jcb, null, new CellRendererPane(), new JList());
+ harness.check(b.getComboIcon() == null);
+ b = new MetalComboBoxButton(jcb, icon, null, new JList());
+ b = new MetalComboBoxButton(jcb, icon, new CellRendererPane(), null);
+ }
+
+ private void testConstructor2(TestHarness harness)
+ {
+ harness.checkPoint("MetalComboBoxButton(JComboBox, Icon, boolean, CellRendererPane, JList)");
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon, true,
+ new CellRendererPane(), new JList());
+ harness.check(b.getComboBox() == jcb);
+ harness.check(b.getComboIcon() == icon);
+ harness.check(b.isIconOnly());
+
+ boolean pass = false;
+ try
+ {
+ b = new MetalComboBoxButton(null, icon, true, new CellRendererPane(),
+ new JList());
+ }
+ catch (NullPointerException e)
+ {
+ pass = true;
+ }
+ harness.check(pass);
+
+ b = new MetalComboBoxButton(jcb, null, true, new CellRendererPane(),
+ new JList());
+ harness.check(b.getComboIcon() == null);
+
+ b = new MetalComboBoxButton(jcb, icon, true, null, new JList());
+ b = new MetalComboBoxButton(jcb, icon, true, new CellRendererPane(), null);
+ }
+
+}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboBox.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboBox.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboBox.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboBox.java 13 Oct 2005 07:39:27 -0000
@@ -0,0 +1,55 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+
+/**
+ * Some tests for the getComboBox() method in the {@link MetalComboBoxButton}
+ * class.
+ */
+public class getComboBox implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
+ new CellRendererPane(), new JList());
+ harness.check(b.getComboBox() == jcb);
+ }
+
+}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboIcon.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboIcon.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboIcon.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/getComboIcon.java 13 Oct 2005 07:39:27 -0000
@@ -0,0 +1,55 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+
+/**
+ * Some tests for the getComboIcon() method in the {@link MetalComboBoxButton}
+ * class.
+ */
+public class getComboIcon implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
+ new CellRendererPane(), new JList());
+ harness.check(b.getComboIcon() == icon);
+ }
+
+}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isFocusTraversable.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isFocusTraversable.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isFocusTraversable.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isFocusTraversable.java 13 Oct 2005 07:39:27 -0000
@@ -0,0 +1,55 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+
+/**
+ * Some tests for the isFocusTraversable() method in the
+ * {@link MetalComboBoxButton} class.
+ */
+public class isFocusTraversable implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
+ new CellRendererPane(), new JList());
+ harness.check(!b.isFocusTraversable());
+ }
+
+}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isIconOnly.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isIconOnly.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isIconOnly.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/isIconOnly.java 13 Oct 2005 07:39:27 -0000
@@ -0,0 +1,57 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+
+/**
+ * Some tests for the isIconOnly() method in the {@link MetalComboBoxButton}
+ * class.
+ */
+public class isIconOnly implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
+ new CellRendererPane(), new JList());
+ harness.check(!b.isIconOnly());
+ b.setIconOnly(true);
+ harness.check(b.isIconOnly());
+ }
+
+}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboBox.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboBox.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboBox.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboBox.java 13 Oct 2005 07:39:27 -0000
@@ -0,0 +1,62 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+
+/**
+ * Some tests for the setComboBox() method in the
+ * {@link MetalComboBoxButton} class.
+ */
+public class setComboBox implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ JComboBox jcb1 = new JComboBox(new Object[] {"A", "B", "C"});
+ JComboBox jcb2 = new JComboBox(new Object[] {"X", "Y", "Z"});
+ Icon icon = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb1, icon,
+ new CellRendererPane(), new JList());
+ harness.check(b.getComboBox() == jcb1);
+
+ b.setComboBox(jcb2);
+ harness.check(b.getComboBox() == jcb2);
+
+ b.setComboBox(null);
+ harness.check(b.getComboBox() == null);
+ }
+
+}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboIcon.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboIcon.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboIcon.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setComboIcon.java 13 Oct 2005 07:39:27 -0000
@@ -0,0 +1,63 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+import javax.swing.plaf.metal.MetalIconFactory;
+
+/**
+ * Some tests for the setComboIcon() method in the
+ * {@link MetalComboBoxButton} class.
+ */
+public class setComboIcon implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon1 = new MetalComboBoxIcon();
+ Icon icon2 = MetalIconFactory.getHorizontalSliderThumbIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon1,
+ new CellRendererPane(), new JList());
+ harness.check(b.getComboIcon() == icon1);
+
+ b.setComboIcon(icon2);
+ harness.check(b.getComboIcon() == icon2);
+
+ b.setComboIcon(null);
+ harness.check(b.getComboIcon() == null);
+ }
+
+}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setEnabled.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setEnabled.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setEnabled.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setEnabled.java 13 Oct 2005 07:39:27 -0000
@@ -0,0 +1,58 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+
+/**
+ * Some tests for the setEnabled() method in the
+ * {@link MetalComboBoxButton} class.
+ */
+public class setEnabled implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon1 = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon1,
+ new CellRendererPane(), new JList());
+ harness.check(b.isEnabled());
+
+ b.setEnabled(false);
+ harness.check(!b.isEnabled());
+ }
+
+}
Index: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setIconOnly.java
===================================================================
RCS file: gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setIconOnly.java
diff -N gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setIconOnly.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/plaf/metal/MetalComboBoxButton/setIconOnly.java 13 Oct 2005 07:39:27 -0000
@@ -0,0 +1,58 @@
+// Tags: JDK1.2
+
+// Copyright (C) 2005 David Gilbert <david.gilbert@object-refinery.com>
+
+// This file is part of Mauve.
+
+// Mauve is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// Mauve 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 General Public License for more details.
+
+// 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, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+package gnu.testlet.javax.swing.plaf.metal.MetalComboBoxButton;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.CellRendererPane;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.plaf.metal.MetalComboBoxButton;
+import javax.swing.plaf.metal.MetalComboBoxIcon;
+
+/**
+ * Some tests for the setIconOnly() method in the
+ * {@link MetalComboBoxButton} class.
+ */
+public class setIconOnly implements Testlet
+{
+
+ /**
+ * Runs the test using the specified harness.
+ *
+ * @param harness the test harness (<code>null</code> not permitted).
+ */
+ public void test(TestHarness harness)
+ {
+ JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
+ Icon icon1 = new MetalComboBoxIcon();
+ MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon1,
+ new CellRendererPane(), new JList());
+ harness.check(!b.isIconOnly());
+
+ b.setIconOnly(true);
+ harness.check(b.isIconOnly());
+ }
+
+}