Changeset 14332 in josm for trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx
- Timestamp:
- 2018-10-14T17:30:28+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
r14138 r14332 3 3 4 4 import static java.util.concurrent.TimeUnit.MILLISECONDS; 5 import static org.junit.Assert.assertEquals; 5 6 import static org.junit.Assert.assertNotNull; 6 7 import static org.junit.Assert.assertNull; … … 10 11 import org.junit.Rule; 11 12 import org.junit.Test; 13 import org.openstreetmap.josm.actions.MergeLayerActionTest.MergeLayerExtendedDialogMocker; 12 14 import org.openstreetmap.josm.data.gpx.GpxData; 13 15 import org.openstreetmap.josm.gui.MainApplication; … … 15 17 import org.openstreetmap.josm.gui.layer.TMSLayer; 16 18 import org.openstreetmap.josm.gui.layer.gpx.DownloadWmsAlongTrackAction.PrecacheWmsTask; 19 import org.openstreetmap.josm.TestUtils; 17 20 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 21 import org.openstreetmap.josm.testutils.TileSourceRule; 22 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 23 24 import com.google.common.collect.ImmutableMap; 19 25 20 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 37 43 @Test 38 44 public void testNoLayer() { 45 TestUtils.assumeWorkingJMockit(); 46 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( 47 ImmutableMap.<String, Object>of("There are no imagery layers.", 0) 48 ); 49 39 50 assertNull(new DownloadWmsAlongTrackAction(new GpxData()).createTask()); 51 52 assertEquals(1, jopsMocker.getInvocationLog().size()); 53 Object[] invocationLogEntry = jopsMocker.getInvocationLog().get(0); 54 assertEquals(0, (int) invocationLogEntry[0]); 55 assertEquals("No imagery layers", invocationLogEntry[2]); 40 56 } 41 57 … … 46 62 @Test 47 63 public void testTMSLayer() throws Exception { 64 TestUtils.assumeWorkingJMockit(); 65 final MergeLayerExtendedDialogMocker edMocker = new MergeLayerExtendedDialogMocker(); 66 edMocker.getMockResultMap().put("Please select the imagery layer.", "Download"); 67 48 68 final TileSourceRule tileSourceRule = this.test.getTileSourceRule(); 49 69 … … 65 85 MainApplication.getLayerManager().removeLayer(layer); 66 86 } 87 88 assertEquals(1, edMocker.getInvocationLog().size()); 89 Object[] invocationLogEntry = edMocker.getInvocationLog().get(0); 90 assertEquals(1, (int) invocationLogEntry[0]); 91 assertEquals("Select imagery layer", invocationLogEntry[2]); 67 92 } 68 93 }
Note:
See TracChangeset
for help on using the changeset viewer.