Changeset 18614 in josm


Ignore:
Timestamp:
2022-12-13T14:25:40+01:00 (18 months ago)
Author:
taylor.smock
Message:

See #21605: Add tabs to ImageViewerDialog for use with different image layers

This fixes a broken test. This occurred because this was the only location where
GeoImageLayer was initialized with a null image list. We also needed to add
main() from JOSMTestRules due to initializing the image viewer in the
constructor, if no image viewer was already initialized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java

    r18037 r18614  
    44import static org.junit.jupiter.api.Assertions.assertThrows;
    55
     6import java.util.Collections;
     7
     8import org.junit.jupiter.api.extension.RegisterExtension;
    69import org.openstreetmap.josm.data.osm.DataSet;
    710import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     11import org.openstreetmap.josm.testutils.JOSMTestRules;
    812import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    913
     
    1620@BasicPreferences
    1721class GeoImageLayerTest {
     22    @RegisterExtension
     23    static JOSMTestRules josmTestRules = new JOSMTestRules().main();
    1824
    1925    /**
     
    2228    @Test
    2329    void testMergeFromIAE() {
    24         assertThrows(IllegalArgumentException.class, () -> new GeoImageLayer(null, null).mergeFrom(new OsmDataLayer(new DataSet(), "", null)));
     30        GeoImageLayer geoImageLayer = new GeoImageLayer(Collections.emptyList(), null);
     31        OsmDataLayer osmDataLayer = new OsmDataLayer(new DataSet(), "", null);
     32        assertThrows(IllegalArgumentException.class, () -> geoImageLayer.mergeFrom(osmDataLayer));
    2533    }
    2634}
Note: See TracChangeset for help on using the changeset viewer.