1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import java.io.FileInputStream;
|
---|
5 | import java.io.IOException;
|
---|
6 | import java.io.InputStream;
|
---|
7 |
|
---|
8 | import org.junit.BeforeClass;
|
---|
9 | import org.junit.Test;
|
---|
10 | import org.openstreetmap.josm.JOSMFixture;
|
---|
11 | import org.openstreetmap.josm.Main;
|
---|
12 | import org.openstreetmap.josm.TestUtils;
|
---|
13 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
14 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
15 | import org.openstreetmap.josm.io.IllegalDataException;
|
---|
16 | import org.openstreetmap.josm.io.OsmReader;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Unit tests of {@link JoinAreasAction} class.
|
---|
20 | */
|
---|
21 | public class JoinAreasActionTest {
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Setup test.
|
---|
25 | */
|
---|
26 | @BeforeClass
|
---|
27 | public static void setUp() {
|
---|
28 | JOSMFixture.createUnitTestFixture().init(true);
|
---|
29 | }
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Non-regression test for bug #10511.
|
---|
33 | * @throws IOException if any I/O error occurs
|
---|
34 | * @throws IllegalDataException if OSM parsing fails
|
---|
35 | */
|
---|
36 | @Test
|
---|
37 | public void testTicket10511() throws IOException, IllegalDataException {
|
---|
38 | try (InputStream is = new FileInputStream(TestUtils.getRegressionDataFile(10511, "10511_mini.osm"))) {
|
---|
39 | DataSet ds = OsmReader.parseDataSet(is, null);
|
---|
40 | Main.map.mapView.addLayer(new OsmDataLayer(ds, null, null));
|
---|
41 | // FIXME enable this test after we fix the bug. Test disabled for now
|
---|
42 | // new JoinAreasAction().join(ds.getWays());
|
---|
43 | }
|
---|
44 | }
|
---|
45 | }
|
---|