harness.check(ac.getAccessibleIcon(), null);
harness.check(ac.getAccessibleTable(), null);
harness.check(ac.getAccessibleText(), null);
// the AccessibleContext is also the AccessibleValue...
AccessibleValue av = ac.getAccessibleValue();
harness.check(av, ac);
harness.check(av.getCurrentAccessibleValue(), new Integer(50));
harness.check(av.getMinimumAccessibleValue(), new Integer(10));
harness.check(av.getMaximumAccessibleValue(), new Integer(90));
// check that setting the accessible value updates the slider
ac.addPropertyChangeListener(this);
boolean b = av.setCurrentAccessibleValue(new Integer(55));
harness.check(progressBar.getValue(), 55);
harness.check(b);
harness.check(events.size(), 1);
PropertyChangeEvent e0 = (PropertyChangeEvent) events.get(0);
harness.check(e0.getPropertyName(),
AccessibleContext.ACCESSIBLE_VALUE_PROPERTY);
harness.check(e0.getSource(), ac);
harness.check(e0.getOldValue(), new Integer(50));
harness.check(e0.getNewValue(), new Integer(55));
// set the value below the minimum
events.clear();
b = av.setCurrentAccessibleValue(new Integer(5));
harness.check(av.getCurrentAccessibleValue(), new Integer(10));
harness.check(b);
harness.check(events.size(), 1);
e0 = (PropertyChangeEvent) events.get(0);
harness.check(e0.getPropertyName(),
AccessibleContext.ACCESSIBLE_VALUE_PROPERTY);
harness.check(e0.getSource(), ac);
harness.check(e0.getOldValue(), new Integer(55));
harness.check(e0.getNewValue(), new Integer(10));
// set the value above the maximum
events.clear();
b = av.setCurrentAccessibleValue(new Integer(105));
harness.check(av.getCurrentAccessibleValue(), new Integer(90));
harness.check(b);
harness.check(events.size(), 1);
e0 = (PropertyChangeEvent) events.get(0);
harness.check(e0.getPropertyName(),
AccessibleContext.ACCESSIBLE_VALUE_PROPERTY);
harness.check(e0.getSource(), ac);
harness.check(e0.getOldValue(), new Integer(10));
harness.check(e0.getNewValue(), new Integer(90));
// set the value to null
events.clear();
b = av.setCurrentAccessibleValue(null);
harness.check(av.getCurrentAccessibleValue(), new Integer(90));
harness.check(events.size(), 0);
harness.check(!b);
// check the state settings...
AccessibleStateSet set = ac.getAccessibleStateSet();