Changeset 10850 in josm for trunk/test/unit/org
- Timestamp:
- 2016-08-19T01:16:51+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r10510 r10850 101 101 Main.logLevel = 3; 102 102 Main.pref.init(false); 103 String url = Main.pref.get("osm-server.url"); 104 if (url == null || url.isEmpty() || isProductionApiUrl(url)) { 105 Main.pref.put("osm-server.url", "http://api06.dev.openstreetmap.org/api"); 106 } 103 107 I18n.set(Main.pref.get("language", "en")); 104 108 … … 113 117 114 118 // make sure we don't upload to or test against production 115 // 116 String url = OsmApi.getOsmApi().getBaseUrl().toLowerCase(Locale.ENGLISH).trim(); 117 if (url.startsWith("http://www.openstreetmap.org") || url.startsWith("http://api.openstreetmap.org") 118 || url.startsWith("https://www.openstreetmap.org") || url.startsWith("https://api.openstreetmap.org")) { 119 url = OsmApi.getOsmApi().getBaseUrl().toLowerCase(Locale.ENGLISH).trim(); 120 if (isProductionApiUrl(url)) { 119 121 fail(MessageFormat.format("configured server url ''{0}'' seems to be a productive url, aborting.", url)); 120 122 } … … 128 130 }); 129 131 } 132 } 133 134 private static boolean isProductionApiUrl(String url) { 135 return url.startsWith("http://www.openstreetmap.org") || url.startsWith("http://api.openstreetmap.org") 136 || url.startsWith("https://www.openstreetmap.org") || url.startsWith("https://api.openstreetmap.org"); 130 137 } 131 138
Note:
See TracChangeset
for help on using the changeset viewer.