source: josm/trunk/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java@ 10945

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

convert more unit tests to JOSMTestRules

File size: 1.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.osm;
3
4import static org.junit.Assert.assertFalse;
5import static org.junit.Assert.assertNotNull;
6import static org.junit.Assert.assertNull;
7
8import org.junit.Rule;
9import org.junit.Test;
10import org.openstreetmap.josm.data.Bounds;
11import org.openstreetmap.josm.data.DataSource;
12import org.openstreetmap.josm.data.coor.LatLon;
13import org.openstreetmap.josm.testutils.JOSMTestRules;
14
15import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
16
17/**
18 * Unit tests of the {@code Node} class.
19 */
20public class NodeTest {
21
22 /**
23 * Setup test.
24 */
25 @Rule
26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
27 public JOSMTestRules test = new JOSMTestRules();
28
29 /**
30 * Non-regression test for ticket #12060.
31 */
32 @Test
33 public void testTicket12060() {
34 DataSet ds = new DataSet();
35 ds.dataSources.add(new DataSource(new Bounds(LatLon.ZERO), null));
36 Node n = new Node(1, 1);
37 n.setCoor(LatLon.ZERO);
38 ds.addPrimitive(n);
39 n.setCoor(null);
40 assertFalse(n.isNewOrUndeleted());
41 assertNotNull(ds.getDataSourceArea());
42 assertNull(n.getCoor());
43 assertFalse(n.isOutsideDownloadArea());
44 }
45}
Note: See TracBrowser for help on using the repository browser.