Changeset 15354 in josm for trunk/test


Ignore:
Timestamp:
2019-09-17T09:15:17+02:00 (5 years ago)
Author:
GerdP
Message:

fix #18137: NPE in UnconnectedWays

Location:
trunk/test
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java

    r15335 r15354  
    22package org.openstreetmap.josm.data.validation.tests;
    33
     4import static org.CustomMatchers.hasSize;
    45import static org.CustomMatchers.isEmpty;
    56import static org.junit.Assert.assertThat;
     
    6061
    6162    /**
    62      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/6313">Bug #18051</a>.
     63     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/18051">Bug #18051</a>.
    6364     * @throws IOException if any I/O error occurs
    6465     * @throws IllegalDataException if the OSM data cannot be parsed
     
    8081
    8182    /**
    82      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/6313">Bug #18106</a>.
     83     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/18136">Bug #18106</a>.
    8384     * @throws IOException if any I/O error occurs
    8485     * @throws IllegalDataException if the OSM data cannot be parsed
     
    9899        }
    99100    }
     101
     102    /**
     103     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/18137">Bug #18137</a>.
     104     * @throws IOException if any I/O error occurs
     105     * @throws IllegalDataException if the OSM data cannot be parsed
     106     * @throws FileNotFoundException if the data file cannot be found
     107     */
     108    @Test
     109    public void testTicket18137() throws IOException, IllegalDataException, FileNotFoundException {
     110        try (InputStream fis = TestUtils.getRegressionDataStream(18137, "18137_npe.osm")) {
     111            final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
     112            MainApplication.getLayerManager().addLayer(new OsmDataLayer(ds, null, null));
     113
     114            bib.startTest(null);
     115            bib.setBeforeUpload(true);
     116            bib.visit(ds.allPrimitives());
     117            bib.endTest();
     118            assertThat(bib.getErrors(), hasSize(2));
     119        }
     120    }
    100121}
Note: See TracChangeset for help on using the changeset viewer.