source: josm/trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java@ 14165

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

fix #16652 - validator dialog: display multiple OSM primitives like in other dialogs

File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.validation.util;
3
4import static org.junit.Assert.assertEquals;
5
6import java.util.Arrays;
7
8import org.junit.Rule;
9import org.junit.Test;
10import org.openstreetmap.josm.TestUtils;
11import org.openstreetmap.josm.data.osm.Way;
12import org.openstreetmap.josm.testutils.JOSMTestRules;
13
14import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
15
16/**
17 * Unit tests for class {@link MultipleNameVisitor}.
18 */
19public class MultipleNameVisitorTest {
20
21 /**
22 * Setup test.
23 */
24 @Rule
25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
26 public JOSMTestRules test = new JOSMTestRules().preferences();
27
28 /**
29 * Non-regression test for bug #11967.
30 */
31 @Test
32 public void testTicket11967() {
33 MultipleNameVisitor visitor = new MultipleNameVisitor();
34 visitor.visit(Arrays.asList(new Way(), new Way()));
35 assertEquals("2 ways: ‎0‎ (0 nodes), ‎0‎ (0 nodes)", visitor.toString());
36 }
37
38 /**
39 * Non-regression test for bug #16652.
40 */
41 @Test
42 public void testTicket16652() {
43 MultipleNameVisitor visitor = new MultipleNameVisitor();
44 visitor.visit(Arrays.asList(
45 TestUtils.newNode("name=foo"),
46 TestUtils.newWay("addr:housename=Stark"),
47 TestUtils.newRelation("type=route")));
48 assertEquals("3 objects: foo, ‎House Stark‎ (0 nodes), route (0, 0 members)", visitor.toString());
49 }
50}
Note: See TracBrowser for help on using the repository browser.