|
Last change
on this file was 18837, checked in by taylor.smock, 2 years ago |
|
Fix #23057: An invisible layer should not become active when removing a layer
|
-
Property svn:eol-style
set to
native
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file.
|
|---|
| 2 | package org.openstreetmap.josm.actions;
|
|---|
| 3 |
|
|---|
| 4 | import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|---|
| 5 | import static org.junit.jupiter.api.Assertions.assertNull;
|
|---|
| 6 |
|
|---|
| 7 | import org.junit.jupiter.api.Test;
|
|---|
| 8 | import org.openstreetmap.josm.data.osm.DataSet;
|
|---|
| 9 | import org.openstreetmap.josm.gui.MainApplication;
|
|---|
| 10 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
|---|
| 11 | import org.openstreetmap.josm.testutils.annotations.Main;
|
|---|
| 12 | import org.openstreetmap.josm.testutils.annotations.Projection;
|
|---|
| 13 |
|
|---|
| 14 | /**
|
|---|
| 15 | * Unit tests for class {@link DeleteLayerAction}.
|
|---|
| 16 | */
|
|---|
| 17 | @Main
|
|---|
| 18 | @Projection
|
|---|
| 19 | final class DeleteLayerActionTest {
|
|---|
| 20 | /**
|
|---|
| 21 | * Unit test of {@link DeleteLayerAction#actionPerformed}
|
|---|
| 22 | */
|
|---|
| 23 | @Test
|
|---|
| 24 | void testActionPerformed() {
|
|---|
| 25 | DeleteLayerAction action = new DeleteLayerAction();
|
|---|
| 26 | // No layer
|
|---|
| 27 | action.actionPerformed(null);
|
|---|
| 28 | // OsmDataLayer
|
|---|
| 29 | OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
|
|---|
| 30 | MainApplication.getLayerManager().addLayer(layer);
|
|---|
| 31 | assertNotNull(MainApplication.getLayerManager().getActiveLayer());
|
|---|
| 32 | action.actionPerformed(null);
|
|---|
| 33 | assertNull(MainApplication.getLayerManager().getActiveLayer());
|
|---|
| 34 | }
|
|---|
| 35 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.