Ignore:
Timestamp:
2016-04-02T15:00:31+02:00 (9 years ago)
Author:
donvip
Message:

fix #josm12714 - robustness against invalid SHP files

Location:
applications/editors/josm/plugins/opendata/test
Files:
6 added
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReaderTest.java

    r30573 r32139  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.opendata.core.io.geographic;
     3
     4import static org.junit.Assert.assertNotNull;
    35
    46import java.io.File;
     
    1416import org.openstreetmap.josm.JOSMFixture;
    1517import org.openstreetmap.josm.TestUtils;
     18import org.openstreetmap.josm.data.osm.Node;
    1619import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1720
     
    2831        JOSMFixture.createUnitTestFixture().init();
    2932    }
    30    
     33
     34    /**
     35     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12714">#12714/a>
     36     * @throws IOException if an error occurs during reading
     37     */
     38    @Test
     39    public void testTicket12714() throws IOException, XMLStreamException, FactoryConfigurationError {
     40        File file = new File(TestUtils.getRegressionDataFile(12714, "linhas.shp"));
     41        try (InputStream is = new FileInputStream(file)) {
     42            for (Node n : ShpReader.parseDataSet(is, file, null, null).getNodes()) {
     43                assertNotNull(n.toString(), n.getCoor());
     44            }
     45        }
     46    }
     47
    3148    /**
    3249     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/10214">#10214</a>
Note: See TracChangeset for help on using the changeset viewer.