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.BeforeClass;
|
---|
9 | import org.junit.Test;
|
---|
10 | import org.openstreetmap.josm.JOSMFixture;
|
---|
11 | import org.openstreetmap.josm.data.Bounds;
|
---|
12 | import org.openstreetmap.josm.data.DataSource;
|
---|
13 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * Unit tests of the {@code Node} class.
|
---|
17 | */
|
---|
18 | public class NodeTest {
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Setup test.
|
---|
22 | */
|
---|
23 | @BeforeClass
|
---|
24 | public static void setUpBeforeClass() {
|
---|
25 | JOSMFixture.createUnitTestFixture().init();
|
---|
26 | }
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Non-regression test for ticket #12060.
|
---|
30 | */
|
---|
31 | @Test
|
---|
32 | public void testTicket12060() {
|
---|
33 | DataSet ds = new DataSet();
|
---|
34 | ds.dataSources.add(new DataSource(new Bounds(LatLon.ZERO), null));
|
---|
35 | Node n = new Node(1, 1);
|
---|
36 | n.setCoor(LatLon.ZERO);
|
---|
37 | ds.addPrimitive(n);
|
---|
38 | n.setCoor(null);
|
---|
39 | assertFalse(n.isNewOrUndeleted());
|
---|
40 | assertNotNull(ds.getDataSourceArea());
|
---|
41 | assertNull(n.getCoor());
|
---|
42 | assertFalse(n.isOutsideDownloadArea());
|
---|
43 | }
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.