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.
|
---|
2 | package org.openstreetmap.josm.data.osm;
|
---|
3 |
|
---|
4 | import static org.junit.Assert.assertFalse;
|
---|
5 | import static org.junit.Assert.assertNotNull;
|
---|
6 | import static org.junit.Assert.assertNull;
|
---|
7 |
|
---|
8 | import org.junit.Rule;
|
---|
9 | import org.junit.Test;
|
---|
10 | import org.openstreetmap.josm.data.Bounds;
|
---|
11 | import org.openstreetmap.josm.data.DataSource;
|
---|
12 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
13 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
14 |
|
---|
15 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Unit tests of the {@code Node} class.
|
---|
19 | */
|
---|
20 | public 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.