Changeset 14247 in josm for trunk/test


Ignore:
Timestamp:
2018-09-12T00:54:12+02:00 (15 months ago)
Author:
Don-vip
Message:

remove stuff deprecated in June. RIP SelectionChangedListener

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java

    r13925 r14247  
    1212import org.junit.Test;
    1313import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
    14 import org.openstreetmap.josm.data.SelectionChangedListener;
    1514import org.openstreetmap.josm.data.osm.DataSelectionListener;
    1615import org.openstreetmap.josm.data.osm.OsmPrimitive;
    17 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
    1816import org.openstreetmap.josm.gui.MainApplication;
    1917import org.openstreetmap.josm.gui.util.GuiHelper;
     
    2725 * @since 12048
    2826 */
    29 @SuppressWarnings("deprecation")
    3027public class SelectionEventManagerTest {
    31     private final class SelectionListener implements SelectionChangedListener, DataSelectionListener {
     28    private final class SelectionListener implements DataSelectionListener {
    3229        private Collection<? extends OsmPrimitive> newSelection;
    3330        private final String name;
     
    3532        SelectionListener(String name) {
    3633            this.name = name;
    37         }
    38 
    39         @Override
    40         public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
    41             this.newSelection = newSelection;
    4234        }
    4335
     
    6557        assertEquals(testData1.layer, MainApplication.getLayerManager().getEditLayer());
    6658
    67         SelectionListener listener1 = new SelectionListener("IMMEDIATELY");
    68         SelectionListener listener2 = new SelectionListener("IN_EDT_CONSOLIDATED");
    6959        SelectionListener listener3 = new SelectionListener("normal");
    7060        SelectionListener listener4 = new SelectionListener("edt");
    7161        SelectionEventManager instance = SelectionEventManager.getInstance();
    72         instance.addSelectionListener(listener1, FireMode.IMMEDIATELY);
    73         instance.addSelectionListener(listener2, FireMode.IN_EDT_CONSOLIDATED);
    7462        instance.addSelectionListener(listener3);
    7563        instance.addSelectionListenerForEdt(listener4);
    76         List<SelectionListener> listeners = Arrays.asList(listener1, listener2, listener3, listener4);
     64        List<SelectionListener> listeners = Arrays.asList(listener3, listener4);
    7765        assertSelectionEquals(listeners, null);
    7866
     
    9987
    10088        // removal
    101         instance.removeSelectionListener((SelectionChangedListener) listener1);
    102         instance.removeSelectionListener((SelectionChangedListener) listener2);
    103         instance.removeSelectionListener((DataSelectionListener) listener3);
    104         instance.removeSelectionListener((DataSelectionListener) listener4);
     89        instance.removeSelectionListener(listener3);
     90        instance.removeSelectionListener(listener4);
    10591
    10692        // no event triggered now
Note: See TracChangeset for help on using the changeset viewer.