Changeset 10396 in josm for trunk/test/unit/org
- Timestamp:
- 2016-06-16T12:38:56+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r10364 r10396 125 125 } else { 126 126 for (Layer l: Main.getLayerManager().getLayers()) { 127 Main. map.mapView.removeLayer(l);127 Main.getLayerManager().removeLayer(l); 128 128 } 129 129 } -
trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
r10373 r10396 54 54 assertEquals(1, wmsLayers.size()); 55 55 56 Main. map.mapView.removeLayer(wmsLayers.get(0));56 Main.getLayerManager().removeLayer(wmsLayers.get(0)); 57 57 } finally { 58 Main. map.mapView.removeLayer(tmsLayers.get(0));58 Main.getLayerManager().removeLayer(tmsLayers.get(0)); 59 59 } 60 60 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
r10225 r10396 56 56 Field mapView = MapFrame.class.getDeclaredField("mapView"); 57 57 Utils.setObjectsAccessible(mapView); 58 mapView.set(Main.map, new MapViewMock( dataSet, layer));58 mapView.set(Main.map, new MapViewMock()); 59 59 60 60 Node n1 = new Node(new EastNorth(0, 0)); -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/MapViewMock.java
r10342 r10396 8 8 import org.openstreetmap.josm.Main; 9 9 import org.openstreetmap.josm.data.coor.EastNorth; 10 import org.openstreetmap.josm.data.osm.DataSet;11 10 import org.openstreetmap.josm.gui.MapView; 12 import org.openstreetmap.josm.gui.layer.Layer;13 import org.openstreetmap.josm.gui.layer.OsmDataLayer;14 11 15 12 class MapViewMock extends MapView { 16 private final transient OsmDataLayer layer; 17 private final transient DataSet currentDataSet; 18 19 MapViewMock(DataSet dataSet, OsmDataLayer layer) { 13 MapViewMock() { 20 14 super(Main.getLayerManager(), null, null); 21 this.layer = layer;22 this.currentDataSet = dataSet;23 15 } 24 16 … … 52 44 return p != null ? new Point2D.Double(p.getX(), p.getY()) : null; 53 45 } 54 55 @Override56 public void setActiveLayer(Layer layer) {}57 58 @Override59 public Layer getActiveLayer() {60 return layer;61 }62 63 @Override64 protected DataSet getCurrentDataSet() {65 return currentDataSet;66 }67 46 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
r10225 r10396 55 55 Field mv = SelectAction.class.getDeclaredField("mv"); 56 56 Utils.setObjectsAccessible(mv); 57 mv.set(this, new MapViewMock( dataSet, layer));57 mv.set(this, new MapViewMock()); 58 58 } catch (ReflectiveOperationException e) { 59 59 e.printStackTrace(); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java
r10300 r10396 40 40 assertFalse(action.isEnabled()); 41 41 42 Main. map.mapView.addLayer(layer);42 Main.getLayerManager().addLayer(layer); 43 43 action.updateEnabledState(); 44 44 assertTrue(action.isEnabled()); … … 87 87 88 88 } finally { 89 Main. map.mapView.removeLayer(layer);89 Main.getLayerManager().removeLayer(layer); 90 90 } 91 91 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
r10386 r10396 58 58 } finally { 59 59 // Ensure we clean the place before leaving, even if test fails. 60 Main. map.mapView.removeLayer(layer);60 Main.getLayerManager().removeLayer(layer); 61 61 } 62 62 } finally { -
trunk/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java
r10364 r10396 24 24 if (Main.map != null) { 25 25 for (Layer l: Main.getLayerManager().getLayers()) { 26 Main. map.mapView.removeLayer(l);26 Main.getLayerManager().removeLayer(l); 27 27 } 28 28 Main.main.setMapFrame(null); -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r10364 r10396 140 140 if (Main.isDisplayingMapView()) { 141 141 for (NoteLayer nl : Main.getLayerManager().getLayersOfType(NoteLayer.class)) { 142 Main. map.mapView.removeLayer(nl);142 Main.getLayerManager().removeLayer(nl); 143 143 } 144 144 }
Note:
See TracChangeset
for help on using the changeset viewer.