This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI: Swing key mapping tests
- From: David Gilbert <david dot gilbert at object-refinery dot com>
- To: mauve-patches <mauve-patches at sources dot redhat dot com>
- Date: Wed, 07 Jun 2006 10:50:10 +0100
- Subject: FYI: Swing key mapping tests
This patch (committed) adds checks for the key mappings of a number of
Swing components. Not all the mappings are correct yet, so there are
some failures:
2006-06-07 David Gilbert <david.gilbert@object-refinery.com>
* gnu/testlet/javax/swing/JInternalFrame/getInputMap.java: New file,
* gnu/testlet/javax/swing/JLabel/getInputMap.java: New file,
* gnu/testlet/javax/swing/JMenu/getInputMap.java: New file,
* gnu/testlet/javax/swing/JMenuBar/getInputMap.java: New file,
* gnu/testlet/javax/swing/JOptionPane/getInputMap.java: New file,
* gnu/testlet/javax/swing/JOptionPane/MyJOptionPane.java: New file,
* gnu/testlet/javax/swing/JPopupMenu/getInputMap.java: New file,
* gnu/testlet/javax/swing/JScrollBar/getInputMap.java: New file,
* gnu/testlet/javax/swing/JScrollPane/getInputMap.java: New file,
* gnu/testlet/javax/swing/JSplitPane/getInputMap.java: New file,
* gnu/testlet/javax/swing/JTabbedPane/getInputMap.java: New file,
* gnu/testlet/javax/swing/JTable/getInputMap.java: New file,
* gnu/testlet/javax/swing/JTableHeader/getInputMap.java: New file,
* gnu/testlet/javax/swing/JToolBar/getInputMap.java: New file.
Regards,
Dave
Index: gnu/testlet/javax/swing/JInternalFrame/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JInternalFrame/getInputMap.java
diff -N gnu/testlet/javax/swing/JInternalFrame/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JInternalFrame/getInputMap.java 7 Jun 2006 09:40:38 -0000
@@ -0,0 +1,70 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JInternalFrame class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JInternalFrame;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JInternalFrame;
+
+/**
+ * Checks the input maps defined for a JInternalFrame - this is really testing
+ * the setup performed by BasicInternalFrameUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JInternalFrame f = new JInternalFrame();
+ InputMap m1 = f.getInputMap();
+ InputMap m2 = f.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JInternalFrame f = new JInternalFrame();
+ InputMap m1 = f.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = f.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ harness.check(m2.getParent(), null);
+ InputMap m3 = f.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JLabel/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JLabel/getInputMap.java
diff -N gnu/testlet/javax/swing/JLabel/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JLabel/getInputMap.java 7 Jun 2006 09:40:38 -0000
@@ -0,0 +1,71 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JLabel class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JLabel;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+
+/**
+ * Checks the input maps defined for a JLabel - this is really testing
+ * the setup performed by BasicLabelUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JLabel label = new JLabel("Test");
+ InputMap m1 = label.getInputMap();
+ InputMap m2 = label.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JLabel label = new JLabel("Test");
+ InputMap m1 = label.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = label.getInputMap(
+ JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ harness.check(m2.getParent(), null);
+ InputMap m3 = label.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JMenu/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JMenu/getInputMap.java
diff -N gnu/testlet/javax/swing/JMenu/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JMenu/getInputMap.java 7 Jun 2006 09:40:38 -0000
@@ -0,0 +1,70 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JMenu class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JMenu;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JMenu;
+
+/**
+ * Checks the input maps defined for a JMenu - this is really testing
+ * the setup performed by BasicMenuUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JMenu m = new JMenu();
+ InputMap m1 = m.getInputMap();
+ InputMap m2 = m.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JMenu m = new JMenu();
+ InputMap m1 = m.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = m.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ harness.check(m2.getParent(), null);
+ InputMap m3 = m.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JMenuBar/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JMenuBar/getInputMap.java
diff -N gnu/testlet/javax/swing/JMenuBar/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JMenuBar/getInputMap.java 7 Jun 2006 09:40:38 -0000
@@ -0,0 +1,72 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JMenuBar class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JMenuBar;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JMenuBar;
+import javax.swing.KeyStroke;
+
+/**
+ * Checks the input maps defined for a JMenuBar - this is really testing
+ * the setup performed by BasicMenuBarUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JMenuBar mb = new JMenuBar();
+ InputMap m1 = mb.getInputMap();
+ InputMap m2 = mb.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JMenuBar mb = new JMenuBar();
+ InputMap m1 = mb.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = mb.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ harness.check(m2.getParent(), null);
+ InputMap m3 = mb.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ InputMap m3p = m3.getParent();
+ harness.check(m3p.get(KeyStroke.getKeyStroke("pressed F10")), "takeFocus");
+ }
+}
Index: gnu/testlet/javax/swing/JOptionPane/MyJOptionPane.java
===================================================================
RCS file: gnu/testlet/javax/swing/JOptionPane/MyJOptionPane.java
diff -N gnu/testlet/javax/swing/JOptionPane/MyJOptionPane.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JOptionPane/MyJOptionPane.java 7 Jun 2006 09:40:38 -0000
@@ -0,0 +1,34 @@
+/* MyJOptionPane.java -- for testing.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: not-a-test
+
+package gnu.testlet.javax.swing.JOptionPane;
+
+import javax.swing.JOptionPane;
+
+public class MyJOptionPane extends JOptionPane
+{
+ public MyJOptionPane()
+ {
+ super();
+ }
+}
Index: gnu/testlet/javax/swing/JOptionPane/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JOptionPane/getInputMap.java
diff -N gnu/testlet/javax/swing/JOptionPane/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JOptionPane/getInputMap.java 7 Jun 2006 09:40:39 -0000
@@ -0,0 +1,72 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JOptionPane class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JOptionPane;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
+
+/**
+ * Checks the input maps defined for a JOptionPane - this is really testing
+ * the setup performed by BasicOptionPaneUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JOptionPane p = new MyJOptionPane();
+ InputMap m1 = p.getInputMap();
+ InputMap m2 = p.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JOptionPane p = new MyJOptionPane();
+ InputMap m1 = p.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = p.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ harness.check(m2.getParent(), null);
+ InputMap m3 = p.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ InputMap m3p = m3.getParent();
+ harness.check(m3p.get(KeyStroke.getKeyStroke("pressed ESCAPE")), "close");
+ }
+}
Index: gnu/testlet/javax/swing/JPopupMenu/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JPopupMenu/getInputMap.java
diff -N gnu/testlet/javax/swing/JPopupMenu/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JPopupMenu/getInputMap.java 7 Jun 2006 09:40:39 -0000
@@ -0,0 +1,76 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JPopupMenu class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JPopupMenu;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JPopupMenu;
+
+/**
+ * Checks the input maps defined for a JPopupMenu - this is really testing
+ * the setup performed by BasicPopupMenuUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JPopupMenu p = new JPopupMenu();
+ InputMap m1 = p.getInputMap();
+ InputMap m2 = p.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JPopupMenu p = new JPopupMenu();
+ InputMap m1 = p.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = p.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ harness.check(m2.getParent(), null);
+ InputMap m3 = p.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+// InputMap m3p = m3.getParent();
+// harness.check(m3p.get(KeyStroke.getKeyStroke("pressed ESCAPE")), "close");
+// for (int i = 0; i < m3p.keys().length; i++)
+// {
+// System.out.println(m3p.keys()[i] + ", " + m3p.get(m3p.keys()[i]));
+// }
+ }
+}
Index: gnu/testlet/javax/swing/JScrollBar/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JScrollBar/getInputMap.java
diff -N gnu/testlet/javax/swing/JScrollBar/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JScrollBar/getInputMap.java 7 Jun 2006 09:40:39 -0000
@@ -0,0 +1,84 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JScrollBar class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JScrollBar;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JScrollBar;
+import javax.swing.KeyStroke;
+
+/**
+ * Checks the input maps defined for a JScrollBar - this is really testing
+ * the setup performed by BasicScrollBarUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JScrollBar sb = new JScrollBar();
+ InputMap m1 = sb.getInputMap();
+ InputMap m2 = sb.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JScrollBar sb = new JScrollBar();
+ InputMap m1 = sb.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = sb.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ InputMap m2p = m2.getParent();
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PAGE_UP")), "negativeBlockIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PAGE_DOWN")), "positiveBlockIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed END")), "maxScroll");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed HOME")), "minScroll");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed LEFT")), "negativeUnitIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_UP")), "negativeUnitIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_DOWN")), "positiveUnitIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed UP")), "negativeUnitIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed RIGHT")), "positiveUnitIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_LEFT")), "negativeUnitIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed DOWN")), "positiveUnitIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_RIGHT")), "positiveUnitIncrement");
+
+ InputMap m3 = sb.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JScrollPane/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JScrollPane/getInputMap.java
diff -N gnu/testlet/javax/swing/JScrollPane/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JScrollPane/getInputMap.java 7 Jun 2006 09:40:39 -0000
@@ -0,0 +1,85 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JScrollPane class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JScrollPane;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
+import javax.swing.KeyStroke;
+
+/**
+ * Checks the input maps defined for a JScrollPane - this is really testing
+ * the setup performed by BasicScrollPaneUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JScrollPane sp = new JScrollPane();
+ InputMap m1 = sp.getInputMap();
+ InputMap m2 = sp.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JScrollPane sp = new JScrollPane();
+ InputMap m1 = sp.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = sp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ InputMap m2p = m2.getParent();
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed PAGE_DOWN")), "scrollRight");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PAGE_DOWN")), "scrollDown");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PAGE_UP")), "scrollUp");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed PAGE_UP")), "scrollLeft");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_RIGHT")), "unitScrollRight");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed DOWN")), "unitScrollDown");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_LEFT")), "unitScrollLeft");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed HOME")), "scrollHome");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed RIGHT")), "unitScrollRight");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_DOWN")), "unitScrollDown");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed UP")), "unitScrollUp");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_UP")), "unitScrollUp");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed LEFT")), "unitScrollLeft");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed END")), "scrollEnd");
+ InputMap m3 = sp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JSplitPane/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JSplitPane/getInputMap.java
diff -N gnu/testlet/javax/swing/JSplitPane/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JSplitPane/getInputMap.java 7 Jun 2006 09:40:39 -0000
@@ -0,0 +1,64 @@
+/* getInputMap.java -- some checks for the getInputMap() method in the
+ JSplitPane class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.3
+
+package gnu.testlet.javax.swing.JSplitPane;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JSplitPane;
+import javax.swing.KeyStroke;
+
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ JSplitPane sp = new JSplitPane();
+ InputMap m1 = sp.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ harness.check(m1.getParent(), null);
+ InputMap m2 = sp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ InputMap m2p = m2.getParent();
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed TAB")), "focusOutBackward");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_RIGHT")), "positiveIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed DOWN")), "positiveIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_LEFT")), "negativeIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed RIGHT")), "positiveIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_DOWN")), "positiveIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed UP")), "negativeIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_UP")), "negativeIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed F8")), "startResize");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed TAB")), "focusOutForward");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed LEFT")), "negativeIncrement");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed HOME")), "selectMin");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed F6")), "toggleFocus");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed END")), "selectMax");
+ InputMap m3 = sp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JTabbedPane/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JTabbedPane/getInputMap.java
diff -N gnu/testlet/javax/swing/JTabbedPane/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JTabbedPane/getInputMap.java 7 Jun 2006 09:40:39 -0000
@@ -0,0 +1,97 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JTabbedPane class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JTabbedPane;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JTabbedPane;
+import javax.swing.KeyStroke;
+
+/**
+ * Checks the input maps defined for a JTabbedPane - this is really testing
+ * the setup performed by BasicTabbedPaneUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JTabbedPane tp = new JTabbedPane();
+ InputMap m1 = tp.getInputMap();
+ InputMap m2 = tp.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JTabbedPane tp = new JTabbedPane();
+ InputMap m1 = tp.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p.get(KeyStroke.getKeyStroke("ctrl pressed DOWN")),
+ "requestFocusForVisibleComponent");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("pressed KP_UP")),
+ "navigateUp");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("pressed LEFT")),
+ "navigateLeft");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("ctrl pressed KP_DOWN")),
+ "requestFocusForVisibleComponent");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("pressed UP")), "navigateUp");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("pressed KP_DOWN")),
+ "navigateDown");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("pressed KP_LEFT")),
+ "navigateLeft");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("pressed RIGHT")),
+ "navigateRight");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("pressed KP_RIGHT")),
+ "navigateRight");
+ harness.check(m1p.get(KeyStroke.getKeyStroke("pressed DOWN")),
+ "navigateDown");
+ InputMap m2 = tp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ InputMap m2p = m2.getParent();
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed PAGE_DOWN")),
+ "navigatePageDown");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed PAGE_UP")),
+ "navigatePageUp");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed UP")),
+ "requestFocus");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed KP_UP")),
+ "requestFocus");
+ InputMap m3 = tp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JTable/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JTable/getInputMap.java
diff -N gnu/testlet/javax/swing/JTable/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JTable/getInputMap.java 7 Jun 2006 09:40:40 -0000
@@ -0,0 +1,200 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JTable class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JTable;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JTable;
+import javax.swing.KeyStroke;
+
+/**
+ * Checks the input maps defined for a JTable - this is really testing
+ * the setup performed by BasicTableUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JTable t = new JTable();
+ InputMap m1 = t.getInputMap();
+ InputMap m2 = t.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JTable t = new JTable();
+ InputMap m1 = t.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ harness.check(m1.getParent(), null);
+ InputMap m2 = t.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ InputMap m2p = m2.getParent();
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed DOWN")),
+ "selectNextRowChangeLead");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed UP")),
+ "selectPreviousRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed RIGHT")),
+ "selectNextColumnChangeLead");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed LEFT")),
+ "selectPreviousColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed KP_UP")),
+ "selectPreviousRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed DOWN")),
+ "selectNextRow");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed UP")),
+ "selectPreviousRowChangeLead");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed LEFT")),
+ "selectPreviousColumnChangeLead");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed CUT")), "cut");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed END")),
+ "selectLastColumn");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed PAGE_UP")),
+ "scrollUpExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_UP")),
+ "selectPreviousRow");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed UP")),
+ "selectPreviousRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed HOME")),
+ "selectFirstRow");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed LEFT")),
+ "selectPreviousColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed END")),
+ "selectLastRow");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed PAGE_DOWN")),
+ "scrollRightChangeSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed RIGHT")),
+ "selectNextColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed LEFT")),
+ "selectPreviousColumn");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed PAGE_UP")),
+ "scrollLeftChangeSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_LEFT")),
+ "selectPreviousColumn");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed KP_RIGHT")),
+ "selectNextColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed SPACE")),
+ "addToSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed SPACE")),
+ "toggleAndAnchor");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed SPACE")),
+ "extendTo");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed SPACE")),
+ "moveSelectionTo");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed DOWN")),
+ "selectNextRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed BACK_SLASH")),
+ "clearSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed ESCAPE")),
+ "cancel");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed HOME")),
+ "selectFirstColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed ENTER")),
+ "selectNextRowCell");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed ENTER")),
+ "selectPreviousRowCell");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed RIGHT")),
+ "selectNextColumn");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed PAGE_UP")),
+ "scrollLeftExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed DOWN")),
+ "selectNextRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PAGE_DOWN")),
+ "scrollDownChangeSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed KP_UP")),
+ "selectPreviousRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed KP_LEFT")),
+ "selectPreviousColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed X")), "cut");
+ harness.check(m2p.get(KeyStroke.getKeyStroke(
+ "shift ctrl pressed PAGE_DOWN")), "scrollRightExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed SLASH")),
+ "selectAll");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed C")), "copy");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed KP_RIGHT")),
+ "selectNextColumnChangeLead");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed END")),
+ "selectLastColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke(
+ "shift ctrl pressed KP_DOWN")), "selectNextRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed TAB")),
+ "selectPreviousColumnCell");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed KP_LEFT")),
+ "selectPreviousColumnChangeLead");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed HOME")),
+ "selectFirstColumn");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed V")),
+ "paste");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_DOWN")),
+ "selectNextRow");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed KP_DOWN")),
+ "selectNextRowChangeLead");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed RIGHT")),
+ "selectNextColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed A")),
+ "selectAll");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed END")),
+ "selectLastRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed COPY")), "copy");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed KP_UP")),
+ "selectPreviousRowChangeLead");
+ harness.check(m2p.get(KeyStroke.getKeyStroke(
+ "shift ctrl pressed KP_LEFT")),
+ "selectPreviousColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed KP_DOWN")),
+ "selectNextRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed TAB")),
+ "selectNextColumnCell");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed UP")),
+ "selectPreviousRow");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift ctrl pressed HOME")),
+ "selectFirstRowExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("shift pressed PAGE_DOWN")),
+ "scrollDownExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_RIGHT")),
+ "selectNextColumn");
+ harness.check(m2p.get(KeyStroke.getKeyStroke(
+ "shift ctrl pressed KP_RIGHT")), "selectNextColumnExtendSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed F2")),
+ "startEditing");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PAGE_UP")),
+ "scrollUpChangeSelection");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PASTE")), "paste");
+ InputMap m3 = t.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JTableHeader/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JTableHeader/getInputMap.java
diff -N gnu/testlet/javax/swing/JTableHeader/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JTableHeader/getInputMap.java 7 Jun 2006 09:40:40 -0000
@@ -0,0 +1,69 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JTableHeader class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JTableHeader;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.table.JTableHeader;
+
+/**
+ * Checks the input maps defined for a JTabbedPane - this is really testing
+ * the setup performed by BasicTabbedPaneUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JTableHeader th = new JTableHeader();
+ InputMap m1 = th.getInputMap();
+ InputMap m2 = th.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JTableHeader th = new JTableHeader();
+ InputMap m1 = th.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ harness.check(m1.getParent(), null);
+ InputMap m2 = th.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ harness.check(m2.getParent(), null);
+ InputMap m3 = th.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}
Index: gnu/testlet/javax/swing/JToolBar/getInputMap.java
===================================================================
RCS file: gnu/testlet/javax/swing/JToolBar/getInputMap.java
diff -N gnu/testlet/javax/swing/JToolBar/getInputMap.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JToolBar/getInputMap.java 7 Jun 2006 09:40:40 -0000
@@ -0,0 +1,86 @@
+/* getInputMap.java -- some checks for the getInputMap() methods inherited by
+ the JToolBar class.
+ Copyright (C) 2006 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.
+
+*/
+
+// Tags: JDK1.4
+
+package gnu.testlet.javax.swing.JToolBar;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.JToolBar;
+import javax.swing.KeyStroke;
+
+/**
+ * Checks the input maps defined for a JToolBar - this is really testing
+ * the setup performed by BasicToolBarUI.
+ */
+public class getInputMap implements Testlet
+{
+ public void test(TestHarness harness)
+ {
+ testMethod1(harness);
+ testMethod2(harness);
+ }
+
+ public void testMethod1(TestHarness harness)
+ {
+ harness.checkPoint("()");
+ JToolBar tb = new JToolBar();
+ InputMap m1 = tb.getInputMap();
+ InputMap m2 = tb.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1 == m2);
+ }
+
+ public void testMethod2(TestHarness harness)
+ {
+ harness.checkPoint("(int)");
+ JToolBar tb = new JToolBar();
+ InputMap m1 = tb.getInputMap(JComponent.WHEN_FOCUSED);
+ harness.check(m1.keys(), null);
+ InputMap m1p = m1.getParent();
+ harness.check(m1p, null);
+ InputMap m2 = tb.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ harness.check(m2.keys(), null);
+ InputMap m2p = m2.getParent();
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed UP")), "navigateUp");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_UP")),
+ "navigateUp");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed DOWN")),
+ "navigateDown");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_DOWN")),
+ "navigateDown");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed LEFT")),
+ "navigateLeft");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_LEFT")),
+ "navigateLeft");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed RIGHT")),
+ "navigateRight");
+ harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_RIGHT")),
+ "navigateRight");
+ InputMap m3 = tb.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ harness.check(m3.keys(), null);
+ harness.check(m3.getParent(), null);
+ }
+}