This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: AccessibleJInternalFrame - new tests


This patch (committed) adds some checks for the AccessibleJInternalFrame class:

2006-05-31 David Gilbert <david.gilbert@object-refinery.com>

* gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleName.java: New file,
* gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleRole.java: New file,
* gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleValue.java: New file,
* gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getCurrentAccessibleValue.java: New file,
* gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMaximumAccessibleValue.java: New file,
* gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMinimumAccessibleValue.java: New file,
* gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/setMaximumAccessibleValue.java: New file.


Regards,

Dave
Index: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleName.java
===================================================================
RCS file: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleName.java
diff -N gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleName.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleName.java	31 May 2006 14:22:29 -0000
@@ -0,0 +1,43 @@
+/* getAccessibleName.java -- some checks for the getAccessibleName() method 
+       in the AccessibleJInternalFrame 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.2
+
+package gnu.testlet.javax.swing.JInternalFrame.AccessibleJInternalFrame;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.accessibility.AccessibleContext;
+import javax.swing.JInternalFrame;
+
+public class getAccessibleName implements Testlet
+{
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    AccessibleContext ac = f.getAccessibleContext();
+    harness.check(ac.getAccessibleName(), "Title");
+    f.setTitle(null);
+    harness.check(ac.getAccessibleName(), null);    
+  }
+}
Index: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleRole.java
===================================================================
RCS file: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleRole.java
diff -N gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleRole.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleRole.java	31 May 2006 14:22:29 -0000
@@ -0,0 +1,42 @@
+/* getAccessibleRole.java -- some checks for the getAccessibleRole() method
+       in the AccessibleJInternalFrame 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.2
+
+package gnu.testlet.javax.swing.JInternalFrame.AccessibleJInternalFrame;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.swing.JInternalFrame;
+
+public class getAccessibleRole implements Testlet
+{
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    AccessibleContext ac = f.getAccessibleContext();
+    harness.check(ac.getAccessibleRole(), AccessibleRole.INTERNAL_FRAME);  
+  }
+}
Index: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleValue.java
===================================================================
RCS file: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleValue.java
diff -N gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleValue.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getAccessibleValue.java	31 May 2006 14:22:29 -0000
@@ -0,0 +1,42 @@
+/* getAccessibleValue.java -- some checks for the getAccessibleValue() method
+       in the AccessibleJInternalFrame 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.2
+
+package gnu.testlet.javax.swing.JInternalFrame.AccessibleJInternalFrame;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.accessibility.AccessibleContext;
+import javax.swing.JInternalFrame;
+
+public class getAccessibleValue implements Testlet 
+{
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    AccessibleContext ac = f.getAccessibleContext();
+    // the AccessibleContext implements the AccessibleValue interface
+    harness.check(ac.getAccessibleValue() == ac);
+  }
+}
Index: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getCurrentAccessibleValue.java
===================================================================
RCS file: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getCurrentAccessibleValue.java
diff -N gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getCurrentAccessibleValue.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getCurrentAccessibleValue.java	31 May 2006 14:22:29 -0000
@@ -0,0 +1,47 @@
+/* getCurrentAccessibleValue.java -- some checks for the 
+       getCurrentAccessibleValue() method in the AccessibleJInternalFrame 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.2
+
+package gnu.testlet.javax.swing.JInternalFrame.AccessibleJInternalFrame;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleValue;
+import javax.swing.JInternalFrame;
+import javax.swing.JLayeredPane;
+
+public class getCurrentAccessibleValue implements Testlet 
+{
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    AccessibleContext ac = f.getAccessibleContext();
+    AccessibleValue av = ac.getAccessibleValue();
+    // by trial and error I found that this is equal to the frame's layer
+    harness.check(av.getCurrentAccessibleValue(), JLayeredPane.DEFAULT_LAYER);
+    f.setLayer(JLayeredPane.PALETTE_LAYER);
+    harness.check(av.getCurrentAccessibleValue(), JLayeredPane.PALETTE_LAYER);
+  }
+}
Index: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMaximumAccessibleValue.java
===================================================================
RCS file: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMaximumAccessibleValue.java
diff -N gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMaximumAccessibleValue.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMaximumAccessibleValue.java	31 May 2006 14:22:29 -0000
@@ -0,0 +1,45 @@
+/* getMaximumAccessibleValue.java -- some checks for the 
+       getMaximumAccessibleValue() method in the AccessibleJInternalFrame 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.2
+
+package gnu.testlet.javax.swing.JInternalFrame.AccessibleJInternalFrame;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleValue;
+import javax.swing.JInternalFrame;
+
+public class getMaximumAccessibleValue implements Testlet 
+{
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    AccessibleContext ac = f.getAccessibleContext();
+    AccessibleValue av = ac.getAccessibleValue();
+    harness.check(av.getMaximumAccessibleValue(), 
+            new Integer(Integer.MAX_VALUE));  // not specified, but the ref
+                                              // impl returns this
+  }
+}
\ No newline at end of file
Index: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMinimumAccessibleValue.java
===================================================================
RCS file: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMinimumAccessibleValue.java
diff -N gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMinimumAccessibleValue.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/getMinimumAccessibleValue.java	31 May 2006 14:22:29 -0000
@@ -0,0 +1,45 @@
+/* getMinimumAccessibleValue.java -- some checks for the 
+       getMinimumAccessibleValue() method in the AccessibleJInternalFrame 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.2
+
+package gnu.testlet.javax.swing.JInternalFrame.AccessibleJInternalFrame;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleValue;
+import javax.swing.JInternalFrame;
+
+public class getMinimumAccessibleValue implements Testlet 
+{
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    AccessibleContext ac = f.getAccessibleContext();
+    AccessibleValue av = ac.getAccessibleValue();
+    harness.check(av.getMinimumAccessibleValue(), 
+            new Integer(Integer.MIN_VALUE));  // not specified, but the ref
+                                              // impl returns this
+  }
+}
\ No newline at end of file
Index: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/setCurrentAccessibleValue.java
===================================================================
RCS file: gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/setCurrentAccessibleValue.java
diff -N gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/setCurrentAccessibleValue.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JInternalFrame/AccessibleJInternalFrame/setCurrentAccessibleValue.java	31 May 2006 14:22:29 -0000
@@ -0,0 +1,67 @@
+/* setCurrentAccessibleValue.java -- some checks for the 
+       setCurrentAccessibleValue() method in the AccessibleJInternalFrame 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.2
+
+package gnu.testlet.javax.swing.JInternalFrame.AccessibleJInternalFrame;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleValue;
+import javax.swing.JInternalFrame;
+import javax.swing.JLayeredPane;
+import javax.swing.JInternalFrame.JDesktopIcon;
+
+public class setCurrentAccessibleValue 
+  implements Testlet, PropertyChangeListener
+{
+  PropertyChangeEvent lastEvent;
+  
+  public void propertyChange(PropertyChangeEvent event)
+  {
+    lastEvent = event;
+  }
+  
+  public void test(TestHarness harness)
+  {
+    JInternalFrame f = new JInternalFrame("Title");
+    JDesktopIcon icon = f.getDesktopIcon();
+    AccessibleContext ac = icon.getAccessibleContext();
+    AccessibleValue av = ac.getAccessibleValue();
+    
+    // by trial and error, I determined that the "value" is the frame's layer
+    harness.check(av.getCurrentAccessibleValue(), JLayeredPane.DEFAULT_LAYER);
+    ac.addPropertyChangeListener(this);
+    av.setCurrentAccessibleValue(JLayeredPane.PALETTE_LAYER);
+    harness.check(f.getLayer(), JLayeredPane.PALETTE_LAYER.intValue());
+    harness.check(lastEvent, null);  // no event is generated
+    
+    boolean set = av.setCurrentAccessibleValue(null);
+    harness.check(!set);
+    harness.check(f.getLayer(), JLayeredPane.PALETTE_LAYER.intValue());
+  }
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]