source: josm/trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateNodeTest.java@ 7937

Last change on this file since 7937 was 7937, checked in by bastiK, 9 years ago

add subversion property svn:eol=native

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.validation.tests;
3
4import static org.junit.Assert.assertEquals;
5
6import org.junit.BeforeClass;
7import org.junit.Test;
8import org.openstreetmap.josm.JOSMFixture;
9import org.openstreetmap.josm.data.coor.LatLon;
10import org.openstreetmap.josm.data.osm.DataSet;
11import org.openstreetmap.josm.data.osm.Node;
12import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
13
14/**
15 * JUnit Test of "Duplicate node" validation test.
16 */
17public class DuplicateNodeTest {
18
19 /**
20 * Setup test by initializing JOSM preferences and projection.
21 */
22 @BeforeClass
23 public static void setUp() {
24 JOSMFixture.createUnitTestFixture().init();
25 }
26
27 /**
28 * Test of "Duplicate node" validation test.
29 */
30 @Test
31 public void test() {
32 DataSet ds = new DataSet();
33
34 Node a = new Node(new LatLon(10.0, 5.0));
35 Node b = new Node(new LatLon(10.0, 5.0));
36 ds.addPrimitive(a);
37 ds.addPrimitive(b);
38
39 DuplicateNode test = new DuplicateNode();
40 test.startTest(NullProgressMonitor.INSTANCE);
41 test.visit(ds.allPrimitives());
42 test.endTest();
43
44 assertEquals(1, test.getErrors().size());
45 }
46}
Note: See TracBrowser for help on using the repository browser.