Changeset 14125 in josm for trunk/test/unit/org
- Timestamp:
- 2018-08-11T19:01:26+02:00 (6 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r14120 r14125 151 151 } 152 152 153 @SuppressWarnings("deprecation")154 153 private void setupGUI() { 155 154 JOSMTestRules.cleanLayerEnvironment(); -
trunk/test/unit/org/openstreetmap/josm/MainTest.java
r14121 r14125 2 2 package org.openstreetmap.josm; 3 3 4 import static org.junit.Assert.assertFalse;5 4 import static org.junit.Assert.assertNotNull; 6 import static org.junit.Assert.assertTrue;7 5 8 6 import org.junit.Rule; 9 7 import org.junit.Test; 10 import org.openstreetmap.josm.Main.InitStatusListener;11 import org.openstreetmap.josm.Main.InitializationTask;12 8 import org.openstreetmap.josm.data.coor.conversion.CoordinateFormatManager; 13 9 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 35 31 assertNotNull(CoordinateFormatManager.getDefaultFormat()); 36 32 } 37 38 private static class InitStatusListenerStub implements InitStatusListener {39 40 boolean updated;41 boolean finished;42 43 @Override44 public Object updateStatus(String event) {45 updated = true;46 return null;47 }48 49 @Override50 public void finish(Object status) {51 finished = true;52 }53 }54 55 /**56 * Unit test of {@link Main#setInitStatusListener}.57 */58 @Test59 public void testSetInitStatusListener() {60 InitStatusListenerStub listener = new InitStatusListenerStub();61 Main.setInitStatusListener(listener);62 assertFalse(listener.updated);63 assertFalse(listener.finished);64 new InitializationTask("", () -> { }).call();65 assertTrue(listener.updated);66 assertTrue(listener.finished);67 }68 33 }
Note:
See TracChangeset
for help on using the changeset viewer.