Changeset 18807 in josm for trunk/test/unit
- Timestamp:
- 2023-08-15T15:16:08+02:00 (16 months ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/SessionLoadActionTest.java
r17275 r18807 4 4 import static org.junit.jupiter.api.Assertions.assertFalse; 5 5 6 import org.junit.jupiter.api.extension.RegisterExtension;7 6 import org.junit.jupiter.api.Test; 8 7 import org.openstreetmap.josm.data.imagery.ImageryInfo; 9 8 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 10 9 import org.openstreetmap.josm.gui.layer.TMSLayer; 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 12 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 10 import org.openstreetmap.josm.testutils.annotations.Main; 11 import org.openstreetmap.josm.testutils.annotations.Projection; 14 12 15 13 /** 16 14 * Unit tests for class {@link SessionLoadAction}. 17 15 */ 16 @Main 17 @Projection 18 18 class SessionLoadActionTest { 19 20 /**21 * Setup test.22 */23 @RegisterExtension24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")25 public JOSMTestRules test = new JOSMTestRules().main().projection();26 27 19 /** 28 20 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17702">Bug #17702</a>. -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r18690 r18807 15 15 import java.util.List; 16 16 17 import org.junit.jupiter.api.extension.RegisterExtension;18 17 import org.junit.jupiter.api.Test; 19 18 import org.openstreetmap.josm.TestUtils; 20 19 import org.openstreetmap.josm.data.coor.EastNorth; 20 import org.openstreetmap.josm.data.osm.Node; 21 21 import org.openstreetmap.josm.gui.MainApplication; 22 22 import org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer; … … 28 28 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 29 29 import org.openstreetmap.josm.io.IllegalDataException; 30 import org.openstreetmap.josm.testutils.JOSMTestRules; 31 32 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 30 import org.openstreetmap.josm.testutils.annotations.Projection; 33 31 34 32 /** 35 33 * Unit tests for Session reading. 36 34 */ 35 @Projection 37 36 class SessionReaderTest { 38 39 /**40 * Setup tests.41 */42 @RegisterExtension43 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")44 public JOSMTestRules test = new JOSMTestRules().projection();45 46 37 private static String getSessionDataDir() { 47 38 return TestUtils.getTestDataRoot() + "/sessions"; … … 161 152 } 162 153 154 @Test 155 void testReadGeojson() throws IOException, IllegalDataException { 156 final List<Layer> layers = testRead("geojson.jos"); 157 assertEquals(1, layers.size()); 158 final OsmDataLayer osmDataLayer = assertInstanceOf(OsmDataLayer.class, layers.get(0)); 159 assertEquals("Geojson layer name", osmDataLayer.getName()); 160 assertEquals(1, osmDataLayer.getDataSet().allPrimitives().size()); 161 final Node node = assertInstanceOf(Node.class, osmDataLayer.getDataSet().allPrimitives().iterator().next()); 162 assertEquals(2d, node.lat(), 1e-9); 163 assertEquals(1d, node.lon(), 1e-9); 164 assertEquals("Test point", node.get("name")); 165 } 166 163 167 /** 164 168 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17701">Bug #17701</a>.
Note:
See TracChangeset
for help on using the changeset viewer.