source: josm/trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java@ 14503

Last change on this file since 14503 was 14503, checked in by Don-vip, 5 years ago

see #17064 - add non regression test

  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.tagging.ac;
3
4import org.junit.Rule;
5import org.junit.Test;
6import org.openstreetmap.josm.TestUtils;
7import org.openstreetmap.josm.data.osm.DataSet;
8import org.openstreetmap.josm.gui.MainApplication;
9import org.openstreetmap.josm.gui.layer.OsmDataLayer;
10import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager.UserInputTag;
11import org.openstreetmap.josm.testutils.JOSMTestRules;
12
13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
14import nl.jqno.equalsverifier.EqualsVerifier;
15
16/**
17 * Unit tests of {@link AutoCompletionManager} class.
18 */
19public class AutoCompletionManagerTest {
20
21 /**
22 * Setup rule
23 */
24 @Rule
25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
26 public JOSMTestRules test = new JOSMTestRules();
27
28 /**
29 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/17064">#17064</a>.
30 */
31 @Test
32 public void testTicket17064() {
33 DataSet ds = new DataSet();
34 OsmDataLayer layer = new OsmDataLayer(ds, "testTicket17064", null);
35 MainApplication.getLayerManager().addLayer(layer);
36 AutoCompletionManager.of(ds);
37 MainApplication.getLayerManager().removeLayer(layer); // NPE in #17064
38 }
39
40 /**
41 * Unit test of methods {@link UserInputTag#equals} and {@link UserInputTag#hashCode}.
42 */
43 @Test
44 public void testEqualsContract() {
45 TestUtils.assumeWorkingEqualsVerifier();
46 EqualsVerifier.forClass(UserInputTag.class).usingGetClass()
47 .verify();
48 }
49}
Note: See TracBrowser for help on using the repository browser.