Changeset 19249 in josm for trunk/test
- Timestamp:
- 2024-10-22T19:40:35+02:00 (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java
r18895 r19249 7 7 import java.io.File; 8 8 import java.net.MalformedURLException; 9 import java.net.URI; 10 import java.net.URL; 9 11 10 12 import org.junit.jupiter.api.AfterEach; … … 17 19 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 18 20 import org.openstreetmap.josm.testutils.annotations.Main; 21 import org.openstreetmap.josm.tools.PlatformManager; 19 22 20 23 /** … … 60 63 assertDoesNotThrow(() -> marker.actionPerformed(null)); 61 64 } 65 66 /** 67 * Windows does not like {@code :} to appear multiple times in a path. 68 * @throws MalformedURLException if the URI fails to create and convert to a URL. 69 */ 70 @Test 71 void testNonRegression23978() throws MalformedURLException { 72 final URL testURL; 73 if (PlatformManager.isPlatformWindows()) { 74 // This throws the InvalidPathException (subclass of IllegalArgumentException), and is what the initial problem was. 75 testURL = URI.create("file:/c:/foo/c:/bar/image.jpg").toURL(); 76 } else { 77 // This throws an IllegalArgumentException. 78 testURL = new URL("file:/foobar/image.jpg#hashtagForIAE"); 79 } 80 ImageMarker imageMarker = new ImageMarker(LatLon.ZERO, testURL, 81 new MarkerLayer(new GpxData(), null, null, null), 0, 0); 82 assertDoesNotThrow(() -> imageMarker.actionPerformed(null)); 83 } 62 84 }
Note:
See TracChangeset
for help on using the changeset viewer.