* Test that the adding of selection changed listeners works as expected.
*/
public void testAddSelectionChangedListener() throws Exception {
// Add a null listener.
manager.addSelectionChangedListener(null);
ListenerList listeners = getSelectionChangedListenersList();
assertNotNull(listeners);
assertTrue("List should be empty", listeners.isEmpty());
// Add a non-null listener.
final ISelectionChangedListener listener =
new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
}
};
manager.addSelectionChangedListener(listener);
listeners = getSelectionChangedListenersList();
assertNotNull(listeners);
assertEquals("List size should match", 1, listeners.size());
// Adding the same listener again shouldn't change the size.
manager.addSelectionChangedListener(listener);
listeners = getSelectionChangedListenersList();
assertNotNull(listeners);
assertEquals("List size should match", 1, listeners.size());
}