* FYI: List.java
@ 2006-08-24 18:12 Tania Bento
0 siblings, 0 replies; only message in thread
From: Tania Bento @ 2006-08-24 18:12 UTC (permalink / raw)
To: mauve-patches
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
Hey,
This new mauve file (committed) tests the setMultipleMode(boolean)
method in java.awt.List.
Cheers,
Tania
2006-08-24 Tania Bento <tbento@redhat.com>
* gnu/testlet/java/awt/List/testSetMultipleMode: New file.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 3509 bytes --]
Index: gnu/testlet/java/awt/List/testSetMultipleMode.java
===================================================================
RCS file: gnu/testlet/java/awt/List/testSetMultipleMode.java
diff -N gnu/testlet/java/awt/List/testSetMultipleMode.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/awt/List/testSetMultipleMode.java 24 Aug 2006 18:07:02 -0000
@@ -0,0 +1,105 @@
+/* testSetMultipleMode.java -- FIXME: describe
+ Copyright (C) 2006 FIXME: your info here
+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.
+
+*/
+
+// Tags: FIXME
+
+package gnu.testlet.java.awt.List;
+
+import java.awt.Frame;
+import java.awt.List;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.ButtonGroup.isSelected;
+
+public class testSetMultipleMode implements Testlet
+{
+
+ public void test(TestHarness harness)
+ {
+ test1(harness);
+ test2(harness);
+ test3(harness);
+ }
+
+ public void test1(TestHarness harness)
+ {
+ List list = new List();
+ list.setMultipleMode(true);
+ harness.check(list.isMultipleMode());
+ list.add("item");
+ list.add("item1");
+ list.select(1);
+ list.select(0);
+ Frame f = new Frame("");
+ f.add(list);
+ f.pack();
+ harness.check(list.getSelectedIndex(), -1);
+ list.setMultipleMode(false);
+ harness.check(list.getSelectedIndex(), 0);
+ harness.check(list.isMultipleMode(), false);
+ harness.check(list.getSelectedIndex(), 0);
+ f.dispose();
+ }
+
+ public void test2(TestHarness harness)
+ {
+ List list = new List();
+ list.setMultipleMode(true);
+ harness.check(list.isMultipleMode());
+ list.add("item1");
+ list.add("item2");
+ list.add("item3");
+ harness.check(list.getItemCount(), 3);
+ list.select(1);
+ list.select(0);
+ list.select(2);
+ harness.check(list.isSelected(0));
+ harness.check(list.isSelected(1));
+ harness.check(list.isSelected(2));
+ list.setMultipleMode(false);
+ harness.check(list.isMultipleMode(), false);
+ harness.check(list.getItemCount(), 3);
+ harness.check(list.getSelectedIndex(), -1);
+ harness.check(list.isSelected(0));
+ harness.check(list.isSelected(1), true);
+ harness.check(list.isSelected(2), true);
+ }
+
+ public void test3(TestHarness harness)
+ {
+ List list = new List();
+ list.add("item1");
+ list.add("item2");
+ list.add("item3");
+ harness.check(list.isMultipleMode(), false);
+ list.select(2);
+ list.select(0);
+ list.select(1);
+ harness.check(list.isSelected(0), false);
+ harness.check(list.isSelected(1), true);
+ harness.check(list.isSelected(2), false);
+ list.setMultipleMode(true);
+ harness.check(list.isSelected(0), false);
+ harness.check(list.isSelected(1), true);
+ harness.check(list.isSelected(2), false);
+ }
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-08-24 18:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-24 18:12 FYI: List.java Tania Bento
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).