source: josm/trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java@ 9782

Last change on this file since 9782 was 9779, checked in by Don-vip, 8 years ago

add more unit tests

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.layer.markerlayer;
3
4import static org.junit.Assert.assertEquals;
5
6import java.net.MalformedURLException;
7import java.net.URL;
8
9import org.junit.BeforeClass;
10import org.junit.Test;
11import org.openstreetmap.josm.JOSMFixture;
12import org.openstreetmap.josm.data.coor.LatLon;
13import org.openstreetmap.josm.data.gpx.GpxData;
14import org.openstreetmap.josm.data.gpx.WayPoint;
15
16/**
17 * Unit tests of {@link ImageMarker} class.
18 */
19public class ImageMarkerTest {
20
21 /**
22 * Setup tests
23 */
24 @BeforeClass
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 public 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}
Note: See TracBrowser for help on using the repository browser.