Changeset 12639 in josm for trunk/test/unit/org/openstreetmap/josm/MainTest.java
- Timestamp:
- 2017-08-25T01:37:31+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/MainTest.java
r12637 r12639 8 8 import static org.junit.Assert.assertTrue; 9 9 10 import java.awt.event.KeyEvent;11 10 import java.net.MalformedURLException; 12 11 import java.net.URL; … … 18 17 import org.openstreetmap.josm.Main.InitStatusListener; 19 18 import org.openstreetmap.josm.Main.InitializationTask; 20 import org.openstreetmap.josm.actions.AboutAction;21 import org.openstreetmap.josm.gui.MapFrameListener;22 19 import org.openstreetmap.josm.io.OnlineResource; 23 20 import org.openstreetmap.josm.testutils.JOSMTestRules; 24 import org.openstreetmap.josm.tools.Shortcut;25 21 26 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 125 121 } 126 122 127 /**128 * Unit test of {@link Main#getRegisteredActionShortcut}.129 */130 @Test131 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 @Test146 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 154 123 private static class InitStatusListenerStub implements InitStatusListener { 155 124
Note:
See TracChangeset
for help on using the changeset viewer.