Changeset 18927 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2023-12-27T22:09:21+01:00 (10 months ago)
Author:
taylor.smock
Message:

Fix #23316: MarkerLayer should return an empty list instead of a list with a single null value when the entry is null

File:
1 edited

Legend:

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

    r18870 r18927  
    77import static org.junit.jupiter.api.Assertions.assertTrue;
    88
     9import java.net.MalformedURLException;
     10import java.net.URI;
    911import java.util.Collections;
    1012
     
    9294        }
    9395    }
     96
     97    /**
     98     * Ensure that if a file is unable to be read, we return an empty list instead of a list with {@code null} in it.
     99     */
     100    @Test
     101    void testNonRegression23316() throws MalformedURLException {
     102        MarkerLayer layer = new MarkerLayer(new GpxData(), null, null, null);
     103        layer.setCurrentMarker(new ImageMarker(LatLon.ZERO, URI.create("file:/not_a_real_file_123456789.jpg").toURL(),
     104                layer, 0, 0));
     105        assertEquals(Collections.emptyList(), layer.getSelection());
     106    }
    94107}
Note: See TracChangeset for help on using the changeset viewer.