source: josm/trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java@ 10436

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

see #13001 - replace calls to Main.main.[add|remove]Layer by Main.getLayerManager().[add|remove]Layer

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions.mapmode;
3
4import static org.junit.Assert.assertEquals;
5import static org.junit.Assert.assertTrue;
6
7import org.junit.BeforeClass;
8import org.junit.Test;
9import org.openstreetmap.josm.JOSMFixture;
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.data.osm.DataSet;
12import org.openstreetmap.josm.gui.layer.OsmDataLayer;
13
14/**
15 * Unit tests for class {@link ImproveWayAccuracyAction}.
16 */
17public class ImproveWayAccuracyActionTest {
18
19 /**
20 * Setup test.
21 */
22 @BeforeClass
23 public static void setUp() {
24 JOSMFixture.createUnitTestFixture().init(true);
25 }
26
27 /**
28 * Unit test of {@link ImproveWayAccuracyAction#enterMode} and {@link ImproveWayAccuracyAction#exitMode}.
29 */
30 @Test
31 public void testMode() {
32 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
33 try {
34 Main.getLayerManager().addLayer(layer);
35 ImproveWayAccuracyAction mapMode = new ImproveWayAccuracyAction(Main.map);
36 MapMode oldMapMode = Main.map.mapMode;
37 assertTrue(Main.map.selectMapMode(mapMode));
38 assertEquals(mapMode, Main.map.mapMode);
39 assertTrue(Main.map.selectMapMode(oldMapMode));
40 } finally {
41 Main.getLayerManager().removeLayer(layer);
42 }
43 }
44}
Note: See TracBrowser for help on using the repository browser.