Changeset 35899 in osm for applications/editors/josm/plugins/opendata/test/unit
- Timestamp:
- 2022-01-25T01:04:25+01:00 (3 years ago)
- Location:
- applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/NonRegFunctionalTests.java
r35183 r35899 1 1 // License: GPL. For details, see LICENSE file. 2 2 package 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;7 3 8 4 import java.io.IOException; … … 23 19 import org.openstreetmap.josm.tools.CheckParameterUtil; 24 20 21 import static org.junit.jupiter.api.Assertions.assertEquals; 22 import static org.junit.jupiter.api.Assertions.assertFalse; 23 import static org.junit.jupiter.api.Assertions.assertNotNull; 24 import static org.junit.jupiter.api.Assertions.assertTrue; 25 25 26 /** 26 27 * Superclass of non-reg functional tests. … … 37 38 // Every dataset should at least contain a node 38 39 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); 40 41 // Nodes should all have valid coordinates 41 42 for (Node n : nodes) { 42 43 LatLon latlon = n.getCoor(); 43 assert True("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); 46 47 } 47 48 // and no empty ways 48 49 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); 50 51 } 51 52 // neither empty relations 52 53 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); 54 55 } 55 56 } … … 77 78 * @param ext file extension to search for 78 79 * @return all datasets files matching given extension 79 * @returns List of all datasets files matching given extension80 80 * @throws IOException in case of I/O error 81 81 */ -
applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipReaderTest.java
r33518 r35899 8 8 import java.util.Map.Entry; 9 9 10 import org.junit. Rule;11 import org.junit. Test;10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension; 12 12 import org.openstreetmap.josm.data.osm.DataSet; 13 13 import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests; 14 14 import org.openstreetmap.josm.testutils.JOSMTestRules; 15 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 15 16 import org.openstreetmap.josm.tools.Logging; 16 17 … … 18 19 * Unit tests of {@link ZipReader} class. 19 20 */ 20 public class ZipReaderTest { 21 @BasicPreferences 22 class ZipReaderTest { 21 23 22 24 /** 23 25 * Setup test. 24 26 */ 25 @R ule26 public JOSMTestRules rules = new JOSMTestRules().pr eferences().projection().noTimeout();27 @RegisterExtension 28 public JOSMTestRules rules = new JOSMTestRules().projection().noTimeout(); 27 29 28 30 /** … … 31 33 */ 32 34 @Test 33 publicvoid testReadZipFiles() throws Exception {35 void testReadZipFiles() throws Exception { 34 36 for (Path p : NonRegFunctionalTests.listDataFiles("zip")) { 35 37 File zipfile = p.toFile(); -
applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/datasets/DataSetUpdaterTest.java
r33388 r35899 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.plugins.opendata.core.io.datasets; 3 4 import static org.junit.Assert.assertFalse;5 import static org.junit.Assert.assertTrue;6 3 7 4 import java.io.File; … … 10 7 import java.util.function.Predicate; 11 8 12 import org.junit. Rule;13 import org.junit. Test;9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension; 14 11 import org.openstreetmap.josm.TestUtils; 15 12 import org.openstreetmap.josm.data.osm.DataSet; … … 19 16 import org.openstreetmap.josm.plugins.opendata.core.io.archive.ZipReader; 20 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 19 20 import static org.junit.jupiter.api.Assertions.assertFalse; 21 import static org.junit.jupiter.api.Assertions.assertTrue; 21 22 22 23 /** 23 24 * Unit tests of {@link DataSetUpdater} class. 24 25 */ 25 public class DataSetUpdaterTest { 26 @BasicPreferences 27 class DataSetUpdaterTest { 26 28 27 29 /** 28 30 * Setup test. 29 31 */ 30 @R ule31 publicJOSMTestRules rules = new JOSMTestRules().preferences().projection().devAPI().timeout(60000);32 @RegisterExtension 33 JOSMTestRules rules = new JOSMTestRules().projection().devAPI().timeout(60000); 32 34 33 35 /** … … 36 38 */ 37 39 @Test 38 publicvoid testTicket11166() throws Exception {40 void testTicket11166() throws Exception { 39 41 File file = new File(TestUtils.getRegressionDataFile(11166, "raba760dissJosm.zip")); 40 42 try (InputStream is = new FileInputStream(file)) { 41 43 Predicate<? super Way> p = w -> w.getNodesCount() >= 0.9 * OsmApi.getOsmApi().getCapabilities().getMaxWayNodes(); 42 44 DataSet ds = ZipReader.parseDataSet(is, null, null, false); 43 assertTrue(ds.getWays().stream(). filter(p).findAny().isPresent());45 assertTrue(ds.getWays().stream().anyMatch(p)); 44 46 DataSetUpdater.updateDataSet(ds, null, file); 45 assertFalse(ds.getWays().stream(). filter(p).findAny().isPresent());47 assertFalse(ds.getWays().stream().anyMatch(p)); 46 48 } 47 49 } -
applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReaderTest.java
r34153 r35899 2 2 package org.openstreetmap.josm.plugins.opendata.core.io.geographic; 3 3 4 import static org.junit. Assert.assertNotNull;5 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 7 import java.io.File; … … 9 9 import java.io.InputStream; 10 10 11 import org.junit. Rule;12 import org.junit. Test;11 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.extension.RegisterExtension; 13 13 import org.openstreetmap.josm.TestUtils; 14 14 import org.openstreetmap.josm.data.osm.Node; 15 15 import org.openstreetmap.josm.testutils.JOSMTestRules; 16 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 16 17 17 18 /** 18 19 * Unit tests of {@link GmlReader} class. 19 20 */ 20 public class GmlReaderTest { 21 @BasicPreferences 22 class GmlReaderTest { 21 23 22 24 /** 23 25 * Setup test. 24 26 */ 25 @R ule26 publicJOSMTestRules rules = new JOSMTestRules().preferences().projection().timeout(60000);27 @RegisterExtension 28 JOSMTestRules rules = new JOSMTestRules().projection().timeout(60000); 27 29 28 30 /** … … 31 33 */ 32 34 @Test 33 publicvoid testTicket11624() throws Exception {35 void testTicket11624() throws Exception { 34 36 File file = new File(TestUtils.getRegressionDataFile(11624, "temp3.gml")); 35 37 try (InputStream is = new FileInputStream(file)) { 36 38 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")); 39 41 } 40 42 } -
applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReaderTest.java
r34331 r35899 2 2 package org.openstreetmap.josm.plugins.opendata.core.io.geographic; 3 3 4 import static org.junit. Assert.assertFalse;5 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertFalse; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 7 import java.io.InputStream; 8 8 9 import org.junit. Rule;10 import org.junit. Test;9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension; 11 11 import org.openstreetmap.josm.TestUtils; 12 12 import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests; 13 13 import org.openstreetmap.josm.testutils.JOSMTestRules; 14 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 14 15 15 16 /** 16 17 * Unit tests of {@link KmlReader} class. 17 18 */ 18 public class KmlReaderTest { 19 @BasicPreferences 20 class KmlReaderTest { 19 21 20 22 /** 21 23 * Setup test. 22 24 */ 23 @Rule24 publicJOSMTestRules rules = new JOSMTestRules().preferences().projection();25 RegisterExtension 26 JOSMTestRules rules = new JOSMTestRules().projection(); 25 27 26 28 /** … … 28 30 */ 29 31 @Test 30 publicvoid testColorPattern() {32 void testColorPattern() { 31 33 assertTrue(KmlReader.COLOR_PATTERN.matcher("00112233").matches()); 32 34 assertTrue(KmlReader.COLOR_PATTERN.matcher("44556677").matches()); … … 45 47 */ 46 48 @Test 47 publicvoid testTicket16402() throws Exception {49 void testTicket16402() throws Exception { 48 50 try (InputStream is = TestUtils.getRegressionDataStream(16402, "MapsMe-new.kml")) { 49 51 NonRegFunctionalTests.testGeneric("#16402", KmlReader.parseDataSet(is, null)); … … 56 58 */ 57 59 @Test 58 publicvoid testTicket12694() throws Exception {60 void testTicket12694() throws Exception { 59 61 try (InputStream is = TestUtils.getRegressionDataStream(12694, "Alvinรณpolis_314946.kml")) { 60 62 NonRegFunctionalTests.testGeneric("#12694", KmlReader.parseDataSet(is, null)); … … 67 69 */ 68 70 @Test 69 publicvoid testTicket10214() throws Exception {71 void testTicket10214() throws Exception { 70 72 try (InputStream is = TestUtils.getRegressionDataStream(10214, "utf8_test.kml")) { 71 73 NonRegFunctionalTests.testTicket10214(KmlReader.parseDataSet(is, null)); … … 78 80 */ 79 81 @Test 80 publicvoid testTicket7714() throws Exception {82 void testTicket7714() throws Exception { 81 83 try (InputStream is = TestUtils.getRegressionDataStream(7714, "doc.kml")) { 82 84 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 7 7 import java.io.InputStream; 8 8 9 import org.junit. Rule;10 import org.junit. Test;9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension; 11 11 import org.openstreetmap.josm.TestUtils; 12 12 import org.openstreetmap.josm.data.osm.DataSet; … … 15 15 import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests; 16 16 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 17 18 18 19 /** 19 20 * Unit tests of {@link MifReader} class. 20 21 */ 21 public class MifReaderTest { 22 @BasicPreferences 23 class MifReaderTest { 22 24 23 25 /** 24 26 * Setup test. 25 27 */ 26 @R ule27 publicJOSMTestRules rules = new JOSMTestRules().preferences().projection();28 @RegisterExtension 29 JOSMTestRules rules = new JOSMTestRules().projection(); 28 30 29 31 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 1 1 // License: GPL. For details, see LICENSE file. 2 2 package 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;8 3 9 4 import java.io.File; … … 11 6 import java.io.InputStream; 12 7 import java.util.Collection; 8 import java.util.Objects; 13 9 14 import org.junit. Ignore;15 import org.junit. Rule;16 import org.junit. Test;10 import org.junit.jupiter.api.Disabled; 11 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.extension.RegisterExtension; 17 13 import org.openstreetmap.josm.TestUtils; 18 14 import org.openstreetmap.josm.data.coor.LatLon; … … 21 17 import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests; 22 18 import org.openstreetmap.josm.testutils.JOSMTestRules; 19 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 20 21 import static org.junit.jupiter.api.Assertions.assertEquals; 22 import static org.junit.jupiter.api.Assertions.assertFalse; 23 import static org.junit.jupiter.api.Assertions.assertNotEquals; 24 import static org.junit.jupiter.api.Assertions.assertNotNull; 25 import static org.junit.jupiter.api.Assertions.assertTrue; 23 26 24 27 /** 25 28 * Unit tests of {@link ShpReader} class. 26 29 */ 27 public class ShpReaderTest { 30 @BasicPreferences 31 class ShpReaderTest { 28 32 29 33 /** 30 34 * Setup test. 31 35 */ 32 @R ule33 publicJOSMTestRules rules = new JOSMTestRules().preferences().projection().timeout(60000);36 @RegisterExtension 37 JOSMTestRules rules = new JOSMTestRules().projection().timeout(60000); 34 38 35 39 /** … … 38 42 */ 39 43 @Test 40 publicvoid testTicket12714() throws Exception {44 void testTicket12714() throws Exception { 41 45 File file = new File(TestUtils.getRegressionDataFile(12714, "linhas.shp")); 42 46 try (InputStream is = new FileInputStream(file)) { 43 47 for (Node n : ShpReader.parseDataSet(is, file, null, null).getNodes()) { 44 assertNotNull(n.toString (), n.getCoor());48 assertNotNull(n.getCoor(), n.toString()); 45 49 } 46 50 } … … 52 56 */ 53 57 @Test 54 @ Ignore("work in progress")55 publicvoid testTicket11761() throws Exception {58 @Disabled("work in progress") 59 void testTicket11761() throws Exception { 56 60 File file = new File(TestUtils.getRegressionDataFile(11761, "HAR.shp")); 57 61 try (InputStream is = new FileInputStream(file)) { 58 62 for (Node n : ShpReader.parseDataSet(is, file, null, null).getNodes()) { 59 assertNotNull(n.toString (), n.getCoor());60 assert False(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()); 63 67 } 64 68 } … … 70 74 */ 71 75 @Test 72 publicvoid testTicket10214() throws Exception {76 void testTicket10214() throws Exception { 73 77 File file = new File(TestUtils.getRegressionDataFile(10214, "utf8_test.shp")); 74 78 try (InputStream is = new FileInputStream(file)) { … … 82 86 */ 83 87 @Test 84 publicvoid testTicket8309() throws Exception {88 void testTicket8309() throws Exception { 85 89 File file = new File(TestUtils.getRegressionDataFile(8309, "new_ti_declarada.shp")); 86 90 try (InputStream is = new FileInputStream(file)) { … … 94 98 */ 95 99 @Test 96 publicvoid testTicket13843() throws Exception {100 void testTicket13843() throws Exception { 97 101 File file = new File(TestUtils.getRegressionDataFile(13843, "test.shp")); 98 102 try (InputStream is = new FileInputStream(file)) { … … 110 114 */ 111 115 @Test 112 publicvoid testTicket17529() throws Exception {116 void testTicket17529() throws Exception { 113 117 // There is only 1 feature in this data set. 114 118 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 6 6 import java.io.InputStream; 7 7 8 import org.junit. Rule;9 import org.junit. Test;8 import org.junit.jupiter.api.Test; 9 import org.junit.jupiter.api.extension.RegisterExtension; 10 10 import org.openstreetmap.josm.TestUtils; 11 11 import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests; 12 12 import org.openstreetmap.josm.testutils.JOSMTestRules; 13 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 13 14 14 15 /** 15 16 * Unit tests of {@link TabReader} class. 16 17 */ 17 public class TabReaderTest { 18 @BasicPreferences 19 class TabReaderTest { 18 20 19 21 /** 20 22 * Setup test. 21 23 */ 22 @R ule23 publicJOSMTestRules rules = new JOSMTestRules().preferences().projection().timeout(60000);24 @RegisterExtension 25 JOSMTestRules rules = new JOSMTestRules().projection().timeout(60000); 24 26 25 27 /** … … 28 30 */ 29 31 @Test 30 publicvoid testTicket15159() throws Exception {32 void testTicket15159() throws Exception { 31 33 File file = new File(TestUtils.getRegressionDataFile(15159, "Sanisette.tab")); 32 34 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 4 4 import java.io.InputStream; 5 5 6 import org.junit. Rule;7 import org.junit. Test;6 import org.junit.jupiter.api.Test; 7 import org.junit.jupiter.api.extension.RegisterExtension; 8 8 import org.openstreetmap.josm.TestUtils; 9 9 import org.openstreetmap.josm.data.coor.EastNorth; … … 14 14 import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests; 15 15 import org.openstreetmap.josm.testutils.JOSMTestRules; 16 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 16 17 17 18 /** 18 19 * Unit tests of {@link CsvReader} class. 19 20 */ 20 public class CsvReaderTest { 21 @BasicPreferences 22 class CsvReaderTest { 21 23 22 24 /** 23 25 * Setup test. 24 26 */ 25 @R ule26 publicJOSMTestRules rules = new JOSMTestRules().preferences().projection();27 @RegisterExtension 28 JOSMTestRules rules = new JOSMTestRules().projection(); 27 29 28 30 private static AbstractDataSetHandler newHandler(final String epsgCode) { … … 56 58 */ 57 59 @Test 58 publicvoid testTicket18029() throws Exception {60 void testTicket18029() throws Exception { 59 61 try (InputStream is = TestUtils.getRegressionDataStream(18029, "gtfs_stops.broken.csv")) { 60 62 NonRegFunctionalTests.testGeneric("#18029", CsvReader.parseDataSet(is, newHandler("EPSG:4326"), null)); … … 67 69 */ 68 70 @Test 69 publicvoid testTicket13508() throws Exception {71 void testTicket13508() throws Exception { 70 72 try (InputStream is = TestUtils.getRegressionDataStream(13508, "arrets-de-bus0.csv")) { 71 73 NonRegFunctionalTests.testGeneric("#13508", CsvReader.parseDataSet(is, newHandler("EPSG:4326"), null)); … … 78 80 */ 79 81 @Test 80 publicvoid testTicket10214() throws Exception {82 void testTicket10214() throws Exception { 81 83 try (InputStream is = TestUtils.getRegressionDataStream(10214, "utf8_test.csv")) { 82 84 NonRegFunctionalTests.testTicket10214(CsvReader.parseDataSet(is, newHandler("EPSG:4326"), null)); … … 89 91 */ 90 92 @Test 91 publicvoid testTicket8805() throws Exception {93 void testTicket8805() throws Exception { 92 94 try (InputStream is = TestUtils.getRegressionDataStream(8805, "XXX.csv")) { 93 95 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 4 4 import java.io.InputStream; 5 5 6 import org.junit. Rule;7 import org.junit. Test;6 import org.junit.jupiter.api.Test; 7 import org.junit.jupiter.api.extension.RegisterExtension; 8 8 import org.openstreetmap.josm.TestUtils; 9 9 import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests; 10 10 import org.openstreetmap.josm.testutils.JOSMTestRules; 11 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 11 12 12 13 /** 13 14 * Unit tests of {@link OdsReader} class. 14 15 */ 15 public class OdsReaderTest { 16 @BasicPreferences 17 class OdsReaderTest { 16 18 17 19 /** 18 20 * Setup test. 19 21 */ 20 @R ule21 publicJOSMTestRules rules = new JOSMTestRules().preferences().projection();22 @RegisterExtension 23 JOSMTestRules rules = new JOSMTestRules().projection(); 22 24 23 25 /** … … 26 28 */ 27 29 @Test 28 publicvoid testTicket13821() throws Exception {30 void testTicket13821() throws Exception { 29 31 try (InputStream is = TestUtils.getRegressionDataStream(13821, "1_set_v_0.6_2016_06_21_06_00_23_a.ods")) { 30 32 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 2 2 package org.openstreetmap.josm.plugins.opendata.core.io.tabular; 3 3 4 import static org.junit.Assert.assertEquals;5 import static org.junit.Assert.assertNotNull;6 7 4 import java.io.InputStream; 8 5 9 import org.junit. Rule;10 import org.junit. Test;6 import org.junit.jupiter.api.Test; 7 import org.junit.jupiter.api.extension.RegisterExtension; 11 8 import org.openstreetmap.josm.TestUtils; 12 9 import org.openstreetmap.josm.data.coor.EastNorth; … … 18 15 import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests; 19 16 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 18 19 import static org.junit.jupiter.api.Assertions.assertEquals; 20 import static org.junit.jupiter.api.Assertions.assertNotNull; 20 21 21 22 /** 22 23 * Unit tests of {@link XlsReader} class. 23 24 */ 24 public class XlsReaderTest { 25 @BasicPreferences 26 class XlsReaderTest { 25 27 26 28 /** 27 29 * Setup test. 28 30 */ 29 @R ule30 public JOSMTestRules rules = new JOSMTestRules().pr eferences().projection();31 @RegisterExtension 32 public JOSMTestRules rules = new JOSMTestRules().projection(); 31 33 32 34 private static AbstractDataSetHandler newHandler(final String epsgCode) { … … 60 62 */ 61 63 @Test 62 publicvoid testTicket15980() throws Exception {64 void testTicket15980() throws Exception { 63 65 try (InputStream is = TestUtils.getRegressionDataStream(15980, "qry_OSM_Import_Orte.xls")) { 64 66 DataSet ds = XlsReader.parseDataSet(is, newHandler("EPSG:4326"), null); … … 72 74 private static void doTest15980(DataSet ds, String name, String addr, String fixme) { 73 75 OsmPrimitive osm = ds.getPrimitives(o -> name.equals(o.get("name"))).iterator().next(); 74 assertNotNull( name, osm);76 assertNotNull(osm, name); 75 77 assertEquals(addr, osm.get("addr:housenumber")); 76 78 assertEquals(fixme, osm.get("fixme"));
Note:
See TracChangeset
for help on using the changeset viewer.