* @param harness the test harness (<code>null</code> not permitted).
*/
public void test(TestHarness harness)
{
JFileChooser fc = new JFileChooser();
FileFilter acceptAllFilter = fc.getAcceptAllFileFilter();
fc.addPropertyChangeListener(this);
harness.check(fc.isAcceptAllFileFilterUsed(), true);
MyFileFilter f1 = new MyFileFilter(true);
fc.addChoosableFileFilter(f1);
events.clear();
fc.setAcceptAllFileFilterUsed(false);
harness.check(fc.isAcceptAllFileFilterUsed(), false);
harness.check(events.size(), 2);
PropertyChangeEvent e1 = (PropertyChangeEvent) events.get(0);
harness.check(e1.getPropertyName(),
JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY);
FileFilter[] oldFilters = (FileFilter[]) e1.getOldValue();
harness.check(oldFilters.length, 2);
harness.check(oldFilters[0], acceptAllFilter);
harness.check(oldFilters[1], f1);
FileFilter[] newFilters = (FileFilter[]) e1.getNewValue();
harness.check(newFilters.length, 1);
harness.check(newFilters[0], f1);
PropertyChangeEvent e2 = (PropertyChangeEvent) events.get(1);
harness.check(e2.getPropertyName(),
JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY);
// also check if the 'accept all' filter is removed from the choosable
// filters list
FileFilter[] filters = fc.getChoosableFileFilters();
harness.check(filters.length, 1);
harness.check(filters[0], f1);
events.clear();
FileFilter ff = new MyFileFilter(false);
fc.addChoosableFileFilter(ff);
events.clear();
harness.check(fc.getFileFilter(), ff);
fc.setAcceptAllFileFilterUsed(true);
harness.check(fc.isAcceptAllFileFilterUsed(), true);