*
* @param harness the test harness (<code>null</code> not permitted).
*/
public void test(TestHarness harness)
{
JSlider slider = new JSlider(5, 10);
harness.check(slider.getMinimum(), 5);
harness.check(slider.getMaximum(), 10);
harness.check(slider.getValue(), 7);
slider.setValue(6);
harness.check(slider.getValue(), 6);
slider.setValue(4);
harness.check(slider.getValue(), 5);
// confirm that this fires a change event
MyChangeListener listener1 = new MyChangeListener();
slider.addChangeListener(listener1);
MyPropertyChangeListener listener2 = new MyPropertyChangeListener();
slider.addPropertyChangeListener(listener2);
slider.setValue(6);
harness.check(listener1.event.getSource(), slider);
harness.check(listener2.event, null);
// if the value doesn't change, there is no event
listener1.event = null;
slider.setValue(6);
harness.check(listener1.event, null);
}