}
public void test(TestHarness harness)
{
JButton component = new JButton("Button");
JToolTip tt = new JToolTip();
tt.addPropertyChangeListener(this);
tt.setComponent(component);
harness.check(tt.getComponent(), component);
// check the generated event...
harness.check(events.size(), 1);
PropertyChangeEvent e = (PropertyChangeEvent) events.get(0);
harness.check(e.getPropertyName(), "component");
harness.check(e.getSource(), tt);
harness.check(e.getOldValue(), null);
harness.check(e.getNewValue(), component);
// check that the component can be set to null
events.clear();
tt.setComponent(null);
harness.check(events.size(), 1);
e = (PropertyChangeEvent) events.get(0);
harness.check(e.getPropertyName(), "component");
harness.check(e.getSource(), tt);
harness.check(e.getOldValue(), component);