1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.layer.markerlayer;
|
---|
3 |
|
---|
4 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
---|
5 |
|
---|
6 | import java.net.MalformedURLException;
|
---|
7 | import java.net.URL;
|
---|
8 |
|
---|
9 | import org.junit.jupiter.api.BeforeAll;
|
---|
10 | import org.junit.jupiter.api.Test;
|
---|
11 | import org.openstreetmap.josm.JOSMFixture;
|
---|
12 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
13 | import org.openstreetmap.josm.data.gpx.GpxData;
|
---|
14 | import org.openstreetmap.josm.data.gpx.WayPoint;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Unit tests of {@link ImageMarker} class.
|
---|
18 | */
|
---|
19 | class ImageMarkerTest {
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Setup tests
|
---|
23 | */
|
---|
24 | @BeforeAll
|
---|
25 | public static void setUpBeforeClass() {
|
---|
26 | JOSMFixture.createUnitTestFixture().init();
|
---|
27 | }
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Unit test of {@link ImageMarker#ImageMarker}.
|
---|
31 | * @throws MalformedURLException never
|
---|
32 | */
|
---|
33 | @Test
|
---|
34 | void testImageMarker() throws MalformedURLException {
|
---|
35 | ImageMarker marker = new ImageMarker(
|
---|
36 | LatLon.ZERO,
|
---|
37 | new URL("file://something.jpg"),
|
---|
38 | new MarkerLayer(new GpxData(), null, null, null),
|
---|
39 | 1d, 2d);
|
---|
40 | marker.actionPerformed(null);
|
---|
41 | assertEquals("", marker.getText());
|
---|
42 | WayPoint wpt = marker.convertToWayPoint();
|
---|
43 | assertEquals(LatLon.ZERO, wpt.getCoor());
|
---|
44 | }
|
---|
45 | }
|
---|