Changeset 18035 in josm for trunk/test
- Timestamp:
- 2021-07-15T23:53:07+02:00 (3 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
r17275 r18035 2 2 package org.openstreetmap.josm.gui.layer.geoimage; 3 3 4 import static org.junit.jupiter.api.Assertions.assertEquals;5 import static org.junit.jupiter.api.Assertions.assertTrue;6 4 import static org.junit.jupiter.api.Assertions.assertThrows; 7 8 import java.io.File;9 import java.io.InputStream;10 import java.util.Collections;11 import java.util.List;12 5 13 6 import org.junit.jupiter.api.Test; 14 7 import org.junit.jupiter.api.extension.RegisterExtension; 15 import org.openstreetmap.josm.TestUtils;16 8 import org.openstreetmap.josm.data.osm.DataSet; 17 import org.openstreetmap.josm.gui.MainApplication;18 import org.openstreetmap.josm.gui.layer.GpxLayer;19 9 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 20 import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer.Loader;21 import org.openstreetmap.josm.io.GpxReader;22 10 import org.openstreetmap.josm.testutils.JOSMTestRules; 23 11 … … 36 24 37 25 /** 38 * Unit test of {@link Loader} class.39 * @throws Exception if any error occurs40 */41 @Test42 void testLoader() throws Exception {43 try (InputStream in = TestUtils.getRegressionDataStream(12255, "bobrava2.gpx")) {44 GpxReader reader = new GpxReader(in);45 assertTrue(reader.parse(true));46 GpxLayer gpxLayer = new GpxLayer(reader.getGpxData());47 MainApplication.getLayerManager().addLayer(gpxLayer);48 assertEquals(1, MainApplication.getLayerManager().getLayers().size());49 new Loader(50 Collections.singleton(new File(TestUtils.getRegressionDataFile(12255, "G0016941.JPG"))),51 gpxLayer).run();52 assertEquals(2, MainApplication.getLayerManager().getLayers().size());53 GeoImageLayer layer = MainApplication.getLayerManager().getLayersOfType(GeoImageLayer.class).iterator().next();54 assertEquals(gpxLayer, layer.getGpxLayer());55 List<ImageEntry> images = layer.getImages();56 assertEquals(1, images.size());57 assertEquals("<html>1 image loaded. 0 were found to be GPS tagged.</html>", layer.getInfoComponent());58 assertEquals("<html>1 image loaded. 0 were found to be GPS tagged.</html>", layer.getToolTipText());59 }60 }61 62 /**63 26 * Test that {@link GeoImageLayer#mergeFrom} throws IAE for invalid arguments 64 27 */
Note:
See TracChangeset
for help on using the changeset viewer.