Last change
on this file since 12636 was 12636, checked in by Don-vip, 7 years ago |
see #15182 - deprecate Main.getLayerManager() . Replacement: gui.MainApplication.getLayerManager()
|
-
Property svn:eol-style
set to
native
|
File size:
1.3 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.junit.Assert.assertNotNull;
|
---|
5 | import static org.junit.Assert.assertNull;
|
---|
6 |
|
---|
7 | import org.junit.Rule;
|
---|
8 | import org.junit.Test;
|
---|
9 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
10 | import org.openstreetmap.josm.gui.MainApplication;
|
---|
11 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
12 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
13 |
|
---|
14 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Unit tests for class {@link DeleteLayerAction}.
|
---|
18 | */
|
---|
19 | public final class DeleteLayerActionTest {
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Setup test.
|
---|
23 | */
|
---|
24 | @Rule
|
---|
25 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
26 | public JOSMTestRules test = new JOSMTestRules().platform();
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Unit test of {@link DeleteLayerAction#actionPerformed}
|
---|
30 | */
|
---|
31 | @Test
|
---|
32 | public void testActionPerformed() {
|
---|
33 | DeleteLayerAction action = new DeleteLayerAction();
|
---|
34 | // No layer
|
---|
35 | action.actionPerformed(null);
|
---|
36 | // OsmDataLayer
|
---|
37 | OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
|
---|
38 | MainApplication.getLayerManager().addLayer(layer);
|
---|
39 | assertNotNull(MainApplication.getLayerManager().getActiveLayer());
|
---|
40 | action.actionPerformed(null);
|
---|
41 | assertNull(MainApplication.getLayerManager().getActiveLayer());
|
---|
42 | }
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.