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: New tests for AccessibleJList


I committed a bunch of tests that I wrote while working on JList
accessibility support.

2005-10-18  Roman Kennke  <kennke@aicas.com>

        * gnu/testlet/javax/swing/JList/AccessibleJList/TestList.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/contentsChanged.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleChild.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleRole.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleStateSet.java
        * gnu/testlet/javax/swing/JList/AccessibleJList/intervalAdded.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/intervalRemoved.java
        * gnu/testlet/javax/swing/JList/AccessibleJList/valueChanged.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleRole.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleStateSet.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getBackground.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getCursor.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getFont.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getForeground.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isEnabled.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isFocusTraversable.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isShowing.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isVisible.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setBackground.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setCursor.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setEnabled.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setFont.java
        *
gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setForeground.java
        New tests.


/Roman
Index: gnu/testlet/javax/swing/JList/AccessibleJList/TestList.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/TestList.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/TestList.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/TestList.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,28 @@
+package gnu.testlet.javax.swing.JList.AccessibleJList;
+
+
+import javax.accessibility.AccessibleContext;
+import javax.swing.JList;
+
+/**
+ * Overrides JList in order to expose the AccssibleJList methods.
+ */
+public class TestList extends JList
+{
+  public TestList()
+  {
+    super();
+  }
+  public TestList(Object[] values)
+  {
+    super(values);
+  }
+  public class AccessibleTestList extends AccessibleJList
+  {
+  }
+  public AccessibleContext getAccessibleContext()
+  {
+    return new AccessibleTestList();
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/contentsChanged.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/contentsChanged.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/contentsChanged.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/contentsChanged.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,71 @@
+// Tags: JDK1.2
+
+// Uses: TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Vector;
+
+import javax.accessibility.AccessibleContext;
+import javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Checks the functionality of the method contentsChanged in
+ * javax.swing.JList.AccessibleJList. This method fires two
+ * PropertyChangeEvents, one with
+ * AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY and one with
+ * AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class contentsChanged implements Testlet, PropertyChangeListener
+{
+  Vector receivedEvents = new Vector();
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList();
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    al.addPropertyChangeListener(this);
+
+    ListDataEvent ev = new ListDataEvent(l, ListDataEvent.INTERVAL_ADDED, 1, 2);
+    receivedEvents.clear();
+    al.contentsChanged(ev);
+    harness.check(receivedEvents.size(), 1);
+    PropertyChangeEvent ev1 = (PropertyChangeEvent) receivedEvents.get(0);
+    harness.check(ev1.getPropertyName(),
+                  AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY);
+    harness.check(ev1.getSource(), al);
+    harness.check(ev1.getOldValue(), Boolean.FALSE);
+    harness.check(ev1.getNewValue(), Boolean.TRUE);
+  }
+
+  public void propertyChange(PropertyChangeEvent e) {
+    receivedEvents.add(e);
+  }
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleChild.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleChild.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleChild.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleChild.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,53 @@
+// Tags: JDK1.2
+
+// Uses: TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList;
+
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Tests if getAccessibleChild works correctly.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class getAccessibleChild implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"child"});
+    harness.check(l.getModel().getSize(), 1);
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    Accessible child1 = al.getAccessibleChild(0);
+    harness.check(child1 != null);
+    harness.check(child1 instanceof AccessibleComponent);
+    Accessible child2 = al.getAccessibleChild(1);
+    harness.check(child2 , null);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleRole.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleRole.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleRole.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleRole.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,50 @@
+// Tags: JDK1.2
+
+// Uses: TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList;
+
+import javax.accessibility.AccessibleRole;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Checks the functionality of the method getAccessibleRol in
+ * javax.swing.JList.AccessibleJList. This method should return
+ * AccessibleRole.LIST.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class getAccessibleRole implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList();
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleRole role = al.getAccessibleRole();
+    harness.check(role, AccessibleRole.LIST);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleStateSet.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleStateSet.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleStateSet.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/getAccessibleStateSet.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,61 @@
+// Tags: JDK1.2
+
+// Uses: TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList;
+
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+import javax.swing.ListSelectionModel;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Checks the functionality of the method getAccessibleStateSet of
+ * javax.swing.JList.AccessibleJList.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class getAccessibleStateSet implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList();
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+
+    l.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+    AccessibleStateSet ss = al.getAccessibleStateSet();
+    harness.check(ss.contains(AccessibleState.MULTISELECTABLE));
+
+    l.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+    ss = al.getAccessibleStateSet();
+    harness.check(ss.contains(AccessibleState.MULTISELECTABLE));
+
+    l.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+    ss = al.getAccessibleStateSet();
+    harness.check(! ss.contains(AccessibleState.MULTISELECTABLE));
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/intervalAdded.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/intervalAdded.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/intervalAdded.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/intervalAdded.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,70 @@
+// Tags: JDK1.2
+
+// Uses: TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+package gnu.testlet.javax.swing.JList.AccessibleJList;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Vector;
+
+import javax.accessibility.AccessibleContext;
+import javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Checks the functionality of the method intervalAdded in
+ * javax.swing.JList.AccessibleJList. This method fires two
+ * PropertyChangeEvents, one with
+ * AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY and one with
+ * AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class intervalAdded implements Testlet, PropertyChangeListener
+{
+  Vector receivedEvents = new Vector();
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList();
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    al.addPropertyChangeListener(this);
+
+    ListDataEvent ev = new ListDataEvent(l, ListDataEvent.INTERVAL_ADDED, 1, 2);
+    receivedEvents.clear();
+    al.intervalAdded(ev);
+    harness.check(receivedEvents.size(), 1);
+    PropertyChangeEvent ev1 = (PropertyChangeEvent) receivedEvents.get(0);
+    harness.check(ev1.getPropertyName(),
+                  AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY);
+    harness.check(ev1.getSource(), al);
+    harness.check(ev1.getOldValue(), Boolean.FALSE);
+    harness.check(ev1.getNewValue(), Boolean.TRUE);
+  }
+
+  public void propertyChange(PropertyChangeEvent e) {
+    receivedEvents.add(e);
+  }
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/intervalRemoved.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/intervalRemoved.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/intervalRemoved.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/intervalRemoved.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,70 @@
+// Tags: JDK1.2
+
+// Uses: TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+package gnu.testlet.javax.swing.JList.AccessibleJList;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Vector;
+
+import javax.accessibility.AccessibleContext;
+import javax.swing.event.ListDataEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Checks the functionality of the method intervalRemoved in
+ * javax.swing.JList.AccessibleJList. This method fires two
+ * PropertyChangeEvents, one with
+ * AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY and one with
+ * AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class intervalRemoved implements Testlet, PropertyChangeListener
+{
+  Vector receivedEvents = new Vector();
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList();
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    al.addPropertyChangeListener(this);
+
+    ListDataEvent ev = new ListDataEvent(l, ListDataEvent.INTERVAL_ADDED, 1, 2);
+    receivedEvents.clear();
+    al.intervalRemoved(ev);
+    harness.check(receivedEvents.size(), 1);
+    PropertyChangeEvent ev1 = (PropertyChangeEvent) receivedEvents.get(0);
+    harness.check(ev1.getPropertyName(),
+                  AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY);
+    harness.check(ev1.getSource(), al);
+    harness.check(ev1.getOldValue(), Boolean.FALSE);
+    harness.check(ev1.getNewValue(), Boolean.TRUE);
+  }
+
+  public void propertyChange(PropertyChangeEvent e) {
+    receivedEvents.add(e);
+  }
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/valueChanged.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/valueChanged.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/valueChanged.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/valueChanged.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,77 @@
+// Tags: JDK1.2
+
+// Uses: TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+package gnu.testlet.javax.swing.JList.AccessibleJList;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Vector;
+
+import javax.accessibility.AccessibleContext;
+import javax.swing.event.ListSelectionEvent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+/**
+ * Checks the functionality of the method valueChanged in
+ * javax.swing.JList.AccessibleJList. This method fires two
+ * PropertyChangeEvents, one with
+ * AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY and one with
+ * AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class valueChanged implements Testlet, PropertyChangeListener
+{
+
+  Vector receivedEvents = new Vector();
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList();
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    al.addPropertyChangeListener(this);
+    ListSelectionEvent ev = new ListSelectionEvent(l, 1, 2, true);
+    receivedEvents.clear();
+    al.valueChanged(ev);
+    harness.check(receivedEvents.size(), 2);
+    PropertyChangeEvent ev1 = (PropertyChangeEvent) receivedEvents.get(0);
+    harness.check(ev1.getPropertyName(),
+                  AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY);
+    harness.check(ev1.getSource(), al);
+    harness.check(ev1.getOldValue(), Boolean.FALSE);
+    harness.check(ev1.getNewValue(), Boolean.TRUE);
+    
+    PropertyChangeEvent ev2 = (PropertyChangeEvent) receivedEvents.get(1);
+    harness.check(ev2.getPropertyName(),
+                  AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY);
+    harness.check(ev2.getSource(), al);
+    harness.check(ev2.getOldValue(), Boolean.FALSE);
+    harness.check(ev2.getNewValue(), Boolean.TRUE);
+  }
+
+  public void propertyChange(PropertyChangeEvent e) {
+    receivedEvents.add(e);
+  }
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleRole.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleRole.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleRole.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleRole.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,45 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+public class getAccessibleRole implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleContext child = (AccessibleContext) al.getAccessibleChild(0);
+    harness.check(child.getAccessibleRole(), AccessibleRole.LABEL);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleStateSet.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleStateSet.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleStateSet.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getAccessibleStateSet.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,52 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import javax.accessibility.AccessibleComponent;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+public class getAccessibleStateSet implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleContext child = (AccessibleContext) al.getAccessibleChild(0);
+    AccessibleComponent childC = (AccessibleComponent) child;
+    AccessibleStateSet states;
+    // We test the visible state in isVisible.
+    // We test the showing state in isShowing.
+    states = child.getAccessibleStateSet();
+    harness.check(states.contains(AccessibleState.TRANSIENT));
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getBackground.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getBackground.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getBackground.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getBackground.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,56 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import java.awt.Color;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the method getBackground works correctly. This should return the
+ * background color of the actual list, since the background cannot be set on
+ * the list children individually.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class getBackground implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    l.setBackground(Color.RED);
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    harness.check(child.getBackground(), Color.RED);
+    l.setBackground(Color.GREEN);
+    harness.check(child.getBackground(), Color.GREEN);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getCursor.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getCursor.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getCursor.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getCursor.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,62 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import java.awt.Cursor;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the method getCursor works correctly. This should return the
+ * cursor set by setCursor, independent of the JList's cursor setting.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class getCursor implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    Cursor cursor1 = Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
+    Cursor cursor2 = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
+    l.setCursor(cursor1);
+    harness.check(l.getCursor(), cursor1);
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    harness.check(child.getCursor(), Cursor.getDefaultCursor());
+    l.setCursor(cursor2);
+    harness.check(child.getCursor(), Cursor.getDefaultCursor());
+
+    // Try if it reacts to setCursor().
+    child.setCursor(cursor1);
+    harness.check(child.getCursor(), cursor1);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getFont.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getFont.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getFont.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getFont.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,58 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import java.awt.Font;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the method getFont works correctly. This should return the
+ * font of the actual list, since the background cannot be set on
+ * the list children individually.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class getFont implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    Font font1 = new Font("Dialog", Font.PLAIN, 16);
+    Font font2 = new Font("Dialog", Font.BOLD, 12);
+    l.setFont(font1);
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    harness.check(child.getFont(), font1);
+    l.setFont(font2);
+    harness.check(child.getBackground(), font2);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getForeground.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getForeground.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getForeground.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/getForeground.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,56 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import java.awt.Color;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the method getForeground works correctly. This should return the
+ * foreground color of the actual list, since the foreground cannot be set on
+ * the list children individually.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class getForeground implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    l.setForeground(Color.RED);
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    harness.check(child.getForeground(), Color.RED);
+    l.setForeground(Color.GREEN);
+    harness.check(child.getForeground(), Color.GREEN);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isEnabled.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isEnabled.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isEnabled.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isEnabled.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,58 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the method isEnabled works correctly. This method should return
+ * the value of the enabled flag of the parent list.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class isEnabled implements Testlet
+{
+
+  /**
+   * Starts the test.
+   *
+   * @param harness the test harness to use
+   */
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    l.setEnabled(true);
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    harness.check(child.isEnabled(), true);
+    l.setEnabled(false);
+    harness.check(child.isEnabled(), false);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isFocusTraversable.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isFocusTraversable.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isFocusTraversable.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isFocusTraversable.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,47 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+public class isFocusTraversable implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    l.setFocusable(true);
+    harness.check(child.isFocusTraversable(), true);
+    l.setFocusable(false);
+    harness.check(child.isFocusTraversable(), true);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isShowing.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isShowing.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isShowing.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isShowing.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,112 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import javax.accessibility.AccessibleComponent;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the isShowing method works correctly. A list child is
+ * showing if it is visible and if it's parent JList is showing.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class isShowing implements Testlet
+{
+
+  /**
+   * Overridden to provide customized isShowing method. This is used to 
+   * check if the isShowing method of AccessibleJListChild forwards to
+   * the JList or not.
+   *
+   * @author Roman Kennke (kennke@aicas.com)
+   */
+  class MyTestList extends TestList
+  {
+    boolean showing;
+    int first;
+    int last;
+
+    /**
+     * Creates a new instance of MyTestList.
+     *
+     * @param items some test items
+     */
+    MyTestList(Object[] items)
+    {
+      super(items);
+    }
+    public boolean isShowing()
+    {
+      return showing;
+    }
+    public int getLastVisibleIndex()
+    {
+      return last;
+    }
+    public int getFirstVisibleIndex()
+    {
+      return first;
+    }
+  }
+
+  public void test(TestHarness harness)
+  {
+    MyTestList l = new MyTestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    AccessibleContext ctx = (AccessibleContext) child;
+    AccessibleStateSet states;
+    l.first = 0;
+    l.last = 0;
+    l.showing = true;
+    harness.check(child.isShowing(), true);
+    states = ctx.getAccessibleStateSet();
+    harness.check(states.contains(AccessibleState.SHOWING));
+    l.showing = false;
+    harness.check(child.isShowing(), false);
+    states = ctx.getAccessibleStateSet();
+    harness.check(!states.contains(AccessibleState.SHOWING));
+
+    // Make list child invisible. Should make isShowing false in all cases.
+    l.first = 1;
+    l.last = 1;
+    l.showing = true;
+    harness.check(child.isShowing(), false);
+    states = ctx.getAccessibleStateSet();
+    harness.check(!states.contains(AccessibleState.SHOWING));
+    l.showing = false;
+    harness.check(child.isShowing(), false);
+    states = ctx.getAccessibleStateSet();
+    harness.check(!states.contains(AccessibleState.SHOWING));
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isVisible.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isVisible.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isVisible.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/isVisible.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,119 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import javax.accessibility.AccessibleComponent;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the isVisible method works correctly. The value of
+ * isVisible depends on the values of JList.getFirstVisibleIndex and
+ * JList.getLastVisibleIndex.
+ *
+ * Additionally we check the accessible state set, if it reflects the visible
+ * state.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class isVisible implements Testlet
+{
+
+  /**
+   * Overridden to provide customized isVisible method. This is used to 
+   * check if the isVisible method of AccessibleJListChild forwards to
+   * the JList or not.
+   *
+   * @author Roman Kennke (kennke@aicas.com)
+   */
+  class MyTestList extends TestList
+  {
+    boolean visible;
+    int first;
+    int last;
+
+    /**
+     * Creates a new instance of MyTestList.
+     *
+     * @param items some test items
+     */
+    MyTestList(Object[] items)
+    {
+      super(items);
+    }
+    public boolean isVisible()
+    {
+      return visible;
+    }
+    public int getLastVisibleIndex()
+    {
+      return last;
+    }
+    public int getFirstVisibleIndex()
+    {
+      return first;
+    }
+  }
+
+  public void test(TestHarness harness)
+  {
+    MyTestList l = new MyTestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    l.visible = true;
+    harness.check(child.isVisible(), true);
+    l.visible = false;
+    harness.check(child.isVisible(), true);
+    harness.check(l.isVisible(), false);
+
+    // The above test show that isVisible is independent from the parent JList.
+    // Check if this reacts to child.setVisible() (It does not).
+    child.setVisible(true);
+    harness.check(child.isVisible(), true);
+    child.setVisible(false);
+    harness.check(child.isVisible(), true);
+
+    // The only thing left is that isVisible depends on the values
+    // of JList.getFirstVisibleIndex and JList.getLastVisibleIndex
+    AccessibleContext ctx = (AccessibleContext) child;
+    AccessibleStateSet states;
+    l.first = 0;
+    l.last = 0;
+    harness.check(child.isVisible(), true);
+    states = ctx.getAccessibleStateSet();
+    harness.check(states.contains(AccessibleState.VISIBLE));
+    l.first = 1;
+    l.last = 1;
+    harness.check(child.isVisible(), false);
+    states = ctx.getAccessibleStateSet();
+    harness.check(!states.contains(AccessibleState.VISIBLE));
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setBackground.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setBackground.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setBackground.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setBackground.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,57 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import java.awt.Color;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the setBackground method works correctly. This method must not have
+ * any effect, since the background color cannot be set for list children
+ * individually.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class setBackground implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    Color listBackground = l.getBackground();
+    child.setBackground(Color.RED);
+    harness.check(l.getBackground(), listBackground);
+    child.setBackground(Color.GREEN);
+    harness.check(l.getBackground(), listBackground);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setCursor.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setCursor.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setCursor.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setCursor.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,60 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import java.awt.Cursor;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the setCursor method works correctly. This method should store the
+ * cursor independent of the actual JList.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class setCursor implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    Cursor cursor = l.getCursor();
+    child.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
+    harness.check(l.getCursor(), cursor);
+    harness.check(child.getCursor(),
+                  Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
+    child.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+    harness.check(l.getCursor(), cursor);
+    harness.check(child.getCursor(),
+                  Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setEnabled.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setEnabled.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setEnabled.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setEnabled.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,55 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the setEnabled method works correctly. This method must not have
+ * any effect, since the enabled flag cannot be set for list children
+ * individually.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class setEnabled implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    boolean enabled = l.isEnabled();
+    child.setEnabled(false);
+    harness.check(l.isEnabled(), enabled);
+    child.setEnabled(true);
+    harness.check(l.isEnabled(), enabled);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setFont.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setFont.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setFont.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setFont.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,57 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import java.awt.Font;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the setBackground method works correctly. This method must not have
+ * any effect, since the background color cannot be set for list children
+ * individually.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class setFont implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    Font font = l.getFont();
+    child.setFont(new Font("Dialog", Font.PLAIN, 16));
+    harness.check(l.getFont(), font);
+    child.setFont(new Font("Dialog", Font.BOLD, 12));
+    harness.check(l.getFont(), font);
+  }
+
+}
Index: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setForeground.java
===================================================================
RCS file: gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setForeground.java
diff -N gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setForeground.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/javax/swing/JList/AccessibleJList/AccessibleJListChild/setForeground.java	18 Oct 2005 15:14:05 -0000
@@ -0,0 +1,57 @@
+// Tags: JDK1.2
+
+// Uses: ../TestList
+
+// Copyright (C) 2005 Roman Kennke <kennke@aicas.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, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package gnu.testlet.javax.swing.JList.AccessibleJList.AccessibleJListChild;
+
+import java.awt.Color;
+
+import javax.accessibility.AccessibleComponent;
+
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+import gnu.testlet.javax.swing.JList.AccessibleJList.TestList;
+
+/**
+ * Checks if the setForeground method works correctly. This method must not have
+ * any effect, since the foreground color cannot be set for list children
+ * individually.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class setForeground implements Testlet
+{
+
+  public void test(TestHarness harness)
+  {
+    TestList l = new TestList(new String[]{"item"});
+    TestList.AccessibleTestList al =
+      (TestList.AccessibleTestList) l.getAccessibleContext();
+    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
+    Color listForeground = l.getForeground();
+    child.setForeground(Color.RED);
+    harness.check(l.getForeground(), listForeground);
+    child.setForeground(Color.GREEN);
+    harness.check(l.getForeground(), listForeground);
+  }
+
+}

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