Changeset 35899 in osm


Ignore:
Timestamp:
2022-01-25T01:04:25+01:00 (2 years ago)
Author:
Don-vip
Message:

fix #21767 - Update deprecated functions in opendata (patch by taylor.smock)

Location:
applications/editors/josm/plugins/opendata
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/.settings/org.eclipse.jdt.ui.prefs

    r32545 r35899  
    11eclipse.preferences.version=1
    22editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
    3 formatter_profile=_JOSM
    43formatter_settings_version=12
    54sp_cleanup.add_default_serial_version_id=true
  • applications/editors/josm/plugins/opendata/build.xml

    r35513 r35899  
    11<?xml version="1.0" encoding="utf-8"?>
    22<project name="opendata" default="dist" basedir=".">
    3     <property name="plugin.main.version" value="16799"/>
     3    <property name="plugin.main.version" value="16838"/>
    44    <property name="plugin.author" value="Don-vip"/>
    55    <property name="plugin.class" value="org.openstreetmap.josm.plugins.opendata.OdPlugin"/>
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/SimpleDataSetHandler.java

    r34661 r35899  
    1616
    1717import org.openstreetmap.josm.data.osm.IPrimitive;
     18import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1819import org.openstreetmap.josm.data.osm.Tag;
    1920import org.openstreetmap.josm.data.projection.Projection;
    20 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    2121import org.openstreetmap.josm.plugins.opendata.core.OdConstants;
    2222import org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi;
     23import org.openstreetmap.josm.tools.ImageResource;
     24import org.openstreetmap.josm.tools.OsmPrimitiveImageProvider;
    2325
    2426public abstract class SimpleDataSetHandler extends AbstractDataSetHandler {
     
    4547            tag = new Tag(relevantTag);
    4648        }
    47         setMenuIcon(MapPaintStyles.getNodeIcon(tag));
     49        OsmPrimitiveImageProvider.getResource(tag.getKey(), tag.getValue(), OsmPrimitiveType.NODE)
     50                .map(ImageResource::getImageIcon).ifPresent(this::setMenuIcon);
    4851    }
    4952
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/NonRegFunctionalTests.java

    r35183 r35899  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.opendata.core.io;
    3 
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
    73
    84import java.io.IOException;
     
    2319import org.openstreetmap.josm.tools.CheckParameterUtil;
    2420
     21import static org.junit.jupiter.api.Assertions.assertEquals;
     22import static org.junit.jupiter.api.Assertions.assertFalse;
     23import static org.junit.jupiter.api.Assertions.assertNotNull;
     24import static org.junit.jupiter.api.Assertions.assertTrue;
     25
    2526/**
    2627 * Superclass of non-reg functional tests.
     
    3738        // Every dataset should at least contain a node
    3839        Collection<Node> nodes = ds.getNodes();
    39         assertFalse("No nodes in dataset for "+context, nodes.isEmpty());
     40        assertFalse(nodes.isEmpty(), "No nodes in dataset for "+context);
    4041        // Nodes should all have valid coordinates
    4142        for (Node n : nodes) {
    4243            LatLon latlon = n.getCoor();
    43             assertTrue("Node without coordinate found for "+context, latlon != null);
    44             assertTrue("Node with invalid coordinate ("+latlon+") found for "+context, latlon.isValid());
    45             assertFalse("Node with outside world coordinate ("+latlon+") found for "+context, n.isOutSideWorld());
     44            assertNotNull(latlon, "Node without coordinate found for " + context);
     45            assertTrue(latlon.isValid(), "Node with invalid coordinate ("+latlon+") found for "+context);
     46            assertFalse(n.isOutSideWorld(), "Node with outside world coordinate ("+latlon+") found for "+context);
    4647        }
    4748        // and no empty ways
    4849        for (Way w : ds.getWays()) {
    49             assertTrue("Empty way found for "+context, w.getNodesCount() > 0);
     50            assertTrue(w.getNodesCount() > 0, "Empty way found for "+context);
    5051        }
    5152        // neither empty relations
    5253        for (Relation r : ds.getRelations()) {
    53             assertTrue("Empty relation found for "+context, r.getMembersCount() > 0);
     54            assertTrue(r.getMembersCount() > 0, "Empty relation found for "+context);
    5455        }
    5556    }
     
    7778     * @param ext file extension to search for
    7879     * @return all datasets files matching given extension
    79      * @returns List of all datasets files matching given extension
    8080     * @throws IOException in case of I/O error
    8181     */
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipReaderTest.java

    r33518 r35899  
    88import java.util.Map.Entry;
    99
    10 import org.junit.Rule;
    11 import org.junit.Test;
     10import org.junit.jupiter.api.Test;
     11import org.junit.jupiter.api.extension.RegisterExtension;
    1212import org.openstreetmap.josm.data.osm.DataSet;
    1313import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1414import org.openstreetmap.josm.testutils.JOSMTestRules;
     15import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1516import org.openstreetmap.josm.tools.Logging;
    1617
     
    1819 * Unit tests of {@link ZipReader} class.
    1920 */
    20 public class ZipReaderTest {
     21@BasicPreferences
     22class ZipReaderTest {
    2123
    2224    /**
    2325     * Setup test.
    2426     */
    25     @Rule
    26     public JOSMTestRules rules = new JOSMTestRules().preferences().projection().noTimeout();
     27    @RegisterExtension
     28    public JOSMTestRules rules = new JOSMTestRules().projection().noTimeout();
    2729
    2830    /**
     
    3133     */
    3234    @Test
    33     public void testReadZipFiles() throws Exception {
     35    void testReadZipFiles() throws Exception {
    3436        for (Path p : NonRegFunctionalTests.listDataFiles("zip")) {
    3537            File zipfile = p.toFile();
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/datasets/DataSetUpdaterTest.java

    r33388 r35899  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.opendata.core.io.datasets;
    3 
    4 import static org.junit.Assert.assertFalse;
    5 import static org.junit.Assert.assertTrue;
    63
    74import java.io.File;
     
    107import java.util.function.Predicate;
    118
    12 import org.junit.Rule;
    13 import org.junit.Test;
     9import org.junit.jupiter.api.Test;
     10import org.junit.jupiter.api.extension.RegisterExtension;
    1411import org.openstreetmap.josm.TestUtils;
    1512import org.openstreetmap.josm.data.osm.DataSet;
     
    1916import org.openstreetmap.josm.plugins.opendata.core.io.archive.ZipReader;
    2017import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     19
     20import static org.junit.jupiter.api.Assertions.assertFalse;
     21import static org.junit.jupiter.api.Assertions.assertTrue;
    2122
    2223/**
    2324 * Unit tests of {@link DataSetUpdater} class.
    2425 */
    25 public class DataSetUpdaterTest {
     26@BasicPreferences
     27class DataSetUpdaterTest {
    2628
    2729    /**
    2830     * Setup test.
    2931     */
    30     @Rule
    31     public JOSMTestRules rules = new JOSMTestRules().preferences().projection().devAPI().timeout(60000);
     32    @RegisterExtension
     33    JOSMTestRules rules = new JOSMTestRules().projection().devAPI().timeout(60000);
    3234
    3335    /**
     
    3638     */
    3739    @Test
    38     public void testTicket11166() throws Exception {
     40    void testTicket11166() throws Exception {
    3941        File file = new File(TestUtils.getRegressionDataFile(11166, "raba760dissJosm.zip"));
    4042        try (InputStream is = new FileInputStream(file)) {
    4143            Predicate<? super Way> p = w -> w.getNodesCount() >= 0.9 * OsmApi.getOsmApi().getCapabilities().getMaxWayNodes();
    4244            DataSet ds = ZipReader.parseDataSet(is, null, null, false);
    43             assertTrue(ds.getWays().stream().filter(p).findAny().isPresent());
     45            assertTrue(ds.getWays().stream().anyMatch(p));
    4446            DataSetUpdater.updateDataSet(ds, null, file);
    45             assertFalse(ds.getWays().stream().filter(p).findAny().isPresent());
     47            assertFalse(ds.getWays().stream().anyMatch(p));
    4648        }
    4749    }
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReaderTest.java

    r34153 r35899  
    22package org.openstreetmap.josm.plugins.opendata.core.io.geographic;
    33
    4 import static org.junit.Assert.assertNotNull;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.io.File;
     
    99import java.io.InputStream;
    1010
    11 import org.junit.Rule;
    12 import org.junit.Test;
     11import org.junit.jupiter.api.Test;
     12import org.junit.jupiter.api.extension.RegisterExtension;
    1313import org.openstreetmap.josm.TestUtils;
    1414import org.openstreetmap.josm.data.osm.Node;
    1515import org.openstreetmap.josm.testutils.JOSMTestRules;
     16import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1617
    1718/**
    1819 * Unit tests of {@link GmlReader} class.
    1920 */
    20 public class GmlReaderTest {
     21@BasicPreferences
     22class GmlReaderTest {
    2123
    2224    /**
    2325     * Setup test.
    2426     */
    25     @Rule
    26     public JOSMTestRules rules = new JOSMTestRules().preferences().projection().timeout(60000);
     27    @RegisterExtension
     28    JOSMTestRules rules = new JOSMTestRules().projection().timeout(60000);
    2729
    2830    /**
     
    3133     */
    3234    @Test
    33     public void testTicket11624() throws Exception {
     35    void testTicket11624() throws Exception {
    3436        File file = new File(TestUtils.getRegressionDataFile(11624, "temp3.gml"));
    3537        try (InputStream is = new FileInputStream(file)) {
    3638            for (Node n : GmlReader.parseDataSet(is, null, null).getNodes()) {
    37                 assertNotNull(n.toString(), n.getCoor());
    38                 assertTrue(n.get("KICH_URL"), n.get("KICH_URL").startsWith("http://"));
     39                assertNotNull(n.getCoor(), n.toString());
     40                assertTrue(n.get("KICH_URL").startsWith("http://"), n.get("KICH_URL"));
    3941            }
    4042        }
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReaderTest.java

    r34331 r35899  
    22package org.openstreetmap.josm.plugins.opendata.core.io.geographic;
    33
    4 import static org.junit.Assert.assertFalse;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertFalse;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.io.InputStream;
    88
    9 import org.junit.Rule;
    10 import org.junit.Test;
     9import org.junit.jupiter.api.Test;
     10import org.junit.jupiter.api.extension.RegisterExtension;
    1111import org.openstreetmap.josm.TestUtils;
    1212import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1313import org.openstreetmap.josm.testutils.JOSMTestRules;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1415
    1516/**
    1617 * Unit tests of {@link KmlReader} class.
    1718 */
    18 public class KmlReaderTest {
     19@BasicPreferences
     20class KmlReaderTest {
    1921
    2022    /**
    2123     * Setup test.
    2224     */
    23     @Rule
    24     public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
     25    RegisterExtension
     26    JOSMTestRules rules = new JOSMTestRules().projection();
    2527
    2628    /**
     
    2830     */
    2931    @Test
    30     public void testColorPattern() {
     32    void testColorPattern() {
    3133        assertTrue(KmlReader.COLOR_PATTERN.matcher("00112233").matches());
    3234        assertTrue(KmlReader.COLOR_PATTERN.matcher("44556677").matches());
     
    4547     */
    4648    @Test
    47     public void testTicket16402() throws Exception {
     49    void testTicket16402() throws Exception {
    4850        try (InputStream is = TestUtils.getRegressionDataStream(16402, "MapsMe-new.kml")) {
    4951            NonRegFunctionalTests.testGeneric("#16402", KmlReader.parseDataSet(is, null));
     
    5658     */
    5759    @Test
    58     public void testTicket12694() throws Exception {
     60    void testTicket12694() throws Exception {
    5961        try (InputStream is = TestUtils.getRegressionDataStream(12694, "Alvinรณpolis_314946.kml")) {
    6062            NonRegFunctionalTests.testGeneric("#12694", KmlReader.parseDataSet(is, null));
     
    6769     */
    6870    @Test
    69     public void testTicket10214() throws Exception {
     71    void testTicket10214() throws Exception {
    7072        try (InputStream is = TestUtils.getRegressionDataStream(10214, "utf8_test.kml")) {
    7173            NonRegFunctionalTests.testTicket10214(KmlReader.parseDataSet(is, null));
     
    7880     */
    7981    @Test
    80     public void testTicket7714() throws Exception {
     82    void testTicket7714() throws Exception {
    8183        try (InputStream is = TestUtils.getRegressionDataStream(7714, "doc.kml")) {
    8284            NonRegFunctionalTests.testGeneric("#7714", KmlReader.parseDataSet(is, null));
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/MifReaderTest.java

    r33156 r35899  
    77import java.io.InputStream;
    88
    9 import org.junit.Rule;
    10 import org.junit.Test;
     9import org.junit.jupiter.api.Test;
     10import org.junit.jupiter.api.extension.RegisterExtension;
    1111import org.openstreetmap.josm.TestUtils;
    1212import org.openstreetmap.josm.data.osm.DataSet;
     
    1515import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1616import org.openstreetmap.josm.testutils.JOSMTestRules;
     17import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1718
    1819/**
    1920 * Unit tests of {@link MifReader} class.
    2021 */
    21 public class MifReaderTest {
     22@BasicPreferences
     23class MifReaderTest {
    2224
    2325    /**
    2426     * Setup test.
    2527     */
    26     @Rule
    27     public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
     28    @RegisterExtension
     29    JOSMTestRules rules = new JOSMTestRules().projection();
    2830
    2931    private static AbstractDataSetHandler newHandler(final String epsgCode) {
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReaderTest.java

    r35183 r35899  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.opendata.core.io.geographic;
    3 
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertNotNull;
    7 import static org.junit.Assert.assertTrue;
    83
    94import java.io.File;
     
    116import java.io.InputStream;
    127import java.util.Collection;
     8import java.util.Objects;
    139
    14 import org.junit.Ignore;
    15 import org.junit.Rule;
    16 import org.junit.Test;
     10import org.junit.jupiter.api.Disabled;
     11import org.junit.jupiter.api.Test;
     12import org.junit.jupiter.api.extension.RegisterExtension;
    1713import org.openstreetmap.josm.TestUtils;
    1814import org.openstreetmap.josm.data.coor.LatLon;
     
    2117import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    2218import org.openstreetmap.josm.testutils.JOSMTestRules;
     19import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     20
     21import static org.junit.jupiter.api.Assertions.assertEquals;
     22import static org.junit.jupiter.api.Assertions.assertFalse;
     23import static org.junit.jupiter.api.Assertions.assertNotEquals;
     24import static org.junit.jupiter.api.Assertions.assertNotNull;
     25import static org.junit.jupiter.api.Assertions.assertTrue;
    2326
    2427/**
    2528 * Unit tests of {@link ShpReader} class.
    2629 */
    27 public class ShpReaderTest {
     30@BasicPreferences
     31class ShpReaderTest {
    2832
    2933    /**
    3034     * Setup test.
    3135     */
    32     @Rule
    33     public JOSMTestRules rules = new JOSMTestRules().preferences().projection().timeout(60000);
     36    @RegisterExtension
     37    JOSMTestRules rules = new JOSMTestRules().projection().timeout(60000);
    3438
    3539    /**
     
    3842     */
    3943    @Test
    40     public void testTicket12714() throws Exception {
     44    void testTicket12714() throws Exception {
    4145        File file = new File(TestUtils.getRegressionDataFile(12714, "linhas.shp"));
    4246        try (InputStream is = new FileInputStream(file)) {
    4347            for (Node n : ShpReader.parseDataSet(is, file, null, null).getNodes()) {
    44                 assertNotNull(n.toString(), n.getCoor());
     48                assertNotNull(n.getCoor(), n.toString());
    4549            }
    4650        }
     
    5256     */
    5357    @Test
    54     @Ignore("work in progress")
    55     public void testTicket11761() throws Exception {
     58    @Disabled("work in progress")
     59    void testTicket11761() throws Exception {
    5660        File file = new File(TestUtils.getRegressionDataFile(11761, "HAR.shp"));
    5761        try (InputStream is = new FileInputStream(file)) {
    5862            for (Node n : ShpReader.parseDataSet(is, file, null, null).getNodes()) {
    59                 assertNotNull(n.toString(), n.getCoor());
    60                 assertFalse(n.toString(), LatLon.ZERO.equals(n.getCoor()));
    61                 assertFalse(n.toString(), n.isOutSideWorld());
    62                 assertTrue(n.toString(), n.getCoor().isValid());
     63                assertNotNull(n.getCoor(), n.toString());
     64                assertNotEquals(LatLon.ZERO, n.getCoor(), n.toString());
     65                assertFalse(n.isOutSideWorld(), n.toString());
     66                assertTrue(Objects.requireNonNull(n.getCoor()).isValid(), n.toString());
    6367            }
    6468        }
     
    7074     */
    7175    @Test
    72     public void testTicket10214() throws Exception {
     76    void testTicket10214() throws Exception {
    7377        File file = new File(TestUtils.getRegressionDataFile(10214, "utf8_test.shp"));
    7478        try (InputStream is = new FileInputStream(file)) {
     
    8286     */
    8387    @Test
    84     public void testTicket8309() throws Exception {
     88    void testTicket8309() throws Exception {
    8589        File file = new File(TestUtils.getRegressionDataFile(8309, "new_ti_declarada.shp"));
    8690        try (InputStream is = new FileInputStream(file)) {
     
    9498     */
    9599    @Test
    96     public void testTicket13843() throws Exception {
     100    void testTicket13843() throws Exception {
    97101        File file = new File(TestUtils.getRegressionDataFile(13843, "test.shp"));
    98102        try (InputStream is = new FileInputStream(file)) {
     
    110114     */
    111115    @Test
    112     public void testTicket17529() throws Exception {
     116    void testTicket17529() throws Exception {
    113117        // There is only 1 feature in this data set.
    114118        File file = new File(TestUtils.getRegressionDataFile(17529, "west_webmerc.shp"));
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/TabReaderTest.java

    r34153 r35899  
    66import java.io.InputStream;
    77
    8 import org.junit.Rule;
    9 import org.junit.Test;
     8import org.junit.jupiter.api.Test;
     9import org.junit.jupiter.api.extension.RegisterExtension;
    1010import org.openstreetmap.josm.TestUtils;
    1111import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1212import org.openstreetmap.josm.testutils.JOSMTestRules;
     13import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1314
    1415/**
    1516 * Unit tests of {@link TabReader} class.
    1617 */
    17 public class TabReaderTest {
     18@BasicPreferences
     19class TabReaderTest {
    1820
    1921    /**
    2022     * Setup test.
    2123     */
    22     @Rule
    23     public JOSMTestRules rules = new JOSMTestRules().preferences().projection().timeout(60000);
     24    @RegisterExtension
     25    JOSMTestRules rules = new JOSMTestRules().projection().timeout(60000);
    2426
    2527    /**
     
    2830     */
    2931    @Test
    30     public void testTicket15159() throws Exception {
     32    void testTicket15159() throws Exception {
    3133        File file = new File(TestUtils.getRegressionDataFile(15159, "Sanisette.tab"));
    3234        try (InputStream is = new FileInputStream(file)) {
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/tabular/CsvReaderTest.java

    r35102 r35899  
    44import java.io.InputStream;
    55
    6 import org.junit.Rule;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.Test;
     7import org.junit.jupiter.api.extension.RegisterExtension;
    88import org.openstreetmap.josm.TestUtils;
    99import org.openstreetmap.josm.data.coor.EastNorth;
     
    1414import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1515import org.openstreetmap.josm.testutils.JOSMTestRules;
     16import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1617
    1718/**
    1819 * Unit tests of {@link CsvReader} class.
    1920 */
    20 public class CsvReaderTest {
     21@BasicPreferences
     22class CsvReaderTest {
    2123
    2224    /**
    2325     * Setup test.
    2426     */
    25     @Rule
    26     public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
     27    @RegisterExtension
     28    JOSMTestRules rules = new JOSMTestRules().projection();
    2729
    2830    private static AbstractDataSetHandler newHandler(final String epsgCode) {
     
    5658     */
    5759    @Test
    58     public void testTicket18029() throws Exception {
     60    void testTicket18029() throws Exception {
    5961        try (InputStream is = TestUtils.getRegressionDataStream(18029, "gtfs_stops.broken.csv")) {
    6062            NonRegFunctionalTests.testGeneric("#18029", CsvReader.parseDataSet(is, newHandler("EPSG:4326"), null));
     
    6769     */
    6870    @Test
    69     public void testTicket13508() throws Exception {
     71    void testTicket13508() throws Exception {
    7072        try (InputStream is = TestUtils.getRegressionDataStream(13508, "arrets-de-bus0.csv")) {
    7173            NonRegFunctionalTests.testGeneric("#13508", CsvReader.parseDataSet(is, newHandler("EPSG:4326"), null));
     
    7880     */
    7981    @Test
    80     public void testTicket10214() throws Exception {
     82    void testTicket10214() throws Exception {
    8183        try (InputStream is = TestUtils.getRegressionDataStream(10214, "utf8_test.csv")) {
    8284            NonRegFunctionalTests.testTicket10214(CsvReader.parseDataSet(is, newHandler("EPSG:4326"), null));
     
    8991     */
    9092    @Test
    91     public void testTicket8805() throws Exception {
     93    void testTicket8805() throws Exception {
    9294        try (InputStream is = TestUtils.getRegressionDataStream(8805, "XXX.csv")) {
    9395            NonRegFunctionalTests.testGeneric("#8805", CsvReader.parseDataSet(is, newHandler("EPSG:4326"), null));
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/tabular/OdsReaderTest.java

    r34153 r35899  
    44import java.io.InputStream;
    55
    6 import org.junit.Rule;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.Test;
     7import org.junit.jupiter.api.extension.RegisterExtension;
    88import org.openstreetmap.josm.TestUtils;
    99import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1010import org.openstreetmap.josm.testutils.JOSMTestRules;
     11import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1112
    1213/**
    1314 * Unit tests of {@link OdsReader} class.
    1415 */
    15 public class OdsReaderTest {
     16@BasicPreferences
     17class OdsReaderTest {
    1618
    1719    /**
    1820     * Setup test.
    1921     */
    20     @Rule
    21     public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
     22    @RegisterExtension
     23    JOSMTestRules rules = new JOSMTestRules().projection();
    2224
    2325    /**
     
    2628     */
    2729    @Test
    28     public void testTicket13821() throws Exception {
     30    void testTicket13821() throws Exception {
    2931        try (InputStream is = TestUtils.getRegressionDataStream(13821, "1_set_v_0.6_2016_06_21_06_00_23_a.ods")) {
    3032            NonRegFunctionalTests.testGeneric("#13821", OdsReader.parseDataSet(is, null, null));
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/tabular/XlsReaderTest.java

    r34153 r35899  
    22package org.openstreetmap.josm.plugins.opendata.core.io.tabular;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertNotNull;
    6 
    74import java.io.InputStream;
    85
    9 import org.junit.Rule;
    10 import org.junit.Test;
     6import org.junit.jupiter.api.Test;
     7import org.junit.jupiter.api.extension.RegisterExtension;
    118import org.openstreetmap.josm.TestUtils;
    129import org.openstreetmap.josm.data.coor.EastNorth;
     
    1815import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1916import org.openstreetmap.josm.testutils.JOSMTestRules;
     17import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     18
     19import static org.junit.jupiter.api.Assertions.assertEquals;
     20import static org.junit.jupiter.api.Assertions.assertNotNull;
    2021
    2122/**
    2223 * Unit tests of {@link XlsReader} class.
    2324 */
    24 public class XlsReaderTest {
     25@BasicPreferences
     26class XlsReaderTest {
    2527
    2628    /**
    2729     * Setup test.
    2830     */
    29     @Rule
    30     public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
     31    @RegisterExtension
     32    public JOSMTestRules rules = new JOSMTestRules().projection();
    3133
    3234    private static AbstractDataSetHandler newHandler(final String epsgCode) {
     
    6062     */
    6163    @Test
    62     public void testTicket15980() throws Exception {
     64    void testTicket15980() throws Exception {
    6365        try (InputStream is = TestUtils.getRegressionDataStream(15980, "qry_OSM_Import_Orte.xls")) {
    6466            DataSet ds = XlsReader.parseDataSet(is, newHandler("EPSG:4326"), null);
     
    7274    private static void doTest15980(DataSet ds, String name, String addr, String fixme) {
    7375        OsmPrimitive osm = ds.getPrimitives(o -> name.equals(o.get("name"))).iterator().next();
    74         assertNotNull(name, osm);
     76        assertNotNull(osm, name);
    7577        assertEquals(addr, osm.get("addr:housenumber"));
    7678        assertEquals(fixme, osm.get("fixme"));
Note: See TracChangeset for help on using the changeset viewer.