source: josm/trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/WebMarkerTest.java@ 9814

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

add more unit tests

  • Property svn:eol-style set to native
File size: 1.2 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 WebMarker} class.
18 */
19public class WebMarkerTest {
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 WebMarker#WebMarker}.
31 * @throws MalformedURLException never
32 */
33 @Test
34 public void testWebMarker() throws MalformedURLException {
35 WebMarker marker = new WebMarker(
36 LatLon.ZERO,
37 new URL("http://something.com"),
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.