Ignore:
Timestamp:
2023-01-16T16:52:10+01:00 (15 months ago)
Author:
taylor.smock
Message:

Fix #22638: NoSuchFileException can occur when a gpx track points at non-existent images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java

    r18593 r18634  
    22package org.openstreetmap.josm.gui.layer.markerlayer;
    33
     4import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
    45import static org.junit.jupiter.api.Assertions.assertEquals;
    56
     
    4041        assertEquals(LatLon.ZERO, wpt.getCoor());
    4142    }
     43
     44    /**
     45     * Non-regression test for #22638: NoSuchFileException causes a crash
     46     */
     47    @Test
     48    void testTicket22638() throws MalformedURLException {
     49        ImageMarker marker = new ImageMarker(
     50                LatLon.ZERO,
     51                new File(TestUtils.getRegressionDataFile(12255, "no_such.jpg")).toURI().toURL(),
     52                new MarkerLayer(new GpxData(), null, null, null),
     53                1d, 2d);
     54        assertDoesNotThrow(() -> marker.actionPerformed(null));
     55    }
    4256}
Note: See TracChangeset for help on using the changeset viewer.