Changeset 10364 in josm for trunk/test


Ignore:
Timestamp:
2016-06-12T20:46:23+02:00 (8 years ago)
Author:
stoecker
Message:

gsoc-core - patch by Michael Zangl - see #12953 - remove deprecation usage

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java

    r10340 r10364  
    124124                Main.main.createMapFrame(null, null);
    125125            } else {
    126                 for (Layer l: Main.map.mapView.getAllLayers()) {
     126                for (Layer l: Main.getLayerManager().getLayers()) {
    127127                    Main.map.mapView.removeLayer(l);
    128128                }
  • trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java

    r10188 r10364  
    4747    @Test
    4848    public void testActionPerformedEnabled() {
    49         assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty());
     49        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
    5050        new AddImageryLayerAction(new ImageryInfo("foo_tms", "http://bar", "tms", null, null)).actionPerformed(null);
    51         List<TMSLayer> tmsLayers = Main.map.mapView.getLayersOfType(TMSLayer.class);
     51        List<TMSLayer> tmsLayers = Main.getLayerManager().getLayersOfType(TMSLayer.class);
    5252        assertEquals(1, tmsLayers.size());
    5353
     
    5555            new AddImageryLayerAction(new ImageryInfo("wms.openstreetmap.fr", "http://wms.openstreetmap.fr/wms?",
    5656                    "wms_endpoint", null, null)).actionPerformed(null);
    57             List<WMSLayer> wmsLayers = Main.map.mapView.getLayersOfType(WMSLayer.class);
     57            List<WMSLayer> wmsLayers = Main.getLayerManager().getLayersOfType(WMSLayer.class);
    5858            assertEquals(1, wmsLayers.size());
    5959
     
    6969    @Test
    7070    public void testActionPerformedDisabled() {
    71         assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty());
     71        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
    7272        new AddImageryLayerAction(new ImageryInfo()).actionPerformed(null);
    73         assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty());
     73        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
    7474    }
    7575}
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java

    r9943 r10364  
    5151    @Test
    5252    public void testExecuteUndoCommand() {
    53         OsmDataLayer layer = Main.map.mapView.getEditLayer();
     53        OsmDataLayer layer = Main.getLayerManager().getEditLayer();
    5454        Conflict<Node> conflict = new Conflict<>(new Node(), new Node());
    5555        ConflictAddCommand cmd = new ConflictAddCommand(layer, conflict);
     
    6767    @Test
    6868    public void testGetDescriptionIcon() {
    69         OsmDataLayer layer = Main.map.mapView.getEditLayer();
     69        OsmDataLayer layer = Main.getLayerManager().getEditLayer();
    7070        Conflict<Node> conflict = new Conflict<>(new Node(), new Node());
    7171        assertNotNull(new ConflictAddCommand(layer, conflict).getDescriptionIcon());
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java

    r9669 r10364  
    4949                        gpxLayer).run();
    5050                assertEquals(2, Main.map.mapView.getNumLayers());
    51                 GeoImageLayer layer = Main.map.mapView.getLayersOfType(GeoImageLayer.class).iterator().next();
     51                GeoImageLayer layer = Main.getLayerManager().getLayersOfType(GeoImageLayer.class).iterator().next();
    5252                try {
    5353                    assertEquals(gpxLayer, layer.getGpxLayer());
  • trunk/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java

    r10054 r10364  
    2323    public void testTicket12531() {
    2424        if (Main.map != null) {
    25             for (Layer l: Main.map.mapView.getAllLayers()) {
     25            for (Layer l: Main.getLayerManager().getLayers()) {
    2626                Main.map.mapView.removeLayer(l);
    2727            }
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java

    r9732 r10364  
    9595            newHandler("https://localhost?url=" + Utils.encodeUrl(url)).handle();
    9696        } finally {
    97             for (OsmDataLayer layer : Main.map.mapView.getLayersOfType(OsmDataLayer.class)) {
     97            for (OsmDataLayer layer : Main.getLayerManager().getLayersOfType(OsmDataLayer.class)) {
    9898                Main.main.removeLayer(layer);
    9999            }
  • trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java

    r10218 r10364  
    139139    public void testReadNotes() throws IOException, IllegalDataException {
    140140        if (Main.isDisplayingMapView()) {
    141             for (NoteLayer nl : Main.map.mapView.getLayersOfType(NoteLayer.class)) {
     141            for (NoteLayer nl : Main.getLayerManager().getLayersOfType(NoteLayer.class)) {
    142142                Main.map.mapView.removeLayer(nl);
    143143            }
Note: See TracChangeset for help on using the changeset viewer.