1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.layer;
|
---|
3 |
|
---|
4 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
---|
5 | import static org.junit.jupiter.api.Assertions.assertFalse;
|
---|
6 | import static org.junit.jupiter.api.Assertions.assertNotNull;
|
---|
7 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
---|
8 |
|
---|
9 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
10 | import org.junit.jupiter.api.Test;
|
---|
11 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
12 | import org.openstreetmap.josm.gui.MainApplication;
|
---|
13 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
14 |
|
---|
15 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Unit tests of {@link ValidatorLayer} class.
|
---|
19 | */
|
---|
20 | class ValidatorLayerTest {
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Setup tests
|
---|
24 | */
|
---|
25 | @RegisterExtension
|
---|
26 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
27 | public JOSMTestRules test = new JOSMTestRules().projection().main();
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Unit test of {@link ValidatorLayer#ValidatorLayer}.
|
---|
31 | */
|
---|
32 | @Test
|
---|
33 | void testValidatorLayer() {
|
---|
34 | MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));
|
---|
35 | ValidatorLayer layer = new ValidatorLayer();
|
---|
36 | MainApplication.getLayerManager().addLayer(layer);
|
---|
37 | assertFalse(layer.isMergable(null));
|
---|
38 | assertNotNull(layer.getIcon());
|
---|
39 | assertEquals("<html>No validation errors</html>", layer.getToolTipText());
|
---|
40 | assertEquals("<html>No validation errors</html>", layer.getInfoComponent());
|
---|
41 | assertTrue(layer.getMenuEntries().length > 0);
|
---|
42 | }
|
---|
43 | }
|
---|