Ticket #17177: 17177.windows_test_fix_2.patch

File 17177.windows_test_fix_2.patch, 1.5 KB (added by taylor.smock, 5 years ago)

Avoid using methods which use File.separator instead of /

  • test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java

    diff --git a/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java b/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java
    index 461feffa0..28274ea69 100644
    a b public class MapboxVectorStyleTest {  
    161161        // Ensure that we don't have images saved in the ImageProvider cache
    162162        ImageProvider.clearCache();
    163163        int hiDpiScalar = hiDpi ? 2 : 1;
    164         String spritePath = new File(this.spritesDirectory, "sprite").getPath();
     164        String spritePath = this.spritesDirectory + "/sprite";
    165165        MapboxVectorStyle style = new MapboxVectorStyle(getJson(JsonObject.class,
    166166          MessageFormat.format(BASE_STYLE, "sprite_test", "\"sprite\":\"file:/" + spritePath + "\"")));
    167167        assertEquals("file:/" + spritePath, style.getSpriteUrl());
    public class MapboxVectorStyleTest {  
    237237
    238238    @Test
    239239    void testMapillaryStyle() {
    240         final String file = Paths.get("file:", TestUtils.getTestDataRoot(), "mapillary.json").toString();
     240        final String file = "file:/" + TestUtils.getTestDataRoot() + "/mapillary.json";
    241241        final MapboxVectorStyle style = MapboxVectorStyle.getMapboxVectorStyle(file);
    242242        assertNotNull(style);
    243243        // There are three "sources" in the mapillary.json file