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

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

see #12229 - revert r9785 and r9803: problem with audio unit test was unrelated

  • Property svn:eol-style set to native
File size: 1.5 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.Extensions;
14import org.openstreetmap.josm.data.gpx.GpxConstants;
15import org.openstreetmap.josm.data.gpx.GpxData;
16import org.openstreetmap.josm.data.gpx.WayPoint;
17
18/**
19 * Unit tests of {@link AudioMarker} class.
20 */
21public class AudioMarkerTest {
22
23 /**
24 * Setup tests
25 */
26 @BeforeClass
27 public static void setUpBeforeClass() {
28 JOSMFixture.createUnitTestFixture().init();
29 }
30
31 /**
32 * Unit test of {@link AudioMarker#AudioMarker}.
33 * @throws MalformedURLException never
34 */
35 @Test
36 public void testAudioMarker() throws MalformedURLException {
37 URL url = new URL("file://something.wav");
38 AudioMarker marker = new AudioMarker(
39 LatLon.ZERO,
40 null,
41 url,
42 new MarkerLayer(new GpxData(), null, null, null),
43 1d, 2d);
44 assertEquals(url, marker.url());
45 assertEquals("2", marker.getText());
46 WayPoint wpt = marker.convertToWayPoint();
47 assertEquals(LatLon.ZERO, wpt.getCoor());
48 Extensions ext = (Extensions) wpt.get(GpxConstants.META_EXTENSIONS);
49 assertEquals("2.0", ext.get("offset"));
50 }
51}
Note: See TracBrowser for help on using the repository browser.