source: josm/trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java@ 18037

Last change on this file since 18037 was 17275, checked in by Don-vip, 3 years ago

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

  • 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;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5import static org.junit.jupiter.api.Assertions.assertFalse;
6import static org.junit.jupiter.api.Assertions.assertNotNull;
7import static org.junit.jupiter.api.Assertions.assertTrue;
8
9import org.junit.jupiter.api.extension.RegisterExtension;
10import org.junit.jupiter.api.Test;
11import org.openstreetmap.josm.data.osm.DataSet;
12import org.openstreetmap.josm.gui.MainApplication;
13import org.openstreetmap.josm.testutils.JOSMTestRules;
14
15import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
16
17/**
18 * Unit tests of {@link ValidatorLayer} class.
19 */
20class 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}
Note: See TracBrowser for help on using the repository browser.