Changeset 6920 in josm for trunk/test
- Timestamp:
- 2014-03-21T17:31:18+01:00 (11 years ago)
- Location:
- trunk/test
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/fixtures/JOSMFixture.java
r6471 r6920 11 11 12 12 import org.openstreetmap.josm.Main; 13 import org.openstreetmap.josm.data.Preferences;14 13 import org.openstreetmap.josm.data.projection.Projections; 15 14 import org.openstreetmap.josm.io.OsmApi; … … 73 72 // 74 73 String url = OsmApi.getOsmApi().getBaseUrl().toLowerCase().trim(); 75 if (url.startsWith("http://www.openstreetmap.org") 76 || url.startsWith("http://api.openstreetmap.org")) {74 if (url.startsWith("http://www.openstreetmap.org") || url.startsWith("http://api.openstreetmap.org") 75 || url.startsWith("https://www.openstreetmap.org") || url.startsWith("https://api.openstreetmap.org")) { 77 76 fail(MessageFormat.format("configured server url ''{0}'' seems to be a productive url, aborting.", url)); 78 77 } -
trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
r6881 r6920 189 189 // 190 190 String url = OsmApi.getOsmApi().getBaseUrl().toLowerCase().trim(); 191 if (url.startsWith("http://www.openstreetmap.org") 192 || url.startsWith("http://api.openstreetmap.org")) {191 if (url.startsWith("http://www.openstreetmap.org") || url.startsWith("http://api.openstreetmap.org") 192 || url.startsWith("https://www.openstreetmap.org") || url.startsWith("https://api.openstreetmap.org")) { 193 193 fail(MessageFormat.format("configured url ''{0}'' seems to be a productive url, aborting.", url)); 194 194 } 195 196 195 197 196 String p = System.getProperties().getProperty("useCachedDataset"); -
trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
r6881 r6920 196 196 // 197 197 String url = OsmApi.getOsmApi().getBaseUrl().toLowerCase().trim(); 198 if (url.startsWith("http://www.openstreetmap.org") 199 || url.startsWith("http://api.openstreetmap.org")) {198 if (url.startsWith("http://www.openstreetmap.org") || url.startsWith("http://api.openstreetmap.org") 199 || url.startsWith("https://www.openstreetmap.org") || url.startsWith("https://api.openstreetmap.org")) { 200 200 fail(MessageFormat.format("configured url ''{0}'' seems to be a productive url, aborting.", url)); 201 201 } 202 203 202 204 203 String p = System.getProperties().getProperty("useCachedDataset"); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
r6881 r6920 43 43 public void testCheckOpeningHourSyntax1() throws Exception { 44 44 final String key = "opening_hours"; 45 // frequently used tags according to http ://taginfo.openstreetmap.org/keys/opening_hours#values45 // frequently used tags according to https://taginfo.openstreetmap.org/keys/opening_hours#values 46 46 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "24/7"), isEmpty()); 47 47 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 08:30-20:00"), isEmpty()); … … 117 117 public void testCheckServiceTimeSyntax1() throws Exception { 118 118 final String key = "service_times"; 119 // frequently used tags according to http ://taginfo.openstreetmap.org/keys/service_times#values119 // frequently used tags according to https://taginfo.openstreetmap.org/keys/service_times#values 120 120 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su 10:00", OpeningHourTest.CheckMode.BOTH), isEmpty()); 121 121 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "automatic", OpeningHourTest.CheckMode.BOTH), not(isEmpty())); … … 131 131 public void testCheckCollectionTimeSyntax1() throws Exception { 132 132 final String key = "collection_times"; 133 // frequently used tags according to http ://taginfo.openstreetmap.org/keys/collection_times#values133 // frequently used tags according to https://taginfo.openstreetmap.org/keys/collection_times#values 134 134 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Sa 09:00", OpeningHourTest.CheckMode.BOTH), isEmpty()); 135 135 assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "fixme", OpeningHourTest.CheckMode.BOTH), not(isEmpty())); -
trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java
r6483 r6920 14 14 */ 15 15 private static final ParseTestItem[] parseTestData = { 16 new ParseTestItem("http ://www.openstreetmap.org", null),17 new ParseTestItem("http ://www.openstreetmap.org/?bbox=-0.489,51.28,0.236,51.686", new Bounds(51.28, -0.489, 51.686, 0.236)),18 new ParseTestItem("http ://www.openstreetmap.org/?minlon=-0.489&minlat=51.28&maxlon=0.236&maxlat=51.686", new Bounds(51.28, -0.489, 51.686, 0.236)),19 new ParseTestItem("http ://www.openstreetmap.org/?maxlat=51.686&maxlon=0.236&minlat=51.28&minlon=-0.489", new Bounds(51.28, -0.489, 51.686, 0.236)),20 new ParseTestItem("http ://www.openstreetmap.org/?zoom=17&lat=51.71873&lon=8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),21 new ParseTestItem("http ://www.openstreetmap.org/?lon=8.76164&lat=51.71873&zoom=17&foo", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),22 new ParseTestItem("http ://www.openstreetmap.org/?mlon=8.76164&mlat=51.71873", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 18)),16 new ParseTestItem("https://www.openstreetmap.org", null), 17 new ParseTestItem("https://www.openstreetmap.org/?bbox=-0.489,51.28,0.236,51.686", new Bounds(51.28, -0.489, 51.686, 0.236)), 18 new ParseTestItem("https://www.openstreetmap.org/?minlon=-0.489&minlat=51.28&maxlon=0.236&maxlat=51.686", new Bounds(51.28, -0.489, 51.686, 0.236)), 19 new ParseTestItem("https://www.openstreetmap.org/?maxlat=51.686&maxlon=0.236&minlat=51.28&minlon=-0.489", new Bounds(51.28, -0.489, 51.686, 0.236)), 20 new ParseTestItem("https://www.openstreetmap.org/?zoom=17&lat=51.71873&lon=8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 21 new ParseTestItem("https://www.openstreetmap.org/?lon=8.76164&lat=51.71873&zoom=17&foo", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 22 new ParseTestItem("https://www.openstreetmap.org/?mlon=8.76164&mlat=51.71873", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 18)), 23 23 new ParseTestItem("http://osm.org/go/euulwp", OsmUrlToBounds.positionToBounds(51.48262023925781, -0.29937744140625, 8)), 24 new ParseTestItem("http ://www.openstreetmap.org/#map=17/51.71873/8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),25 new ParseTestItem("http ://www.openstreetmap.org/#map=17/51.71873/8.76164&layers=CN", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),26 new ParseTestItem("http %3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)),27 new ParseTestItem("http %3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164%26layers%3DCN", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)),28 new ParseTestItem("http ://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020", OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)),29 new ParseTestItem("http ://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020&layers=N", OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)),30 new ParseTestItem("http ://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.1270", OsmUrlToBounds.positionToBounds(51.4831, -0.1270, 10)),31 new ParseTestItem("http ://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.3509&layers=T", OsmUrlToBounds.positionToBounds(51.4831, -0.3509, 10)),32 new ParseTestItem("http ://www.openstreetmap.org/#map", null),33 new ParseTestItem("http ://www.openstreetmap.org/#map=foo", null),34 new ParseTestItem("http ://www.openstreetmap.org/#map=fooz/foolat/foolon", null)24 new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 25 new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164&layers=CN", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)), 26 new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)), 27 new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164%26layers%3DCN", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)), 28 new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020", OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)), 29 new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020&layers=N", OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)), 30 new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.1270", OsmUrlToBounds.positionToBounds(51.4831, -0.1270, 10)), 31 new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.3509&layers=T", OsmUrlToBounds.positionToBounds(51.4831, -0.3509, 10)), 32 new ParseTestItem("https://www.openstreetmap.org/#map", null), 33 new ParseTestItem("https://www.openstreetmap.org/#map=foo", null), 34 new ParseTestItem("https://www.openstreetmap.org/#map=fooz/foolat/foolon", null) 35 35 }; 36 36 … … 38 38 public String url; 39 39 public Bounds bounds; 40 40 41 41 public ParseTestItem(String url, Bounds bounds) { 42 42 this.url = url; -
trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
r6661 r6920 2 2 package org.openstreetmap.josm.tools; 3 3 4 import org.junit.Assert; 5 import org.junit.Test; 6 import org.openstreetmap.josm.Main; 4 import static org.hamcrest.CoreMatchers.is; 5 import static org.junit.Assert.assertThat; 7 6 8 7 import java.io.BufferedReader; … … 11 10 import java.util.Locale; 12 11 13 import static org.hamcrest.CoreMatchers.is; 14 import static org.junit.Assert.assertThat; 12 import org.junit.Assert; 13 import org.junit.Test; 14 import org.openstreetmap.josm.Main; 15 15 16 16 /** … … 24 24 @Test 25 25 public void testStrip() { 26 final String someWhite = 26 final String someWhite = 27 27 "\u00A0"+ // SPACE_SEPARATOR 28 28 "\u2007"+ // LINE_SEPARATOR … … 79 79 public void testOpenUrlGzip() throws Exception { 80 80 Main.initApplicationPreferences(); 81 final BufferedReader x = Utils.openURLReaderAndDecompress(new URL("http ://www.openstreetmap.org/trace/1613906/data"), true);81 final BufferedReader x = Utils.openURLReaderAndDecompress(new URL("https://www.openstreetmap.org/trace/1613906/data"), true); 82 82 Assert.assertTrue(x.readLine().startsWith("<?xml version=")); 83 83 x.close(); … … 87 87 public void testOpenUrlBzip() throws Exception { 88 88 Main.initApplicationPreferences(); 89 final BufferedReader x = Utils.openURLReaderAndDecompress(new URL("http ://www.openstreetmap.org/trace/785544/data"), true);89 final BufferedReader x = Utils.openURLReaderAndDecompress(new URL("https://www.openstreetmap.org/trace/785544/data"), true); 90 90 Assert.assertTrue(x.readLine().startsWith("<?xml version=")); 91 91 x.close();
Note:
See TracChangeset
for help on using the changeset viewer.