source: josm/trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java@ 9130

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

javadoc fixes

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.validation.tests;
3
4import static org.CustomMatchers.isEmpty;
5import static org.junit.Assert.assertThat;
6
7import java.io.FileInputStream;
8import java.io.FileNotFoundException;
9import java.io.IOException;
10import java.io.InputStream;
11
12import org.junit.Before;
13import org.junit.Test;
14import org.openstreetmap.josm.JOSMFixture;
15import org.openstreetmap.josm.data.osm.DataSet;
16import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
17import org.openstreetmap.josm.io.IllegalDataException;
18import org.openstreetmap.josm.io.OsmReader;
19
20/**
21 * Unit tests of {@code UnconnectedWays} class.
22 */
23public class UnconnectedWaysTest {
24
25 private UnconnectedWays bib;
26
27 /**
28 * Setup test.
29 * @throws Exception if the test cannot be initialized
30 */
31 @Before
32 public void setUp() throws Exception {
33 bib = new UnconnectedWays.UnconnectedHighways();
34 JOSMFixture.createUnitTestFixture().init();
35 bib.initialize();
36 bib.startTest(null);
37 }
38
39 /**
40 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/6313">Bug #6313</a>.
41 * @throws IOException if any I/O error occurs
42 * @throws IllegalDataException if the OSM data cannot be parsed
43 * @throws FileNotFoundException if the data file cannot be found
44 */
45 @Test
46 public void testTicket6313() throws IOException, IllegalDataException, FileNotFoundException {
47 try (InputStream fis = new FileInputStream("data_nodist/UnconnectedWaysTest.osm")) {
48 final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
49 bib.visit(ds.allPrimitives());
50 bib.endTest();
51 assertThat(bib.getErrors(), isEmpty());
52 }
53 }
54}
Note: See TracBrowser for help on using the repository browser.