Ignore:
Timestamp:
2017-08-25T01:37:31+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate shortcut handling and mapframe listener methods in Main. Replacement: same methods in gui.MainApplication

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/MainTest.java

    r12637 r12639  
    88import static org.junit.Assert.assertTrue;
    99
    10 import java.awt.event.KeyEvent;
    1110import java.net.MalformedURLException;
    1211import java.net.URL;
     
    1817import org.openstreetmap.josm.Main.InitStatusListener;
    1918import org.openstreetmap.josm.Main.InitializationTask;
    20 import org.openstreetmap.josm.actions.AboutAction;
    21 import org.openstreetmap.josm.gui.MapFrameListener;
    2219import org.openstreetmap.josm.io.OnlineResource;
    2320import org.openstreetmap.josm.testutils.JOSMTestRules;
    24 import org.openstreetmap.josm.tools.Shortcut;
    2521
    2622import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    125121    }
    126122
    127     /**
    128      * Unit test of {@link Main#getRegisteredActionShortcut}.
    129      */
    130     @Test
    131     public void testGetRegisteredActionShortcut() {
    132         Shortcut noKeystroke = Shortcut.registerShortcut("no", "keystroke", 0, 0);
    133         assertNull(noKeystroke.getKeyStroke());
    134         assertNull(Main.getRegisteredActionShortcut(noKeystroke));
    135         Shortcut noAction = Shortcut.registerShortcut("foo", "bar", KeyEvent.VK_AMPERSAND, Shortcut.SHIFT);
    136         assertNotNull(noAction.getKeyStroke());
    137         assertNull(Main.getRegisteredActionShortcut(noAction));
    138         AboutAction about = new AboutAction();
    139         assertEquals(about, Main.getRegisteredActionShortcut(about.getShortcut()));
    140     }
    141 
    142     /**
    143      * Unit test of {@link Main#addMapFrameListener} and {@link Main#removeMapFrameListener}.
    144      */
    145     @Test
    146     public void testMapFrameListener() {
    147         MapFrameListener listener = (o, n) -> { };
    148         assertTrue(Main.addMapFrameListener(listener));
    149         assertFalse(Main.addMapFrameListener(null));
    150         assertTrue(Main.removeMapFrameListener(listener));
    151         assertFalse(Main.removeMapFrameListener(null));
    152     }
    153 
    154123    private static class InitStatusListenerStub implements InitStatusListener {
    155124
Note: See TracChangeset for help on using the changeset viewer.