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

Last change on this file since 11241 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.gui.layer;
3
4import static org.junit.Assert.assertEquals;
5import static org.junit.Assert.assertFalse;
6import static org.junit.Assert.assertNotNull;
7import static org.junit.Assert.assertTrue;
8
9import org.junit.BeforeClass;
10import org.junit.Test;
11import org.openstreetmap.josm.JOSMFixture;
12import org.openstreetmap.josm.Main;
13
14/**
15 * Unit tests of {@link ValidatorLayer} class.
16 */
17public class ValidatorLayerTest {
18
19 /**
20 * Setup tests
21 */
22 @BeforeClass
23 public static void setUpBeforeClass() {
24 JOSMFixture.createUnitTestFixture().init(true);
25 }
26
27 /**
28 * Unit test of {@link ValidatorLayer#ValidatorLayer}.
29 */
30 @Test
31 public void testValidatorLayer() {
32 ValidatorLayer layer = null;
33 try {
34 layer = new ValidatorLayer();
35 Main.getLayerManager().addLayer(layer);
36 assertFalse(layer.isMergable(null));
37 assertNotNull(layer.getIcon());
38 assertEquals("<html>No validation errors</html>", layer.getToolTipText());
39 assertEquals("<html>No validation errors</html>", layer.getInfoComponent());
40 assertTrue(layer.getMenuEntries().length > 0);
41 } finally {
42 // Ensure we clean the place before leaving, even if test fails.
43 if (layer != null) {
44 Main.getLayerManager().removeLayer(layer);
45 }
46 }
47 }
48}
Note: See TracBrowser for help on using the repository browser.