Changeset 12024 in josm for trunk


Ignore:
Timestamp:
2017-04-29T22:03:28+02:00 (8 years ago)
Author:
michael2402
Message:

See #14120: Fix unit tests by using a separate layer manager when mocking the map view.

Location:
trunk/test/unit/org/openstreetmap/josm/actions/mapmode
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/MapViewMock.java

    r11713 r12024  
    99import org.openstreetmap.josm.data.coor.EastNorth;
    1010import org.openstreetmap.josm.gui.MapView;
     11import org.openstreetmap.josm.gui.layer.MainLayerManager;
    1112
    1213class MapViewMock extends MapView {
    1314    MapViewMock() {
    14         super(Main.getLayerManager(), null);
     15        this(Main.getLayerManager());
     16    }
     17
     18    MapViewMock(MainLayerManager layerManager) {
     19        super(layerManager, null);
    1520    }
    1621
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java

    r11978 r12024  
    2323import org.openstreetmap.josm.data.osm.Way;
    2424import org.openstreetmap.josm.gui.MapFrame;
     25import org.openstreetmap.josm.gui.layer.MainLayerManager;
    2526import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2627import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    4142            Field mv = SelectAction.class.getDeclaredField("mv");
    4243            Utils.setObjectsAccessible(mv);
    43             mv.set(this, new MapViewMock());
     44            mv.set(this, new MapViewMock(new MainLayerManager()));
    4445        }
    4546
Note: See TracChangeset for help on using the changeset viewer.